@yurikilian/lex4 1.8.0 → 1.11.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.
- package/dist/ast/block-mapper.d.ts.map +1 -1
- package/dist/ast/index.d.ts +1 -1
- package/dist/ast/index.d.ts.map +1 -1
- package/dist/ast/inline-mapper.d.ts +7 -1
- package/dist/ast/inline-mapper.d.ts.map +1 -1
- package/dist/ast/types.d.ts +10 -2
- package/dist/ast/types.d.ts.map +1 -1
- package/dist/components/Toolbar.d.ts.map +1 -1
- package/dist/components/VariablePanel.d.ts.map +1 -1
- package/dist/context/toolbar-style-snapshot.d.ts.map +1 -1
- package/dist/context/toolbar-style-store.d.ts +4 -0
- package/dist/context/toolbar-style-store.d.ts.map +1 -1
- package/dist/extensions/variables-extension.d.ts.map +1 -1
- package/dist/i18n/defaults.d.ts.map +1 -1
- package/dist/i18n/pt-BR.d.ts.map +1 -1
- package/dist/i18n/types.d.ts +5 -0
- package/dist/i18n/types.d.ts.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/lex4-editor.cjs +538 -39
- package/dist/lex4-editor.cjs.map +1 -1
- package/dist/lex4-editor.js +540 -41
- package/dist/lex4-editor.js.map +1 -1
- package/dist/lexical/commands/list-commands.d.ts +1 -1
- package/dist/lexical/commands/list-commands.d.ts.map +1 -1
- package/dist/lexical/editor-setup.d.ts.map +1 -1
- package/dist/lexical/nodes/alpha-list-node.d.ts +17 -0
- package/dist/lexical/nodes/alpha-list-node.d.ts.map +1 -0
- package/dist/lexical/utils/import-document-content.d.ts.map +1 -1
- package/dist/style.css +133 -16
- package/dist/variables/index.d.ts +3 -0
- package/dist/variables/index.d.ts.map +1 -1
- package/dist/variables/optional-segment-commands.d.ts +24 -0
- package/dist/variables/optional-segment-commands.d.ts.map +1 -0
- package/dist/variables/optional-segment-node.d.ts +32 -0
- package/dist/variables/optional-segment-node.d.ts.map +1 -0
- package/dist/variables/optional-segment-plugin.d.ts +6 -0
- package/dist/variables/optional-segment-plugin.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-commands.d.ts","sourceRoot":"","sources":["../../../src/lexical/commands/list-commands.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"list-commands.d.ts","sourceRoot":"","sources":["../../../src/lexical/commands/list-commands.ts"],"names":[],"mappings":"AASA,OAAO,EAKL,KAAK,aAAa,EAEnB,MAAM,SAAS,CAAC;AAGjB,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;AA6FrD;;GAEG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,QAAQ,GAAG,IAAI,CAUtE;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI,CAEtD;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI,CAEzD;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI,CAE1D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor-setup.d.ts","sourceRoot":"","sources":["../../src/lexical/editor-setup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,KAAK,EAAE,kBAAkB,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"editor-setup.d.ts","sourceRoot":"","sources":["../../src/lexical/editor-setup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,KAAK,EAAE,kBAAkB,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAOtE,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAItD;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,UAAU,EAChB,MAAM,CAAC,EAAE,MAAM,EACf,UAAU,GAAE,KAAK,CAAC,WAAW,CAAC,EAAO,EACrC,cAAc,GAAE,OAAO,CAAC,kBAAkB,CAAM,GAC/C,iBAAiB,CAWnB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ListNode, SerializedListNode } from '@lexical/list';
|
|
2
|
+
import { EditorConfig, LexicalEditor, LexicalNode, NodeKey, Spread } from 'lexical';
|
|
3
|
+
export type SerializedAlphaListNode = Spread<{
|
|
4
|
+
markerStyle: 'alpha';
|
|
5
|
+
}, SerializedListNode>;
|
|
6
|
+
export declare class AlphaListNode extends ListNode {
|
|
7
|
+
static getType(): string;
|
|
8
|
+
static clone(node: AlphaListNode): AlphaListNode;
|
|
9
|
+
static importJSON(serializedNode: SerializedAlphaListNode): AlphaListNode;
|
|
10
|
+
constructor(start?: number, key?: NodeKey);
|
|
11
|
+
createDOM(config: EditorConfig, editor?: LexicalEditor): HTMLElement;
|
|
12
|
+
updateDOM(prevNode: this, dom: HTMLElement, config: EditorConfig): boolean;
|
|
13
|
+
exportJSON(): SerializedAlphaListNode;
|
|
14
|
+
}
|
|
15
|
+
export declare function $createAlphaListNode(start?: number): AlphaListNode;
|
|
16
|
+
export declare function $isAlphaListNode(node: LexicalNode | null | undefined): node is AlphaListNode;
|
|
17
|
+
//# sourceMappingURL=alpha-list-node.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alpha-list-node.d.ts","sourceRoot":"","sources":["../../../src/lexical/nodes/alpha-list-node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAClE,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,OAAO,EACZ,KAAK,MAAM,EACZ,MAAM,SAAS,CAAC;AAEjB,MAAM,MAAM,uBAAuB,GAAG,MAAM,CAC1C;IACE,WAAW,EAAE,OAAO,CAAC;CACtB,EACD,kBAAkB,CACnB,CAAC;AAOF,qBAAa,aAAc,SAAQ,QAAQ;IACzC,MAAM,CAAC,OAAO,IAAI,MAAM;IAIxB,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,aAAa,GAAG,aAAa;IAIhD,MAAM,CAAC,UAAU,CAAC,cAAc,EAAE,uBAAuB,GAAG,aAAa;gBAU7D,KAAK,SAAI,EAAE,GAAG,CAAC,EAAE,OAAO;IAIpC,SAAS,CAAC,MAAM,EAAE,YAAY,EAAE,MAAM,CAAC,EAAE,aAAa,GAAG,WAAW;IAMpE,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,EAAE,YAAY,GAAG,OAAO;IAS1E,UAAU,IAAI,uBAAuB;CAOtC;AAED,wBAAgB,oBAAoB,CAAC,KAAK,SAAI,GAAG,aAAa,CAE7D;AAED,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,GACnC,IAAI,IAAI,aAAa,CAEvB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"import-document-content.d.ts","sourceRoot":"","sources":["../../../src/lexical/utils/import-document-content.ts"],"names":[],"mappings":"AAAA,OAAO,EAQL,KAAK,aAAa,EAGnB,MAAM,SAAS,CAAC;AAOjB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"import-document-content.d.ts","sourceRoot":"","sources":["../../../src/lexical/utils/import-document-content.ts"],"names":[],"mappings":"AAAA,OAAO,EAQL,KAAK,aAAa,EAGnB,MAAM,SAAS,CAAC;AAOjB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AA4HzD,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE,YAAY,GAAG,OAAO,CAiC5F"}
|
package/dist/style.css
CHANGED
|
@@ -77,8 +77,7 @@
|
|
|
77
77
|
font: inherit;
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
.lex4-editor ol,
|
|
81
|
-
.lex4-editor ul {
|
|
80
|
+
.lex4-editor :where(ol, ul) {
|
|
82
81
|
list-style: none;
|
|
83
82
|
margin: 0;
|
|
84
83
|
padding: 0;
|
|
@@ -431,6 +430,12 @@
|
|
|
431
430
|
color: var(--color-muted-foreground);
|
|
432
431
|
}
|
|
433
432
|
|
|
433
|
+
.lex4-toolbar-text-icon {
|
|
434
|
+
font-size: 0.75rem;
|
|
435
|
+
line-height: 1;
|
|
436
|
+
font-weight: 600;
|
|
437
|
+
}
|
|
438
|
+
|
|
434
439
|
/* ── Header / footer row ─────────────────────────────────── */
|
|
435
440
|
.lex4-hf-toggle {
|
|
436
441
|
display: inline-flex;
|
|
@@ -601,6 +606,10 @@
|
|
|
601
606
|
.lex4-sidebar {
|
|
602
607
|
display: flex;
|
|
603
608
|
height: 100%;
|
|
609
|
+
max-height: 100vh;
|
|
610
|
+
align-self: flex-start;
|
|
611
|
+
position: sticky;
|
|
612
|
+
top: 0;
|
|
604
613
|
flex-shrink: 0;
|
|
605
614
|
flex-direction: column;
|
|
606
615
|
width: var(--lex4-sidebar-width);
|
|
@@ -672,6 +681,8 @@
|
|
|
672
681
|
display: flex;
|
|
673
682
|
flex-direction: column;
|
|
674
683
|
gap: 0.5rem;
|
|
684
|
+
list-style: none;
|
|
685
|
+
margin: 0;
|
|
675
686
|
padding: 0 1rem 1rem;
|
|
676
687
|
}
|
|
677
688
|
|
|
@@ -835,7 +846,42 @@
|
|
|
835
846
|
}
|
|
836
847
|
|
|
837
848
|
.lex4-variable-group {
|
|
838
|
-
margin-bottom:
|
|
849
|
+
margin-bottom: 0.5rem;
|
|
850
|
+
border-bottom: 1px solid var(--color-border);
|
|
851
|
+
}
|
|
852
|
+
.lex4-variable-group:last-child {
|
|
853
|
+
border-bottom: none;
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
.lex4-editor button.lex4-variable-group-header {
|
|
857
|
+
display: flex;
|
|
858
|
+
width: 100%;
|
|
859
|
+
align-items: center;
|
|
860
|
+
justify-content: space-between;
|
|
861
|
+
gap: 0.5rem;
|
|
862
|
+
padding: 0.5rem 0;
|
|
863
|
+
background: transparent;
|
|
864
|
+
border: none;
|
|
865
|
+
cursor: pointer;
|
|
866
|
+
text-align: left;
|
|
867
|
+
}
|
|
868
|
+
.lex4-editor button.lex4-variable-group-header:hover {
|
|
869
|
+
color: var(--color-foreground);
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
.lex4-variable-group-header-left {
|
|
873
|
+
display: inline-flex;
|
|
874
|
+
align-items: center;
|
|
875
|
+
gap: 0.375rem;
|
|
876
|
+
min-width: 0;
|
|
877
|
+
}
|
|
878
|
+
|
|
879
|
+
.lex4-variable-group-chevron {
|
|
880
|
+
color: var(--color-muted-foreground);
|
|
881
|
+
transition: transform 150ms ease;
|
|
882
|
+
}
|
|
883
|
+
.lex4-variable-group.is-collapsed .lex4-variable-group-chevron {
|
|
884
|
+
transform: rotate(-90deg);
|
|
839
885
|
}
|
|
840
886
|
|
|
841
887
|
.lex4-variable-group-label {
|
|
@@ -844,25 +890,40 @@
|
|
|
844
890
|
text-transform: uppercase;
|
|
845
891
|
letter-spacing: 0.05em;
|
|
846
892
|
color: var(--color-muted-foreground);
|
|
847
|
-
|
|
893
|
+
}
|
|
894
|
+
|
|
895
|
+
.lex4-variable-group-count {
|
|
896
|
+
font-size: 10px;
|
|
897
|
+
font-weight: 500;
|
|
898
|
+
color: var(--color-muted-foreground);
|
|
899
|
+
background-color: var(--color-secondary);
|
|
900
|
+
border-radius: 9999px;
|
|
901
|
+
padding: 0.0625rem 0.4375rem;
|
|
902
|
+
min-width: 1.25rem;
|
|
903
|
+
text-align: center;
|
|
848
904
|
}
|
|
849
905
|
|
|
850
906
|
.lex4-variable-group-items {
|
|
851
907
|
display: flex;
|
|
852
|
-
flex-
|
|
853
|
-
gap: 0.
|
|
908
|
+
flex-direction: column;
|
|
909
|
+
gap: 0.25rem;
|
|
910
|
+
padding: 0.25rem 0 0.625rem;
|
|
911
|
+
}
|
|
912
|
+
.lex4-variable-group.is-collapsed .lex4-variable-group-items {
|
|
913
|
+
display: none;
|
|
854
914
|
}
|
|
855
915
|
|
|
856
916
|
.lex4-editor button.lex4-variable-list-item {
|
|
857
|
-
display:
|
|
917
|
+
display: flex;
|
|
918
|
+
width: 100%;
|
|
858
919
|
align-items: center;
|
|
859
|
-
justify-content:
|
|
860
|
-
gap: 0.
|
|
920
|
+
justify-content: flex-start;
|
|
921
|
+
gap: 0.5rem;
|
|
861
922
|
min-height: 1.75rem;
|
|
862
923
|
border-radius: 0.375rem;
|
|
863
|
-
border: 1px solid
|
|
864
|
-
background-color:
|
|
865
|
-
padding: 0 0.
|
|
924
|
+
border: 1px solid transparent;
|
|
925
|
+
background-color: transparent;
|
|
926
|
+
padding: 0.25rem 0.5rem;
|
|
866
927
|
font-size: 0.75rem;
|
|
867
928
|
line-height: 1rem;
|
|
868
929
|
font-weight: 500;
|
|
@@ -870,13 +931,13 @@
|
|
|
870
931
|
cursor: pointer;
|
|
871
932
|
box-shadow: none;
|
|
872
933
|
transition: background-color 150ms, border-color 150ms, color 150ms;
|
|
873
|
-
|
|
934
|
+
text-align: left;
|
|
874
935
|
}
|
|
875
936
|
.lex4-editor button.lex4-variable-list-item::before {
|
|
876
937
|
content: '';
|
|
877
938
|
display: inline-block;
|
|
878
|
-
width:
|
|
879
|
-
height:
|
|
939
|
+
width: 4px;
|
|
940
|
+
height: 4px;
|
|
880
941
|
border-radius: 50%;
|
|
881
942
|
background: var(--lex4-variable-accent, var(--color-muted-foreground));
|
|
882
943
|
flex-shrink: 0;
|
|
@@ -885,6 +946,13 @@
|
|
|
885
946
|
background-color: var(--color-secondary);
|
|
886
947
|
border-color: var(--color-input);
|
|
887
948
|
}
|
|
949
|
+
.lex4-variable-list-item-label {
|
|
950
|
+
flex: 1;
|
|
951
|
+
min-width: 0;
|
|
952
|
+
overflow: hidden;
|
|
953
|
+
text-overflow: ellipsis;
|
|
954
|
+
white-space: nowrap;
|
|
955
|
+
}
|
|
888
956
|
|
|
889
957
|
.lex4-variable-badge {
|
|
890
958
|
display: inline-flex;
|
|
@@ -1041,8 +1109,19 @@
|
|
|
1041
1109
|
}
|
|
1042
1110
|
|
|
1043
1111
|
/* ── Variable chip (inline node) ─────────────────────────── */
|
|
1112
|
+
/* Zero-width spaces restore a soft-wrap opportunity around the
|
|
1113
|
+
non-editable decorator wrapper so a chip that does not fit the
|
|
1114
|
+
remaining line wraps instead of being clipped by the page body. */
|
|
1115
|
+
.lex4-variable::before,
|
|
1116
|
+
.lex4-variable::after {
|
|
1117
|
+
content: '\200B';
|
|
1118
|
+
}
|
|
1119
|
+
|
|
1044
1120
|
.lex4-variable-chip {
|
|
1045
1121
|
display: inline-block;
|
|
1122
|
+
max-width: 100%;
|
|
1123
|
+
overflow: hidden;
|
|
1124
|
+
text-overflow: ellipsis;
|
|
1046
1125
|
border-radius: 0.22em;
|
|
1047
1126
|
border: 1px solid var(--lex4-variable-border, var(--color-border));
|
|
1048
1127
|
background-color: var(--lex4-variable-bg, color-mix(in srgb, var(--color-surface-elevated) 92%, var(--color-secondary)));
|
|
@@ -1056,7 +1135,9 @@
|
|
|
1056
1135
|
user-select: none;
|
|
1057
1136
|
cursor: default;
|
|
1058
1137
|
white-space: nowrap;
|
|
1059
|
-
|
|
1138
|
+
/* overflow: hidden moves the inline-block baseline to the box bottom
|
|
1139
|
+
edge; shift the chip down so it visually sits on the text baseline. */
|
|
1140
|
+
vertical-align: -0.26em;
|
|
1060
1141
|
margin: 0 0.0625em;
|
|
1061
1142
|
transition: border-color 150ms, background-color 150ms, box-shadow 150ms;
|
|
1062
1143
|
}
|
|
@@ -1074,6 +1155,34 @@
|
|
|
1074
1155
|
vertical-align: middle;
|
|
1075
1156
|
}
|
|
1076
1157
|
|
|
1158
|
+
/* ── Optional segment (inline conditional fragment) ──────── */
|
|
1159
|
+
.lex4-optional-segment {
|
|
1160
|
+
border-bottom: 1px dashed color-mix(in srgb, var(--color-muted-foreground) 55%, transparent);
|
|
1161
|
+
background-color: color-mix(in srgb, var(--color-secondary) 26%, transparent);
|
|
1162
|
+
border-radius: 0.18em;
|
|
1163
|
+
padding: 0 0.05em;
|
|
1164
|
+
}
|
|
1165
|
+
|
|
1166
|
+
.lex4-optional-segment::before,
|
|
1167
|
+
.lex4-optional-segment::after {
|
|
1168
|
+
color: var(--color-muted-foreground);
|
|
1169
|
+
font-size: 0.9em;
|
|
1170
|
+
-webkit-user-select: none;
|
|
1171
|
+
-moz-user-select: none;
|
|
1172
|
+
user-select: none;
|
|
1173
|
+
pointer-events: none;
|
|
1174
|
+
}
|
|
1175
|
+
|
|
1176
|
+
.lex4-optional-segment::before {
|
|
1177
|
+
content: '⟮';
|
|
1178
|
+
margin-right: 0.04em;
|
|
1179
|
+
}
|
|
1180
|
+
|
|
1181
|
+
.lex4-optional-segment::after {
|
|
1182
|
+
content: '⟯';
|
|
1183
|
+
margin-left: 0.04em;
|
|
1184
|
+
}
|
|
1185
|
+
|
|
1077
1186
|
.lex4-variable-chip:hover {
|
|
1078
1187
|
background-color: color-mix(in srgb, var(--lex4-variable-bg, var(--color-surface-elevated)) 90%, var(--color-surface-elevated));
|
|
1079
1188
|
border-color: color-mix(in srgb, var(--lex4-variable-accent, var(--color-border-strong)) 40%, var(--color-border));
|
|
@@ -1229,6 +1338,14 @@
|
|
|
1229
1338
|
list-style: disc;
|
|
1230
1339
|
}
|
|
1231
1340
|
|
|
1341
|
+
.lex4-list.lex4-list-alpha {
|
|
1342
|
+
list-style-type: lower-alpha;
|
|
1343
|
+
}
|
|
1344
|
+
|
|
1345
|
+
.lex4-list.lex4-list-alpha > .lex4-listitem::marker {
|
|
1346
|
+
content: counter(list-item, lower-alpha) ') ';
|
|
1347
|
+
}
|
|
1348
|
+
|
|
1232
1349
|
.lex4-listitem {
|
|
1233
1350
|
margin: 0.25rem 0;
|
|
1234
1351
|
}
|
|
@@ -2,4 +2,7 @@ export type { VariableDefinition, VariableContextValue } from './types';
|
|
|
2
2
|
export { VariableNode, $createVariableNode, $isVariableNode, type SerializedVariableNode, } from './variable-node';
|
|
3
3
|
export { INSERT_VARIABLE_COMMAND, insertVariable, } from './variable-commands';
|
|
4
4
|
export { VariablePlugin } from './variable-plugin';
|
|
5
|
+
export { OptionalSegmentNode, $createOptionalSegmentNode, $isOptionalSegmentNode, type SerializedOptionalSegmentNode, } from './optional-segment-node';
|
|
6
|
+
export { TOGGLE_OPTIONAL_SEGMENT_COMMAND, $toggleOptionalSegment, $getAncestorOptionalSegment, $unwrapOptionalSegment, } from './optional-segment-commands';
|
|
7
|
+
export { OptionalSegmentPlugin } from './optional-segment-plugin';
|
|
5
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/variables/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAExE,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,eAAe,EACf,KAAK,sBAAsB,GAC5B,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,uBAAuB,EACvB,cAAc,GACf,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/variables/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAExE,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,eAAe,EACf,KAAK,sBAAsB,GAC5B,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,uBAAuB,EACvB,cAAc,GACf,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,EACL,mBAAmB,EACnB,0BAA0B,EAC1B,sBAAsB,EACtB,KAAK,6BAA6B,GACnC,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACL,+BAA+B,EAC/B,sBAAsB,EACtB,2BAA2B,EAC3B,sBAAsB,GACvB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { LexicalNode } from 'lexical';
|
|
2
|
+
import { OptionalSegmentNode } from './optional-segment-node';
|
|
3
|
+
/**
|
|
4
|
+
* Command that toggles an optional segment around the current selection.
|
|
5
|
+
*
|
|
6
|
+
* - Selection (or caret) inside an existing segment → unwraps that segment.
|
|
7
|
+
* - Non-collapsed selection within a single block → wraps it in a segment.
|
|
8
|
+
* - Cross-block selections and nesting are refused (no-op).
|
|
9
|
+
*/
|
|
10
|
+
export declare const TOGGLE_OPTIONAL_SEGMENT_COMMAND: import('lexical').LexicalCommand<void>;
|
|
11
|
+
/**
|
|
12
|
+
* Returns the nearest OptionalSegmentNode ancestor (or the node itself).
|
|
13
|
+
*/
|
|
14
|
+
export declare function $getAncestorOptionalSegment(node: LexicalNode | null): OptionalSegmentNode | null;
|
|
15
|
+
/**
|
|
16
|
+
* Replaces a segment with its children (unwrap).
|
|
17
|
+
*/
|
|
18
|
+
export declare function $unwrapOptionalSegment(segment: OptionalSegmentNode): void;
|
|
19
|
+
/**
|
|
20
|
+
* Toggles an optional segment at the current selection.
|
|
21
|
+
* Must be called inside editor.update(). Returns true when a change was made.
|
|
22
|
+
*/
|
|
23
|
+
export declare function $toggleOptionalSegment(): boolean;
|
|
24
|
+
//# sourceMappingURL=optional-segment-commands.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"optional-segment-commands.d.ts","sourceRoot":"","sources":["../../src/variables/optional-segment-commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,WAAW,EACjB,MAAM,SAAS,CAAC;AACjB,OAAO,EAGL,mBAAmB,EACpB,MAAM,yBAAyB,CAAC;AAEjC;;;;;;GAMG;AACH,eAAO,MAAM,+BAA+B,wCAE3C,CAAC;AAEF;;GAEG;AACH,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,WAAW,GAAG,IAAI,GACvB,mBAAmB,GAAG,IAAI,CAU5B;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,mBAAmB,GAAG,IAAI,CAKzE;AAYD;;;GAGG;AACH,wBAAgB,sBAAsB,IAAI,OAAO,CAuDhD"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ElementNode, BaseSelection, DOMConversionMap, DOMExportOutput, LexicalNode, NodeKey, RangeSelection, SerializedElementNode } from 'lexical';
|
|
2
|
+
export type SerializedOptionalSegmentNode = SerializedElementNode;
|
|
3
|
+
/**
|
|
4
|
+
* OptionalSegmentNode — an inline ElementNode that groups text and
|
|
5
|
+
* variable chips into a conditional fragment.
|
|
6
|
+
*
|
|
7
|
+
* At generation time the whole segment (including its punctuation) is
|
|
8
|
+
* dropped when any variable inside it resolves to an empty value;
|
|
9
|
+
* otherwise its children render normally.
|
|
10
|
+
*
|
|
11
|
+
* Behaves like LinkNode: editable children, inline, cannot be empty.
|
|
12
|
+
*/
|
|
13
|
+
export declare class OptionalSegmentNode extends ElementNode {
|
|
14
|
+
static getType(): string;
|
|
15
|
+
static clone(node: OptionalSegmentNode): OptionalSegmentNode;
|
|
16
|
+
constructor(key?: NodeKey);
|
|
17
|
+
static importJSON(serializedNode: SerializedOptionalSegmentNode): OptionalSegmentNode;
|
|
18
|
+
exportJSON(): SerializedOptionalSegmentNode;
|
|
19
|
+
createDOM(): HTMLElement;
|
|
20
|
+
updateDOM(): boolean;
|
|
21
|
+
exportDOM(): DOMExportOutput;
|
|
22
|
+
static importDOM(): DOMConversionMap | null;
|
|
23
|
+
isInline(): true;
|
|
24
|
+
canBeEmpty(): false;
|
|
25
|
+
canInsertTextBefore(): false;
|
|
26
|
+
canInsertTextAfter(): false;
|
|
27
|
+
insertNewAfter(_: RangeSelection, restoreSelection?: boolean): null | ElementNode;
|
|
28
|
+
extractWithChild(_child: LexicalNode, selection: BaseSelection, _destination: 'clone' | 'html'): boolean;
|
|
29
|
+
}
|
|
30
|
+
export declare function $createOptionalSegmentNode(): OptionalSegmentNode;
|
|
31
|
+
export declare function $isOptionalSegmentNode(node: LexicalNode | null | undefined): node is OptionalSegmentNode;
|
|
32
|
+
//# sourceMappingURL=optional-segment-node.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"optional-segment-node.d.ts","sourceRoot":"","sources":["../../src/variables/optional-segment-node.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,WAAW,EACX,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,WAAW,EAChB,KAAK,OAAO,EACZ,KAAK,cAAc,EACnB,KAAK,qBAAqB,EAC3B,MAAM,SAAS,CAAC;AAEjB,MAAM,MAAM,6BAA6B,GAAG,qBAAqB,CAAC;AAElE;;;;;;;;;GASG;AACH,qBAAa,mBAAoB,SAAQ,WAAW;IAClD,MAAM,CAAC,OAAO,IAAI,MAAM;IAIxB,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,mBAAmB,GAAG,mBAAmB;gBAIhD,GAAG,CAAC,EAAE,OAAO;IAMzB,MAAM,CAAC,UAAU,CAAC,cAAc,EAAE,6BAA6B,GAAG,mBAAmB;IAQrF,UAAU,IAAI,6BAA6B;IAU3C,SAAS,IAAI,WAAW;IAQxB,SAAS,IAAI,OAAO;IAIpB,SAAS,IAAI,eAAe;IAM5B,MAAM,CAAC,SAAS,IAAI,gBAAgB,GAAG,IAAI;IAM3C,QAAQ,IAAI,IAAI;IAIhB,UAAU,IAAI,KAAK;IAInB,mBAAmB,IAAI,KAAK;IAI5B,kBAAkB,IAAI,KAAK;IAI3B,cAAc,CAAC,CAAC,EAAE,cAAc,EAAE,gBAAgB,UAAO,GAAG,IAAI,GAAG,WAAW;IAM9E,gBAAgB,CACd,MAAM,EAAE,WAAW,EACnB,SAAS,EAAE,aAAa,EACxB,YAAY,EAAE,OAAO,GAAG,MAAM,GAC7B,OAAO;CAcX;AAED,wBAAgB,0BAA0B,IAAI,mBAAmB,CAEhE;AAED,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,GACnC,IAAI,IAAI,mBAAmB,CAE7B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"optional-segment-plugin.d.ts","sourceRoot":"","sources":["../../src/variables/optional-segment-plugin.tsx"],"names":[],"mappings":"AAUA;;;GAGG;AACH,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAsCzC,CAAC"}
|