@kerebron/editor 0.4.28 → 0.4.30

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.
Files changed (109) hide show
  1. package/esm/CoreEditor.js +1 -0
  2. package/esm/CoreEditor.js.map +1 -0
  3. package/esm/DummyEditorView.js +1 -0
  4. package/esm/DummyEditorView.js.map +1 -0
  5. package/esm/Extension.js +1 -0
  6. package/esm/Extension.js.map +1 -0
  7. package/esm/ExtensionManager.js +1 -0
  8. package/esm/ExtensionManager.js.map +1 -0
  9. package/esm/Mark.js +1 -0
  10. package/esm/Mark.js.map +1 -0
  11. package/esm/Node.js +1 -0
  12. package/esm/Node.js.map +1 -0
  13. package/esm/commands/CommandManager.js +1 -0
  14. package/esm/commands/CommandManager.js.map +1 -0
  15. package/esm/commands/baseCommandFactories.js +1 -0
  16. package/esm/commands/baseCommandFactories.js.map +1 -0
  17. package/esm/commands/createChainableState.js +1 -0
  18. package/esm/commands/createChainableState.js.map +1 -0
  19. package/esm/commands/keyCommandFactories.js +1 -0
  20. package/esm/commands/keyCommandFactories.js.map +1 -0
  21. package/esm/commands/mod.js +1 -0
  22. package/esm/commands/mod.js.map +1 -0
  23. package/esm/commands/replaceCommandFactories.js +1 -0
  24. package/esm/commands/replaceCommandFactories.js.map +1 -0
  25. package/esm/commands/types.js +1 -0
  26. package/esm/commands/types.js.map +1 -0
  27. package/esm/mod.js +1 -0
  28. package/esm/mod.js.map +1 -0
  29. package/esm/nodeToTreeString.js +1 -0
  30. package/esm/nodeToTreeString.js.map +1 -0
  31. package/esm/plugins/TrackSelecionPlugin.js +1 -0
  32. package/esm/plugins/TrackSelecionPlugin.js.map +1 -0
  33. package/esm/plugins/input-rules/InputRulesPlugin.js +1 -0
  34. package/esm/plugins/input-rules/InputRulesPlugin.js.map +1 -0
  35. package/esm/plugins/input-rules/mod.js +1 -0
  36. package/esm/plugins/input-rules/mod.js.map +1 -0
  37. package/esm/plugins/input-rules/rulebuilders.js +1 -0
  38. package/esm/plugins/input-rules/rulebuilders.js.map +1 -0
  39. package/esm/plugins/keymap/keymap.js +1 -0
  40. package/esm/plugins/keymap/keymap.js.map +1 -0
  41. package/esm/plugins/keymap/mod.js +1 -0
  42. package/esm/plugins/keymap/mod.js.map +1 -0
  43. package/esm/plugins/keymap/w3c-keyname.js +1 -0
  44. package/esm/plugins/keymap/w3c-keyname.js.map +1 -0
  45. package/esm/search/mod.js +1 -0
  46. package/esm/search/mod.js.map +1 -0
  47. package/esm/search/query.js +1 -0
  48. package/esm/search/query.js.map +1 -0
  49. package/esm/search/search.js +1 -0
  50. package/esm/search/search.js.map +1 -0
  51. package/esm/types.js +1 -0
  52. package/esm/types.js.map +1 -0
  53. package/esm/ui.js +1 -0
  54. package/esm/ui.js.map +1 -0
  55. package/esm/utilities/SmartOutput.js +1 -0
  56. package/esm/utilities/SmartOutput.js.map +1 -0
  57. package/esm/utilities/createNodeFromContent.js +1 -0
  58. package/esm/utilities/createNodeFromContent.js.map +1 -0
  59. package/esm/utilities/getHtmlAttributes.js +1 -0
  60. package/esm/utilities/getHtmlAttributes.js.map +1 -0
  61. package/esm/utilities/getShadowRoot.js +1 -0
  62. package/esm/utilities/getShadowRoot.js.map +1 -0
  63. package/esm/utilities/mod.js +1 -0
  64. package/esm/utilities/mod.js.map +1 -0
  65. package/esm/utilities/toRawTextResult.js +1 -0
  66. package/esm/utilities/toRawTextResult.js.map +1 -0
  67. package/package.json +5 -1
  68. package/src/CoreEditor.ts +277 -0
  69. package/src/DummyEditorView.ts +403 -0
  70. package/src/Extension.ts +63 -0
  71. package/src/ExtensionManager.ts +328 -0
  72. package/src/Mark.ts +47 -0
  73. package/src/Node.ts +66 -0
  74. package/src/commands/CommandManager.ts +145 -0
  75. package/src/commands/baseCommandFactories.ts +1103 -0
  76. package/src/commands/createChainableState.ts +36 -0
  77. package/src/commands/keyCommandFactories.ts +26 -0
  78. package/src/commands/mod.ts +104 -0
  79. package/src/commands/replaceCommandFactories.ts +129 -0
  80. package/src/commands/types.ts +30 -0
  81. package/src/mod.ts +8 -0
  82. package/src/nodeToTreeString.ts +100 -0
  83. package/src/plugins/TrackSelecionPlugin.ts +27 -0
  84. package/src/plugins/input-rules/InputRulesPlugin.ts +242 -0
  85. package/src/plugins/input-rules/mod.ts +2 -0
  86. package/src/plugins/input-rules/rulebuilders.ts +88 -0
  87. package/src/plugins/keymap/keymap.ts +117 -0
  88. package/src/plugins/keymap/mod.ts +1 -0
  89. package/src/plugins/keymap/w3c-keyname.ts +123 -0
  90. package/src/search/mod.ts +2 -0
  91. package/src/search/query.ts +412 -0
  92. package/src/search/search.ts +284 -0
  93. package/src/types.ts +71 -0
  94. package/src/ui.ts +35 -0
  95. package/src/utilities/SmartOutput.ts +284 -0
  96. package/src/utilities/createNodeFromContent.ts +66 -0
  97. package/src/utilities/getHtmlAttributes.ts +68 -0
  98. package/src/utilities/getShadowRoot.ts +18 -0
  99. package/src/utilities/mod.ts +5 -0
  100. package/src/utilities/toRawTextResult.ts +27 -0
  101. package/assets/base.css +0 -114
  102. package/assets/content.css +0 -35
  103. package/assets/gapcursor.css +0 -25
  104. package/assets/index.css +0 -2
  105. package/assets/main.css +0 -8
  106. package/assets/mobile.css +0 -33
  107. package/assets/prosemirror.css +0 -20
  108. package/assets/search.css +0 -6
  109. package/assets/vars.css +0 -110
