@wdprlib/ast 4.2.0 → 5.0.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/index.cjs CHANGED
@@ -40,17 +40,23 @@ __export(exports_src, {
40
40
  isTruthy: () => isTruthy,
41
41
  isStringContainerType: () => isStringContainerType,
42
42
  isParagraphSafe: () => isParagraphSafe,
43
+ isPageButtonAction: () => isPageButtonAction,
43
44
  isHeaderType: () => isHeaderType,
44
45
  isContainerTypeParagraphSafe: () => isContainerTypeParagraphSafe,
45
46
  isAlignType: () => isAlignType,
46
47
  horizontalRule: () => horizontalRule,
47
48
  heading: () => heading,
48
49
  formatExprValue: () => formatExprValue,
50
+ extractReadableText: () => extractReadableText,
51
+ extractFirstParagraph: () => extractFirstParagraph,
52
+ excerptText: () => excerptText,
49
53
  evaluateExpression: () => evaluateExpression,
50
54
  createSettings: () => createSettings,
51
55
  createPosition: () => createPosition,
52
56
  createPoint: () => createPoint,
57
+ countCharacters: () => countCharacters,
53
58
  container: () => container,
59
+ compileTextExcerpt: () => compileTextExcerpt,
54
60
  buildInfo: () => buildInfo,
55
61
  bold: () => bold,
56
62
  STYLE_SLOT_PREFIX: () => STYLE_SLOT_PREFIX,
@@ -62,259 +68,10 @@ module.exports = __toCommonJS(exports_src);
62
68
 
63
69
  // packages/ast/src/build-info.generated.ts
64
70
  var buildInfo = Object.freeze({
65
- version: "4.2.0",
66
- sha: "b71b84c705e05717f5ea12fd89684a91b669dbff",
71
+ version: "5.0.0",
72
+ sha: "705ff97e22abd7bfb49d7f8f30087e6f09654c91",
67
73
  dirty: false
68
74
  });
69
- // packages/ast/src/position.ts
70
- function createPoint(line, column, offset) {
71
- return { line, column, offset };
72
- }
73
- function createPosition(start, end) {
74
- return { start, end };
75
- }
76
- // packages/ast/src/element.ts
77
- function isStringContainerType(type) {
78
- return typeof type === "string";
79
- }
80
- function isHeaderType(type) {
81
- return typeof type === "object" && type !== null && "header" in type;
82
- }
83
- function isAlignType(type) {
84
- return typeof type === "object" && type !== null && "align" in type;
85
- }
86
- function text(value) {
87
- return { element: "text", data: value };
88
- }
89
- function container(type, elements, attributes = {}) {
90
- return {
91
- element: "container",
92
- data: { type, attributes, elements }
93
- };
94
- }
95
- function paragraph(elements, attributes = {}) {
96
- return container("paragraph", elements, attributes);
97
- }
98
- function bold(elements, attributes = {}) {
99
- return container("bold", elements, attributes);
100
- }
101
- function italics(elements, attributes = {}) {
102
- return container("italics", elements, attributes);
103
- }
104
- function heading(level, elements, hasToc = true, attributes = {}) {
105
- return container({ header: { level, "has-toc": hasToc } }, elements, attributes);
106
- }
107
- function lineBreak() {
108
- return { element: "line-break" };
109
- }
110
- function horizontalRule() {
111
- return { element: "horizontal-rule" };
112
- }
113
- function link(linkLocation, label, options = {}) {
114
- return {
115
- element: "link",
116
- data: {
117
- type: options.type ?? (typeof linkLocation === "string" ? "direct" : "page"),
118
- link: linkLocation,
119
- extra: options.extra ?? null,
120
- label,
121
- target: options.target ?? null
122
- }
123
- };
124
- }
125
- function list(type, items, attributes = {}) {
126
- return {
127
- element: "list",
128
- data: { type, attributes, items }
129
- };
130
- }
131
- function listItemElements(elements, attributes = {}) {
132
- return {
133
- "item-type": "elements",
134
- attributes,
135
- elements
136
- };
137
- }
138
- function listItemSubList(data) {
139
- return {
140
- "item-type": "sub-list",
141
- element: "list",
142
- data
143
- };
144
- }
145
- function isContainerTypeParagraphSafe(type) {
146
- if (isHeaderType(type))
147
- return false;
148
- if (isAlignType(type))
149
- return false;
150
- switch (type) {
151
- case "bold":
152
- case "italics":
153
- case "underline":
154
- case "superscript":
155
- case "subscript":
156
- case "strikethrough":
157
- case "monospace":
158
- case "span":
159
- case "size":
160
- return true;
161
- case "div":
162
- case "blockquote":
163
- case "paragraph":
164
- case "heading":
165
- case "collapsible":
166
- case "definition-list":
167
- case "definition-list-item":
168
- case "definition-list-key":
169
- case "definition-list-value":
170
- case "table-row":
171
- case "table-cell":
172
- return false;
173
- default:
174
- return false;
175
- }
176
- }
177
- function isParagraphSafe(element) {
178
- switch (element.element) {
179
- case "container": {
180
- const data = element.data;
181
- return isContainerTypeParagraphSafe(data.type);
182
- }
183
- case "module":
184
- return false;
185
- case "text":
186
- case "raw":
187
- case "variable":
188
- case "email":
189
- return true;
190
- case "table":
191
- return false;
192
- case "tab-view":
193
- return false;
194
- case "anchor":
195
- case "anchor-name":
196
- case "link":
197
- return true;
198
- case "image":
199
- return true;
200
- case "list":
201
- return false;
202
- case "definition-list":
203
- return false;
204
- case "collapsible":
205
- return false;
206
- case "table-of-contents":
207
- return false;
208
- case "footnote":
209
- return true;
210
- case "footnote-ref":
211
- return true;
212
- case "footnote-block":
213
- return false;
214
- case "bibliography-cite":
215
- return true;
216
- case "bibliography-block":
217
- return false;
218
- case "user":
219
- return true;
220
- case "date":
221
- return true;
222
- case "color":
223
- return true;
224
- case "code":
225
- return false;
226
- case "math":
227
- return false;
228
- case "math-inline":
229
- return true;
230
- case "embed":
231
- return false;
232
- case "embed-block":
233
- return true;
234
- case "html":
235
- case "iframe":
236
- return false;
237
- case "include": {
238
- const data = element.data;
239
- return data["paragraph-safe"];
240
- }
241
- case "style":
242
- return false;
243
- case "line-break":
244
- case "line-breaks":
245
- return true;
246
- case "clear-float":
247
- return false;
248
- case "horizontal-rule":
249
- return false;
250
- case "content-separator":
251
- return false;
252
- case "if-tags":
253
- return false;
254
- case "expr":
255
- case "if":
256
- case "ifexpr":
257
- return true;
258
- default:
259
- return false;
260
- }
261
- }
262
- // packages/ast/src/constants.ts
263
- var STYLE_SLOT_PREFIX = "\x00__IFTAGS_SLOT__";
264
- var STYLE_ANCHOR_PREFIX = "\x00__STYLE_ANCHOR__";
265
- // packages/ast/src/css.ts
266
- var CSS_LENGTH_UNITS = [
267
- "cqmax",
268
- "cqmin",
269
- "cqw",
270
- "cqh",
271
- "cqi",
272
- "cqb",
273
- "svmin",
274
- "svmax",
275
- "lvmin",
276
- "lvmax",
277
- "dvmin",
278
- "dvmax",
279
- "vmin",
280
- "vmax",
281
- "svw",
282
- "svh",
283
- "svi",
284
- "svb",
285
- "lvw",
286
- "lvh",
287
- "lvi",
288
- "lvb",
289
- "dvw",
290
- "dvh",
291
- "dvi",
292
- "dvb",
293
- "vw",
294
- "vh",
295
- "vi",
296
- "vb",
297
- "rcap",
298
- "rem",
299
- "rex",
300
- "rch",
301
- "ric",
302
- "rlh",
303
- "cap",
304
- "em",
305
- "ex",
306
- "ch",
307
- "ic",
308
- "lh",
309
- "cm",
310
- "mm",
311
- "in",
312
- "pc",
313
- "pt",
314
- "px",
315
- "q",
316
- "%"
317
- ];
318
75
  // packages/ast/src/expr-eval.ts
319
76
  var FALSE_VALUES = new Set(["false", "null", "", "0"]);
320
77
  function isTruthy(value) {
@@ -703,6 +460,574 @@ class ExprParser {
703
460
  }
704
461
  }
705
462
  }
463
+
464
+ // packages/ast/src/readable-text.ts
465
+ var segmenter = new Intl.Segmenter("und", { granularity: "grapheme" });
466
+ function countCharacters(text) {
467
+ let count = 0;
468
+ for (const _segment of segmenter.segment(text))
469
+ count++;
470
+ return count;
471
+ }
472
+ function extractReadableText(ast, options = {}) {
473
+ return extractText(ast, options, false);
474
+ }
475
+ function extractFirstParagraph(ast, options = {}) {
476
+ return extractText(ast, options, true);
477
+ }
478
+ function extractText(ast, options, firstParagraphOnly) {
479
+ const parts = [];
480
+ const notes = new Set;
481
+ let footnoteIndex = 0;
482
+ let firstParagraph;
483
+ const emit = (value, omit) => {
484
+ if (!omit)
485
+ parts.push(value);
486
+ };
487
+ const block = (elements, omit) => {
488
+ emit(`
489
+
490
+ `, omit);
491
+ visit(elements, omit);
492
+ emit(`
493
+
494
+ `, omit);
495
+ };
496
+ const visitBranch = (elements, omit) => {
497
+ const end = elements.findLastIndex((element) => element.element !== "text" || element.data.trim() !== "") + 1;
498
+ visit(elements.slice(0, end), omit);
499
+ };
500
+ const visit = (elements, inheritedOmit = false) => {
501
+ for (const element of elements) {
502
+ if (firstParagraphOnly && firstParagraph !== undefined)
503
+ return;
504
+ const omit = inheritedOmit || options.exclude?.(element) === true;
505
+ switch (element.element) {
506
+ case "text":
507
+ case "raw":
508
+ case "email":
509
+ emit(element.data, omit);
510
+ break;
511
+ case "container": {
512
+ const start = parts.length;
513
+ const type = element.data.type;
514
+ const kind = typeof type === "string" ? type : "block";
515
+ const hidden = omit || ["ruby-text", "hidden", "invisible"].includes(kind);
516
+ if ([
517
+ "paragraph",
518
+ "div",
519
+ "blockquote",
520
+ "note",
521
+ "heading",
522
+ "block",
523
+ "table-row",
524
+ "definition-list"
525
+ ].includes(kind))
526
+ block(element.data.elements, hidden);
527
+ else
528
+ visit(element.data.elements, hidden);
529
+ if (firstParagraphOnly && kind === "paragraph" && firstParagraph === undefined) {
530
+ const text = normalizeText(parts.slice(start).join(""));
531
+ if (text)
532
+ firstParagraph = text;
533
+ }
534
+ break;
535
+ }
536
+ case "color":
537
+ case "anchor":
538
+ case "include":
539
+ visit(element.data.elements, omit);
540
+ break;
541
+ case "collapsible":
542
+ block(element.data.elements, omit);
543
+ break;
544
+ case "tab-view":
545
+ for (const tab of element.data) {
546
+ emit(`
547
+
548
+ ${tab.label}
549
+ `, omit);
550
+ block(tab.elements, omit);
551
+ }
552
+ break;
553
+ case "table":
554
+ emit(`
555
+
556
+ `, omit);
557
+ for (const row of element.data.rows) {
558
+ for (const cell of row.cells) {
559
+ visit(cell.elements, omit);
560
+ emit(" ", omit);
561
+ }
562
+ emit(`
563
+ `, omit);
564
+ }
565
+ emit(`
566
+ `, omit);
567
+ break;
568
+ case "definition-list":
569
+ for (const entry of element.data) {
570
+ block(entry.key, omit);
571
+ visit(entry.value, omit);
572
+ }
573
+ break;
574
+ case "list":
575
+ for (const item of element.data.items) {
576
+ emit(`
577
+ `, omit);
578
+ if (item["item-type"] === "elements")
579
+ visit(item.elements, omit);
580
+ else
581
+ visit([{ element: "list", data: item.data }], omit);
582
+ }
583
+ emit(`
584
+ `, omit);
585
+ break;
586
+ case "link": {
587
+ const label = element.data.label;
588
+ const destination = typeof element.data.link === "string" ? element.data.link : element.data.link.page;
589
+ const fallback = label === "page" ? destination : ("text" in label) ? label.text : label.url ?? destination;
590
+ emit(options.resolveText?.(element) ?? fallback, omit);
591
+ break;
592
+ }
593
+ case "user":
594
+ emit(options.resolveText?.(element) ?? element.data.name, omit);
595
+ break;
596
+ case "date":
597
+ case "math":
598
+ case "math-inline":
599
+ emit(options.resolveText?.(element) ?? "", omit);
600
+ break;
601
+ case "image":
602
+ emit(element.data.attributes.alt ?? "", omit);
603
+ break;
604
+ case "gallery":
605
+ if (element.data.content.type === "items")
606
+ for (const item of element.data.content.items)
607
+ emit(`${item.alt ?? ""}
608
+ `, omit);
609
+ break;
610
+ case "code":
611
+ emit(`
612
+
613
+ ${element.data.contents}
614
+
615
+ `, omit);
616
+ break;
617
+ case "footnote":
618
+ case "footnote-ref": {
619
+ const index = element.element === "footnote" ? footnoteIndex++ : element.data - 1;
620
+ if (!omit)
621
+ notes.add(index);
622
+ break;
623
+ }
624
+ case "bibliography-block":
625
+ for (const entry of element.data.entries)
626
+ block(entry.value, omit);
627
+ break;
628
+ case "if":
629
+ visitBranch(isTruthy(element.data.condition) ? element.data.then : element.data.else, omit);
630
+ break;
631
+ case "ifexpr": {
632
+ const result = evaluateExpression(element.data.expression);
633
+ if (result.success)
634
+ visitBranch(result.value !== 0 ? element.data.then : element.data.else, omit);
635
+ break;
636
+ }
637
+ case "expr": {
638
+ const result = evaluateExpression(element.data.expression);
639
+ if (result.success)
640
+ emit(formatExprValue(result.value), omit);
641
+ break;
642
+ }
643
+ case "line-break":
644
+ case "line-breaks":
645
+ emit(`
646
+ `, omit);
647
+ break;
648
+ case "horizontal-rule":
649
+ case "content-separator":
650
+ emit(`
651
+
652
+ `, omit);
653
+ break;
654
+ default:
655
+ break;
656
+ }
657
+ }
658
+ };
659
+ visit(ast.elements);
660
+ if (firstParagraphOnly)
661
+ return firstParagraph ?? "";
662
+ for (const index of notes) {
663
+ const note = ast.footnotes?.[index];
664
+ if (note)
665
+ block(note, false);
666
+ }
667
+ return normalizeText(parts.join(""));
668
+ }
669
+ function normalizeText(text) {
670
+ return text.replace(/[^\S\n]+/g, " ").replace(/ ?\n ?/g, `
671
+ `).replace(/\n{3,}/g, `
672
+
673
+ `).trim();
674
+ }
675
+ // packages/ast/src/text-excerpt.ts
676
+ var import_re2js = require("re2js");
677
+ var segmenter2 = new Intl.Segmenter("und", { granularity: "grapheme" });
678
+ var emptyExcerpt = (_text) => "";
679
+ var MAX_PATTERN_LENGTH = 4096;
680
+ var MAX_INPUT_LENGTH = 1e6;
681
+ var MAX_PROGRAM_SIZE = 4096;
682
+ var MAX_MATCHES = 1e4;
683
+ var SEARCH_BUDGET = 16000000;
684
+ function compileTextExcerpt(options = {}) {
685
+ const limit = options.maxLength ?? 200;
686
+ if (!Number.isSafeInteger(limit) || limit <= 0)
687
+ return emptyExcerpt;
688
+ if (options.pattern === undefined) {
689
+ if (options.flags !== undefined || options.group !== undefined || options.match !== undefined) {
690
+ return emptyExcerpt;
691
+ }
692
+ return (text) => truncateText(text, limit);
693
+ }
694
+ const occurrence = options.match ?? 1;
695
+ const group = options.group ?? 0;
696
+ if (options.pattern.length > MAX_PATTERN_LENGTH || !Number.isSafeInteger(occurrence) || occurrence < 1 || occurrence > MAX_MATCHES || typeof group === "number" && (!Number.isSafeInteger(group) || group < 0))
697
+ return emptyExcerpt;
698
+ let flags = 0;
699
+ const seenFlags = new Set;
700
+ for (const flag of options.flags ?? "") {
701
+ if (seenFlags.has(flag))
702
+ return emptyExcerpt;
703
+ seenFlags.add(flag);
704
+ switch (flag) {
705
+ case "i":
706
+ flags |= import_re2js.RE2JS.CASE_INSENSITIVE;
707
+ break;
708
+ case "m":
709
+ flags |= import_re2js.RE2JS.MULTILINE;
710
+ break;
711
+ case "s":
712
+ flags |= import_re2js.RE2JS.DOTALL;
713
+ break;
714
+ default:
715
+ return emptyExcerpt;
716
+ }
717
+ }
718
+ let compiled;
719
+ try {
720
+ compiled = import_re2js.RE2JS.compile(options.pattern, flags);
721
+ } catch {
722
+ return emptyExcerpt;
723
+ }
724
+ const programSize = compiled.programSize();
725
+ const groupCount = compiled.groupCount();
726
+ if (programSize > MAX_PROGRAM_SIZE || (typeof group === "number" ? group > groupCount : !Object.hasOwn(compiled.namedGroups(), group)))
727
+ return emptyExcerpt;
728
+ return (text) => {
729
+ if (text.length > MAX_INPUT_LENGTH)
730
+ return "";
731
+ const matcher = compiled.matcher(text);
732
+ let budget = SEARCH_BUDGET;
733
+ let from = 0;
734
+ for (let index = 1;index <= occurrence; index++) {
735
+ budget -= programSize * (groupCount + 1) * (text.length - from + 1);
736
+ if (budget < 0 || !matcher.find())
737
+ return "";
738
+ from = matcher.end();
739
+ }
740
+ return truncateText(matcher.group(group) ?? "", limit);
741
+ };
742
+ }
743
+ function excerptText(text, options = {}) {
744
+ return compileTextExcerpt(options)(text);
745
+ }
746
+ function truncateText(text, limit) {
747
+ let count = 0;
748
+ for (const segment of segmenter2.segment(text)) {
749
+ if (count++ === limit)
750
+ return text.slice(0, segment.index);
751
+ }
752
+ return text;
753
+ }
754
+ // packages/ast/src/position.ts
755
+ function createPoint(line, column, offset) {
756
+ return { line, column, offset };
757
+ }
758
+ function createPosition(start, end) {
759
+ return { start, end };
760
+ }
761
+ // packages/ast/src/element.ts
762
+ function isStringContainerType(type) {
763
+ return typeof type === "string";
764
+ }
765
+ function isHeaderType(type) {
766
+ return typeof type === "object" && type !== null && "header" in type;
767
+ }
768
+ function isAlignType(type) {
769
+ return typeof type === "object" && type !== null && "align" in type;
770
+ }
771
+ function text(value) {
772
+ return { element: "text", data: value };
773
+ }
774
+ function container(type, elements, attributes = {}) {
775
+ return {
776
+ element: "container",
777
+ data: { type, attributes, elements }
778
+ };
779
+ }
780
+ function paragraph(elements, attributes = {}) {
781
+ return container("paragraph", elements, attributes);
782
+ }
783
+ function bold(elements, attributes = {}) {
784
+ return container("bold", elements, attributes);
785
+ }
786
+ function italics(elements, attributes = {}) {
787
+ return container("italics", elements, attributes);
788
+ }
789
+ function heading(level, elements, hasToc = true, attributes = {}) {
790
+ return container({ header: { level, "has-toc": hasToc } }, elements, attributes);
791
+ }
792
+ function lineBreak() {
793
+ return { element: "line-break" };
794
+ }
795
+ function horizontalRule() {
796
+ return { element: "horizontal-rule" };
797
+ }
798
+ function link(linkLocation, label, options = {}) {
799
+ return {
800
+ element: "link",
801
+ data: {
802
+ type: options.type ?? (typeof linkLocation === "string" ? "direct" : "page"),
803
+ link: linkLocation,
804
+ extra: options.extra ?? null,
805
+ label,
806
+ target: options.target ?? null
807
+ }
808
+ };
809
+ }
810
+ function list(type, items, attributes = {}) {
811
+ return {
812
+ element: "list",
813
+ data: { type, attributes, items }
814
+ };
815
+ }
816
+ function listItemElements(elements, attributes = {}) {
817
+ return {
818
+ "item-type": "elements",
819
+ attributes,
820
+ elements
821
+ };
822
+ }
823
+ function listItemSubList(data) {
824
+ return {
825
+ "item-type": "sub-list",
826
+ element: "list",
827
+ data
828
+ };
829
+ }
830
+ function isContainerTypeParagraphSafe(type) {
831
+ if (isHeaderType(type))
832
+ return false;
833
+ if (isAlignType(type))
834
+ return false;
835
+ switch (type) {
836
+ case "bold":
837
+ case "italics":
838
+ case "underline":
839
+ case "superscript":
840
+ case "subscript":
841
+ case "strikethrough":
842
+ case "monospace":
843
+ case "span":
844
+ case "size":
845
+ return true;
846
+ case "div":
847
+ case "note":
848
+ case "blockquote":
849
+ case "paragraph":
850
+ case "heading":
851
+ case "collapsible":
852
+ case "definition-list":
853
+ case "definition-list-item":
854
+ case "definition-list-key":
855
+ case "definition-list-value":
856
+ case "table-row":
857
+ case "table-cell":
858
+ return false;
859
+ default:
860
+ return false;
861
+ }
862
+ }
863
+ function isParagraphSafe(element) {
864
+ switch (element.element) {
865
+ case "container": {
866
+ const data = element.data;
867
+ return isContainerTypeParagraphSafe(data.type);
868
+ }
869
+ case "module":
870
+ return false;
871
+ case "text":
872
+ case "raw":
873
+ case "variable":
874
+ case "email":
875
+ return true;
876
+ case "table":
877
+ return false;
878
+ case "tab-view":
879
+ return false;
880
+ case "anchor":
881
+ case "anchor-name":
882
+ case "link":
883
+ return true;
884
+ case "image":
885
+ return true;
886
+ case "list":
887
+ return false;
888
+ case "definition-list":
889
+ return false;
890
+ case "collapsible":
891
+ return false;
892
+ case "table-of-contents":
893
+ return false;
894
+ case "footnote":
895
+ return true;
896
+ case "footnote-ref":
897
+ return true;
898
+ case "footnote-block":
899
+ return false;
900
+ case "bibliography-cite":
901
+ return true;
902
+ case "bibliography-block":
903
+ return false;
904
+ case "user":
905
+ return true;
906
+ case "date":
907
+ case "social":
908
+ return true;
909
+ case "button":
910
+ return isPageButtonAction(element.data.action);
911
+ case "color":
912
+ return true;
913
+ case "code":
914
+ return false;
915
+ case "math":
916
+ return false;
917
+ case "math-inline":
918
+ return true;
919
+ case "embed":
920
+ return false;
921
+ case "embed-block":
922
+ return true;
923
+ case "html":
924
+ case "iframe":
925
+ return false;
926
+ case "include": {
927
+ const data = element.data;
928
+ return data["paragraph-safe"];
929
+ }
930
+ case "style":
931
+ return false;
932
+ case "line-break":
933
+ case "line-breaks":
934
+ return true;
935
+ case "clear-float":
936
+ return false;
937
+ case "horizontal-rule":
938
+ return false;
939
+ case "content-separator":
940
+ return false;
941
+ case "if-tags":
942
+ return false;
943
+ case "expr":
944
+ case "if":
945
+ case "ifexpr":
946
+ return true;
947
+ default:
948
+ return false;
949
+ }
950
+ }
951
+ function isPageButtonAction(action) {
952
+ switch (action) {
953
+ case "edit":
954
+ case "edit-append":
955
+ case "edit-sections":
956
+ case "history":
957
+ case "print":
958
+ case "files":
959
+ case "tags":
960
+ case "source":
961
+ case "backlinks":
962
+ case "talk":
963
+ case "delete":
964
+ case "rename":
965
+ case "site-tools":
966
+ case "edit-meta":
967
+ case "watchers":
968
+ case "parent":
969
+ case "lock-page":
970
+ return true;
971
+ default:
972
+ return false;
973
+ }
974
+ }
975
+ // packages/ast/src/constants.ts
976
+ var STYLE_SLOT_PREFIX = "\x00__IFTAGS_SLOT__";
977
+ var STYLE_ANCHOR_PREFIX = "\x00__STYLE_ANCHOR__";
978
+ // packages/ast/src/css.ts
979
+ var CSS_LENGTH_UNITS = [
980
+ "cqmax",
981
+ "cqmin",
982
+ "cqw",
983
+ "cqh",
984
+ "cqi",
985
+ "cqb",
986
+ "svmin",
987
+ "svmax",
988
+ "lvmin",
989
+ "lvmax",
990
+ "dvmin",
991
+ "dvmax",
992
+ "vmin",
993
+ "vmax",
994
+ "svw",
995
+ "svh",
996
+ "svi",
997
+ "svb",
998
+ "lvw",
999
+ "lvh",
1000
+ "lvi",
1001
+ "lvb",
1002
+ "dvw",
1003
+ "dvh",
1004
+ "dvi",
1005
+ "dvb",
1006
+ "vw",
1007
+ "vh",
1008
+ "vi",
1009
+ "vb",
1010
+ "rcap",
1011
+ "rem",
1012
+ "rex",
1013
+ "rch",
1014
+ "ric",
1015
+ "rlh",
1016
+ "cap",
1017
+ "em",
1018
+ "ex",
1019
+ "ch",
1020
+ "ic",
1021
+ "lh",
1022
+ "cm",
1023
+ "mm",
1024
+ "in",
1025
+ "pc",
1026
+ "pt",
1027
+ "px",
1028
+ "q",
1029
+ "%"
1030
+ ];
706
1031
  // packages/ast/src/settings.ts
707
1032
  function createSettings(mode) {
708
1033
  switch (mode) {