How to use the slate-base64-serializer.serialize function in slate-base64-serializer

To help you get started, we’ve selected a few slate-base64-serializer examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github olymp / olymp / packages / slate / use-json-state.es6 View on Github external
}
      });
      state = Value.fromJSON({
        document: {
          nodes: newValue.nodes,
          kind: 'document',
          data: { signal },
        },
        kind: 'value',
      });
    } else {
      state = Plain.deserialize('');
    }
    return {
      value: state,
      base64: Base64.serialize(state),
      toc: value && value.toc,
    };
  }),
  stateWrapper,
github olymp / olymp / packages / slate / use-json-state.es6 View on Github external
propagateChange = value => {
      this.base64 = Base64.serialize(value);
      if (this.base64 !== this.props.base64) {
        const json = value.toJSON();
        const { nodes } = json.document;
        let text = '';
        let title = null;
        let image = null;
        this.getAllBlocks(value.document.nodes, (node, parent) => {
          if (
            node.type === 'paragraph' &&
            (!parent ||
              (parent.type && parent.type.indexOf('heading') === -1)) &&
            node.text
          ) {
            text += `${node.text}\n`;
          }
          if (

slate-base64-serializer

A Base64 serializer for Slate editors.

MIT
Latest version published 5 years ago

Package Health Score

74 / 100
Full package analysis