@@ -1,35 +0,0 @@
1
- /* Typography */
2
- .kb-editor p {
3
- margin-bottom: 1em;
4
- }
5
-
6
- .kb-editor p:first-child,
7
- .kb-editor h1:first-child,
8
- .kb-editor h2:first-child,
9
- .kb-editor h3:first-child,
10
- .kb-editor h4:first-child,
11
- .kb-editor h5:first-child,
12
- .kb-editor h6:first-child {
13
- margin-top: var(--kb-space-md);
14
- }
15
-
16
- .kb-editor pre {
17
- white-space: pre-wrap;
18
- }
19
-
20
- .kb-editor li {
21
- position: relative;
22
- }
23
-
24
- .kb-editor ul,
25
- .kb-editor ol {
26
- padding-left: 30px;
27
- }
28
-
29
- .kb-editor blockquote {
30
- padding-left: 1em;
31
- border-left: 3px solid var(--kb-color-border);
32
- margin-left: 0;
33
- margin-right: 0;
34
- color: var(--kb-color-text-muted);
35
- }
@@ -1,25 +0,0 @@
1
- .kb-gapcursor {
2
- display: none;
3
- pointer-events: none;
4
- position: absolute;
5
- }
6
-
7
- .kb-gapcursor:after {
8
- content: '';
9
- display: block;
10
- position: absolute;
11
- top: -2px;
12
- width: 20px;
13
- border-top: 1px solid black;
14
- animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
15
- }
16
-
17
- @keyframes kb-cursor-blink {
18
- to {
19
- visibility: hidden;
20
- }
21
- }
22
-
23
- .ProseMirror-focused .kb-gapcursor {
24
- display: block;
25
- }
package/assets/index.css DELETED
@@ -1,2 +0,0 @@
1
- @import 'vars.css';
2
- @import 'main.css';
package/assets/main.css DELETED
@@ -1,8 +0,0 @@
1
- @import 'base.css';
2
-
3
- @import 'content.css';
4
- @import 'prosemirror.css';
5
- @import 'gapcursor.css';
6
- @import 'search.css';
7
-
8
- @import 'mobile.css';
package/assets/mobile.css DELETED
@@ -1,33 +0,0 @@
1
- /* Mobile viewport handling */
2
- @supports (-webkit-touch-callout: none) {
3
- /* iOS Safari specific fixes */
4
- .kb-component {
5
- -webkit-text-size-adjust: 100%;
6
- -webkit-font-smoothing: antialiased;
7
- }
8
- }
9
-
10
- /* Selection handles for mobile text selection */
11
- @media (max-width: 767px) {
12
- .kb-editor::selection {
13
- background: rgba(var(--kb-color-primary-rgb), 0.3);
14
- }
15
-
16
- .kb-editor::-moz-selection {
17
- background: rgba(var(--kb-color-primary-rgb), 0.3);
18
- }
19
- }
20
-
21
- /* Print styles */
22
- @media print {
23
- .kb-component {
24
- border: none;
25
- box-shadow: none;
26
- margin: 0;
27
- padding: 0;
28
- }
29
-
30
- .kb-editor {
31
- padding: 0;
32
- }
33
- }
@@ -1,20 +0,0 @@
1
- .ProseMirror-selectednode {
2
- outline: 2px solid var(--kb-color-primary);
3
- outline-offset: 2px;
4
- }
5
-
6
- /* List item selection styling */
7
- li.ProseMirror-selectednode {
8
- outline: none;
9
- }
10
-
11
- li.ProseMirror-selectednode:after {
12
- content: '';
13
- position: absolute;
14
- left: -32px;
15
- right: -2px;
16
- top: -2px;
17
- bottom: -2px;
18
- border: 2px solid var(--kb-color-primary);
19
- pointer-events: none;
20
- }
package/assets/search.css DELETED
@@ -1,6 +0,0 @@
1
- .kb-search-match {
2
- background-color: #ffff0054;
3
- }
4
- .kb-active-search-match {
5
- background-color: #ff6a0054;
6
- }
package/assets/vars.css DELETED
@@ -1,110 +0,0 @@
1
- :root,
2
- :host {
3
- /* Spacing System */
4
- --kb-space-xs: 0.25rem; /* 4px */
5
- --kb-space-sm: 0.5rem; /* 8px */
6
- --kb-space-md: 1rem; /* 16px */
7
- --kb-space-lg: 1.5rem; /* 24px */
8
- --kb-space-xl: 2rem; /* 32px */
9
-
10
- /* Typography Scale */
11
- --kb-text-xs: 0.75rem; /* 12px */
12
- --kb-text-sm: 0.875rem; /* 14px */
13
- --kb-text-base: 1rem; /* 16px */
14
- --kb-text-lg: 1.125rem; /* 18px */
15
-
16
- /* Touch Targets */
17
- --kb-touch-target-min: 44px;
18
- --kb-touch-target-comfortable: 48px;
19
-
20
- /* Interactive States */
21
- --kb-color-hover: rgba(59, 130, 246, 0.05);
22
- --kb-color-active: rgba(59, 130, 246, 0.1);
23
- --kb-color-focus: rgba(59, 130, 246, 0.2);
24
-
25
- /* Layout & Borders */
26
- --kb-radius-sm: 4px;
27
- --kb-radius-md: 6px;
28
- --kb-radius-lg: 8px;
29
- --kb-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
30
- --kb-shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
31
- --kb-shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
32
-
33
- /* Z-index Scale */
34
- --kb-z-dropdown: 1100;
35
- --kb-z-tooltip: 1200;
36
- --kb-z-modal: 1300;
37
- --kb-z-notification: 1400;
38
-
39
- /* Brand Colors (Customizable) */
40
- --kb-color-primary: #3b82f6;
41
- --kb-color-primary-hover: #2563eb;
42
- --kb-color-primary-active: #1d4ed8;
43
- --kb-color-primary-rgb: 59, 130, 246;
44
- --kb-color-text: #1f2937;
45
- --kb-color-text-muted: #6b7280;
46
- --kb-color-surface: #ffffff;
47
- --kb-color-surface-elevated: #f9fafb;
48
- --kb-color-surface-hover: rgba(60, 64, 67, 0.08);
49
- --kb-color-border: #e5e7eb;
50
- --kb-color-border-strong: #d1d5db;
51
-
52
- /* Menu specific colors (Google Docs style) - Light mode */
53
- --kb-menu-dropdown-bg: #ffffff;
54
- --kb-menu-dropdown-border: #dadce0;
55
- --kb-menu-dropdown-text: #3c4043;
56
- --kb-menu-dropdown-hover: rgba(60, 64, 67, 0.08);
57
- --kb-menu-info-bg: #e8f0fe;
58
- --kb-menu-info-text: #1967d2;
59
- }
60
-
61
- /* Dark mode support */
62
- @media (prefers-color-scheme: dark) {
63
- :root,
64
- :host {
65
- --kb-color-text: #f9fafb;
66
- --kb-color-text-muted: #9ca3af;
67
- --kb-color-surface: #1f2937;
68
- --kb-color-surface-elevated: #374151;
69
- --kb-color-border: #374151;
70
- --kb-color-border-strong: #4b5563;
71
- --kb-color-hover: rgba(59, 130, 246, 0.1);
72
- --kb-color-active: rgba(59, 130, 246, 0.2);
73
-
74
- /* Menu dropdown - Dark mode */
75
- --kb-menu-dropdown-bg: #344154;
76
- --kb-menu-dropdown-border: #5f6368;
77
- --kb-menu-dropdown-text: #e8eaed;
78
- --kb-menu-dropdown-hover: rgba(232, 234, 237, 0.08);
79
- }
80
- }
81
-
82
- /* Theme variants */
83
- .kb-component--brand-corporate {
84
- --kb-color-primary: #1e40af;
85
- --kb-color-primary-hover: #1e3a8a;
86
- --kb-color-primary-rgb: 30, 64, 175;
87
- }
88
-
89
- .kb-component--brand-creative {
90
- --kb-color-primary: #7c3aed;
91
- --kb-color-primary-hover: #6d28d9;
92
- --kb-color-primary-rgb: 124, 58, 237;
93
- }
94
-
95
- .kb-component--dark {
96
- --kb-color-text: #f9fafb;
97
- --kb-color-text-muted: #9ca3af;
98
- --kb-color-surface: #1f2937;
99
- --kb-color-surface-elevated: #374151;
100
- --kb-color-border: #374151;
101
- --kb-color-border-strong: #4b5563;
102
- --kb-color-hover: rgba(59, 130, 246, 0.1);
103
- --kb-color-active: rgba(59, 130, 246, 0.2);
104
-
105
- /* Menu dropdown - Dark mode */
106
- --kb-menu-dropdown-bg: #344154;
107
- --kb-menu-dropdown-border: #5f6368;
108
- --kb-menu-dropdown-text: #e8eaed;
109
- --kb-menu-dropdown-hover: rgba(232, 234, 237, 0.08);
110
- }