All files / app/mods clipboard.ts

100% Statements 4/4
100% Branches 0/0
100% Functions 0/0
100% Lines 4/4

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57124x     124x   124x                                                                                           124x          
import { DateTime } from 'luxon';
import { Plugin } from '../model/plugin';
import { Mod } from '../model/tag';
import { refViewSchema } from '../model/ref';
 
export const userClipboardPlugin: Plugin = {
  tag: 'plugin/user/clipboard',
  name: $localize`🎨️ Clipboard`,
  config: {
    mod: $localize`🎨️ Clipboard`,
    experimental: true,
    settings: $localize`clipboard`,
    generated: $localize`Generated by jasper-ui ${DateTime.now().toISO()}`,
    description: $localize`Adds a multi-item in-browser clipboard stored locally and in your user URL Ref.`,
    internal: true,
    actions: [{
      event: 'clip',
      label: $localize`clip`,
      title: $localize`Add this Ref to the clipboard.`,
      global: true,
    }],
    form: [{
      key: 'interceptCopy',
      type: 'boolean',
      props: {
        label: $localize`Intercept Copy:`,
        title: $localize`Send copy commands to the Jasper clipboard instead of the system clipboard.`,
      },
    }],
  },
  schema: {
    optionalProperties: {
      interceptCopy: { type: 'boolean' },
      items: {
        elements: {
          properties: {
            id: { type: 'string' },
            created: { type: 'string' },
          },
          optionalProperties: {
            text: { type: 'string' },
            html: { type: 'string' },
            image: { type: 'string' },
            ref: refViewSchema,
          },
        },
      },
    },
  },
};
 
export const clipboardMod: Mod = {
  plugin: [
    userClipboardPlugin,
  ],
};