How to use the @editorjs/editorjs.version function in @editorjs/editorjs

To help you get started, we’ve selected a few @editorjs/editorjs 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 tanepiper / ngx-tinynodes / libs / ngx-editorjs-ngrx / src / lib / effects / ngx-editorjs.effects.ts View on Github external
mergeMap(([action, blocks]) => {
      blocks.subscribe();
      return new SaveEnd({
        holder: action.payload.holder,
        data: {
          time: Date.now(),
          version: EditorJS.version,
          blocks: blocks
        }
      });
    })
  );
github tanepiper / ngx-tinynodes / libs / ngx-editorjs / ngx-editorjs / src / lib / types / injector.ts View on Github external
/**
   * The method to call when the editor makes a change
   */
  onChange?: (holder?: string) => void;

  /**
   * The method to call with an editor is ready
   */
  onReady?: (holder?: string) => void;
}

/**
 * Default values for each internal map
 */
export const MAP_DEFAULTS = [
  ['lastChangeMap', { time: 0, blocks: [], version: typeof EditorJS !== 'undefined' && EditorJS.version || ''}],
  ['isReadyMap', false],
  ['hasSavedMap', false]
];

/**
 * Injection token for the EditorJS class
 */
export const EDITORJS_MODULE_IMPORT = new InjectionToken('EDITORJS_MODULE_IMPORT');

/**
 * The EditorJS class injector
 */
export const EditorJSInstance = new InjectionToken('EditorJSInstance');

/**
 * Options for a Injector method
github tanepiper / ngx-tinynodes / libs / ngx-editorjs / src / lib / utils / editorjs-injector.ts View on Github external
this.zone.runOutsideAngular(() => {
      editor.blocks.render({
        time: Date.now(),
        version: EditorJS.version,
        blocks
      });
      this.zone.run(() => {
        this.blocksMap[holder].next(blocks);
        this.changeMap[holder].next(Date.now());
      });
    });
  }
github tanepiper / ngx-tinynodes / libs / ngx-editorjs / ngx-editorjs / src / lib / directives / ngx-editorjs.directive.ts View on Github external
private createConfig(): EditorConfig {
    const config: EditorConfig = createEditorJSConfig({
      holder: this.id,
      autofocus: this.autofocus,
      hideToolbar: this.hideToolbar,
      initialBlock: this.initialBlock,
      placeholder: this.blockPlaceholder,
      minHeight: this.minHeight,
      sanitizer: this.sanitizer
    });
    if (this.blocks && this.blocks.length > 0) {
      config.data = {
        time: Date.now(),
        version: typeof EditorJS !== 'undefined' && EditorJS.version || '',
        blocks: this.blocks
      };
    }
    return config;
  }
}

@editorjs/editorjs

Editor.js — Native JS, based on API and Open Source

Apache-2.0
Latest version published 4 months ago

Package Health Score

82 / 100
Full package analysis

Popular @editorjs/editorjs functions