@limetech/lime-elements 37.70.4 → 37.71.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -20,6 +20,12 @@ export const inserterFactory = (view) => {
20
20
  transaction.setMeta('stopTrigger', true);
21
21
  dispatch(transaction);
22
22
  },
23
+ stopTrigger: () => {
24
+ const { state, dispatch } = view;
25
+ const transaction = state.tr;
26
+ transaction.setMeta('stopTrigger', true);
27
+ dispatch(transaction);
28
+ },
23
29
  };
24
30
  };
25
31
  const createNode = (input, schema) => {
@@ -1 +1 @@
1
- {"version":3,"file":"inserter.js","sourceRoot":"","sources":["../../../../../../src/components/text-editor/prosemirror-adapter/plugins/trigger/inserter.ts"],"names":[],"mappings":"AAOA,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,IAAgB,EAAc,EAAE;EAC5D,MAAM,QAAQ,GAAG,uBAAuB,CAAC,IAAI,CAAC,CAAC;EAE/C,OAAO;IACH,MAAM,EAAE,CAAC,KAA8B,EAAE,EAAE;MACvC,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC;MACjC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC;MACpC,MAAM,EAAE,KAAK,EAAE,GAAG,SAAS,CAAC;MAE5B,IAAI,IAAU,CAAC;MAEf,IAAI;QACA,IAAI,GAAG,UAAU,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;OACpC;MAAC,OAAO,KAAK,EAAE;QACZ,sCAAsC;QACtC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAE7B,OAAO;OACV;MAED,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;MAEnC,MAAM,QAAQ,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC;MAElE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DAAoD,IAAI,EAAE,CAC7D,CAAC;GACL;EAED,OAAO,UAAU,CAAC;AACtB,CAAC,CAAC;AAEF,MAAM,uBAAuB,GAAG,CAAC,IAAgB,EAAU,EAAE;;EACzD,OAAO,MAAA,MAAA,MAAA,IAAI,CAAC,KAAK,0CAAE,SAAS,0CAAE,KAAK,0CAAE,GAAG,CAAC;AAC7C,CAAC,CAAC","sourcesContent":["import { Node, NodeType, Schema } from 'prosemirror-model';\nimport { EditorView } from 'prosemirror-view';\nimport {\n TextEditor,\n TextEditorNode,\n} from 'src/components/text-editor/text-editor.types';\n\nexport const inserterFactory = (view: EditorView): TextEditor => {\n const startPos = getTriggerStartPosition(view);\n\n return {\n insert: (input: TextEditorNode | string) => {\n const { state, dispatch } = view;\n const { schema, selection } = state;\n const { $from } = selection;\n\n let node: Node;\n\n try {\n node = createNode(input, schema);\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error(error.message);\n\n return;\n }\n\n const spaceNode = schema.text(' ');\n\n const fragment = schema.nodes.doc.create(null, [node, spaceNode]);\n\n const transaction = state.tr.replaceWith(\n startPos,\n $from.pos,\n fragment,\n );\n\n transaction.setMeta('stopTrigger', true);\n dispatch(transaction);\n },\n };\n};\n\nconst createNode = (input: TextEditorNode | string, schema: Schema): Node => {\n if (typeof input === 'string') {\n return schema.text(input);\n }\n\n const node = input.node;\n\n if (typeof node === 'string') {\n return schema.text(node);\n }\n\n const customNode = getCustomNode(node.tagName, schema);\n\n const childNodes: Node[] = (input.children ?? [])\n .map((child) => createNode(child, schema))\n .filter(Boolean);\n\n return customNode.create(node.attributes, childNodes);\n};\n\nconst getCustomNode = (name: string, schema: Schema): NodeType => {\n const customNode = Object.values(schema.nodes).find(\n (prosemirrorNode) => prosemirrorNode.name === name,\n );\n\n if (!customNode) {\n throw new Error(\n `A custom element hasn't been registered for node ${name}`,\n );\n }\n\n return customNode;\n};\n\nconst getTriggerStartPosition = (view: EditorView): number => {\n return view.state?.selection?.$from?.pos;\n};\n"]}
1
+ {"version":3,"file":"inserter.js","sourceRoot":"","sources":["../../../../../../src/components/text-editor/prosemirror-adapter/plugins/trigger/inserter.ts"],"names":[],"mappings":"AAOA,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,IAAgB,EAAc,EAAE;EAC5D,MAAM,QAAQ,GAAG,uBAAuB,CAAC,IAAI,CAAC,CAAC;EAE/C,OAAO;IACH,MAAM,EAAE,CAAC,KAA8B,EAAE,EAAE;MACvC,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC;MACjC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC;MACpC,MAAM,EAAE,KAAK,EAAE,GAAG,SAAS,CAAC;MAE5B,IAAI,IAAU,CAAC;MAEf,IAAI;QACA,IAAI,GAAG,UAAU,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;OACpC;MAAC,OAAO,KAAK,EAAE;QACZ,sCAAsC;QACtC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAE7B,OAAO;OACV;MAED,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;MAEnC,MAAM,QAAQ,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC;MAElE,MAAM,WAAW,GAAG,KAAK,CAAC,EAAE,CAAC,WAAW,CACpC,QAAQ,EACR,KAAK,CAAC,GAAG,EACT,QAAQ,CACX,CAAC;MAEF,WAAW,CAAC,OAAO,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC;MACzC,QAAQ,CAAC,WAAW,CAAC,CAAC;IAC1B,CAAC;IACD,WAAW,EAAE,GAAG,EAAE;MACd,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC;MAEjC,MAAM,WAAW,GAAG,KAAK,CAAC,EAAE,CAAC;MAC7B,W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gB,EAAU,EAAE;;EACzD,OAAO,MAAA,MAAA,MAAA,IAAI,CAAC,KAAK,0CAAE,SAAS,0CAAE,KAAK,0CAAE,GAAG,CAAC;AAC7C,CAAC,CAAC","sourcesContent":["import { Node, NodeType, Schema } from 'prosemirror-model';\nimport { EditorView } from 'prosemirror-view';\nimport {\n TextEditor,\n TextEditorNode,\n} from 'src/components/text-editor/text-editor.types';\n\nexport const inserterFactory = (view: EditorView): TextEditor => {\n const startPos = getTriggerStartPosition(view);\n\n return {\n insert: (input: TextEditorNode | string) => {\n const { state, dispatch } = view;\n const { schema, selection } = state;\n const { $from } = selection;\n\n let node: Node;\n\n try {\n node = createNode(input, schema);\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error(error.message);\n\n return;\n }\n\n const spaceNode = schema.text(' ');\n\n const fragment = schema.nodes.doc.create(null, [node, spaceNode]);\n\n const transaction = state.tr.replaceWith(\n startPos,\n $from.pos,\n fragment,\n );\n\n transaction.setMeta('stopTrigger', true);\n dispatch(transaction);\n },\n stopTrigger: () => {\n const { state, dispatch } = view;\n\n const transaction = state.tr;\n transaction.setMeta('stopTrigger', true);\n\n dispatch(transaction);\n },\n };\n};\n\nconst createNode = (input: TextEditorNode | string, schema: Schema): Node => {\n if (typeof input === 'string') {\n return schema.text(input);\n }\n\n const node = input.node;\n\n if (typeof node === 'string') {\n return schema.text(node);\n }\n\n const customNode = getCustomNode(node.tagName, schema);\n\n const childNodes: Node[] = (input.children ?? [])\n .map((child) => createNode(child, schema))\n .filter(Boolean);\n\n return customNode.create(node.attributes, childNodes);\n};\n\nconst getCustomNode = (name: string, schema: Schema): NodeType => {\n const customNode = Object.values(schema.nodes).find(\n (prosemirrorNode) => prosemirrorNode.name === name,\n );\n\n if (!customNode) {\n throw new Error(\n `A custom element hasn't been registered for node ${name}`,\n );\n }\n\n return customNode;\n};\n\nconst getTriggerStartPosition = (view: EditorView): number => {\n return view.state?.selection?.$from?.pos;\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"text-editor.types.js","sourceRoot":"","sources":["../../../src/components/text-editor/text-editor.types.ts"],"names":[],"mappings":"","sourcesContent":["import { CustomElement } from '../../global/shared-types/custom-element.types';\n\n/**\n * @alpha\n */\nexport type TriggerCharacter =\n | '@'\n | '#'\n | '$'\n | '!'\n | '?'\n | '&'\n | '*'\n | '%'\n | '+'\n | '-'\n | '='\n | '/'\n | '\\\\'\n | '^'\n | '~'\n | '`'\n | ':'\n | ';'\n | '|'\n | '.'\n | ','\n | '<'\n | '>'\n | '['\n | ']'\n | '{'\n | '}'\n | '('\n | ')'\n | \"'\";\n\n/**\n * @alpha\n */\nexport type TextEditorNode = {\n /**\n * The top node\n */\n node: CustomElement | string;\n\n /**\n * One more more children under the top node\n */\n children?: Array<TextEditorNode | string>;\n};\n\n/**\n * @alpha\n */\nexport interface TextEditor {\n /**\n * Method to insert either text or a node at the cursor position\n *\n */\n insert: (input: TextEditorNode | string) => void;\n}\n\n/**\n * @alpha\n */\nexport interface TriggerEventDetail {\n /**\n * The trigger that triggered this event\n *\n */\n trigger: TriggerCharacter;\n\n /**\n * The text editor\n */\n textEditor: TextEditor;\n\n /**\n * Current value of the trigger\n */\n value: string;\n}\n"]}
1
+ {"version":3,"file":"text-editor.types.js","sourceRoot":"","sources":["../../../src/components/text-editor/text-editor.types.ts"],"names":[],"mappings":"","sourcesContent":["import { CustomElement } from '../../global/shared-types/custom-element.types';\n\n/**\n * @alpha\n */\nexport type TriggerCharacter =\n | '@'\n | '#'\n | '$'\n | '!'\n | '?'\n | '&'\n | '*'\n | '%'\n | '+'\n | '-'\n | '='\n | '/'\n | '\\\\'\n | '^'\n | '~'\n | '`'\n | ':'\n | ';'\n | '|'\n | '.'\n | ','\n | '<'\n | '>'\n | '['\n | ']'\n | '{'\n | '}'\n | '('\n | ')'\n | \"'\";\n\n/**\n * @alpha\n */\nexport type TextEditorNode = {\n /**\n * The top node\n */\n node: CustomElement | string;\n\n /**\n * One more more children under the top node\n */\n children?: Array<TextEditorNode | string>;\n};\n\n/**\n * @alpha\n */\nexport interface TextEditor {\n /**\n * Method to insert either text or a node at the cursor position\n *\n */\n insert: (input: TextEditorNode | string) => void;\n stopTrigger: () => void;\n}\n\n/**\n * @alpha\n */\nexport interface TriggerEventDetail {\n /**\n * The trigger that triggered this event\n *\n */\n trigger: TriggerCharacter;\n\n /**\n * The text editor\n */\n textEditor: TextEditor;\n\n /**\n * Current value of the trigger\n */\n value: string;\n}\n"]}
@@ -456,98 +456,3 @@ $clickable-normal-state-transitions: (
456
456
  clip-path: inset(50%);
457
457
  white-space: nowrap;
458
458
  }
459
-
460
- // This mixin designed to enhance the visual effects,
461
- // when the `tiltFollowingTheCursor` utility function from `3d-tilt-hover-effect.ts`
462
- // is implemented in a component.
463
- // This adds styles to a `<div class"limel-3d-hover-effect-glow" />`, needed to create
464
- // a glow effect on a 3D element when the parent element is hovered.
465
- // when the `tiltFollowingTheCursor` utility function from `3d-tilt-hover-effect.ts`
466
- // Parts of these styles are controlled by the `titleFollowingTheCursor` function.
467
- @mixin limel-3d-hover-effect-glow($the3dElement, $border-radius) {
468
- .limel-3d-hover-effect-glow {
469
- transition:
470
- background 0.4s ease,
471
- opacity 0.4s ease;
472
- pointer-events: none;
473
-
474
- position: absolute;
475
- inset: 0;
476
- border-radius: $border-radius;
477
-
478
- opacity: 0.1;
479
- #{$the3dElement}:hover & {
480
- opacity: 0.5;
481
- }
482
-
483
- background-image: radial-gradient(
484
- circle at var(--limel-3d-hover-effect-glow-position, 50% -20%),
485
- rgb(var(--color-white), 0.3),
486
- rgb(var(--color-white), 0)
487
- );
488
-
489
- mix-blend-mode: plus-lighter;
490
- }
491
- }
492
-
493
- // These mixins below are designed to apply the necessary visual effects,
494
- // when the `tiltFollowingTheCursor` utility function from `3d-tilt-hover-effect.ts`
495
- // is implemented in a component.
496
- @mixin parent-of-the-3d-element {
497
- isolation: isolate;
498
- transform-style: preserve-3d;
499
- perspective: 1000px;
500
- }
501
-
502
- @mixin the-3d-element {
503
- position: relative;
504
-
505
- transition-duration: 0.8s;
506
- transition-property: transform, box-shadow, background-color;
507
- transition-timing-function: ease-out;
508
- transform: scale3d(1, 1, 1) rotate3d(0, 0, 0, 0deg);
509
-
510
- &:hover,
511
- &:focus,
512
- &:focus-visible,
513
- &:focus-within {
514
- will-change: background-color, box-shadow, transform;
515
- }
516
-
517
- &:hover,
518
- &:focus,
519
- &:focus-visible,
520
- &:active {
521
- transition-duration: 0.2s;
522
- }
523
-
524
- &:hover,
525
- &:focus-visible {
526
- box-shadow: var(--button-shadow-hovered);
527
- }
528
-
529
- &:hover {
530
- transform: scale3d(1.01, 1.01, 1.01)
531
- rotate3d(var(--limel-3d-hover-effect-rotate3d));
532
- }
533
- &:focus-visible {
534
- transform: scale3d(1.01, 1.01, 1.01);
535
- }
536
- }
537
-
538
- @mixin the-3d-element--clickable {
539
- cursor: pointer;
540
- box-shadow: var(--button-shadow-normal);
541
-
542
- &:active {
543
- transform: scale3d(1, 1, 1) rotate3d(0, 0, 0, 0deg);
544
- box-shadow: var(--button-shadow-pressed);
545
- }
546
-
547
- &:focus-visible {
548
- box-shadow: var(--button-shadow-hovered), var(--shadow-depth-8-focused);
549
- }
550
- &:focus-visible:active {
551
- box-shadow: var(--button-shadow-pressed), var(--shadow-depth-8-focused);
552
- }
553
- }
@@ -26143,6 +26143,12 @@ const inserterFactory = (view) => {
26143
26143
  transaction.setMeta('stopTrigger', true);
26144
26144
  dispatch(transaction);
26145
26145
  },
26146
+ stopTrigger: () => {
26147
+ const { state, dispatch } = view;
26148
+ const transaction = state.tr;
26149
+ transaction.setMeta('stopTrigger', true);
26150
+ dispatch(transaction);
26151
+ },
26146
26152
  };
26147
26153
  };
26148
26154
  const createNode = (input, schema) => {