@opengis/form 0.1.32 → 0.1.33

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.
@@ -0,0 +1,50 @@
1
+ import { N as d, m as u } from "./index-pYkcVgEL.js";
2
+ var n = " ", i = " ", h = d.create({
3
+ name: "paragraph",
4
+ priority: 1e3,
5
+ addOptions() {
6
+ return {
7
+ HTMLAttributes: {}
8
+ };
9
+ },
10
+ group: "block",
11
+ content: "inline*",
12
+ parseHTML() {
13
+ return [{ tag: "p" }];
14
+ },
15
+ renderHTML({ HTMLAttributes: t }) {
16
+ return ["p", u(this.options.HTMLAttributes, t), 0];
17
+ },
18
+ parseMarkdown: (t, a) => {
19
+ const r = t.tokens || [];
20
+ if (r.length === 1 && r[0].type === "image")
21
+ return a.parseChildren([r[0]]);
22
+ const e = a.parseInline(r);
23
+ return r.length === 1 && r[0].type === "text" && (r[0].raw === n || r[0].text === n || r[0].raw === i || r[0].text === i) && e.length === 1 && e[0].type === "text" && (e[0].text === n || e[0].text === i) ? a.createNode("paragraph", void 0, []) : a.createNode("paragraph", void 0, e);
24
+ },
25
+ renderMarkdown: (t, a, r) => {
26
+ var e, o;
27
+ if (!t)
28
+ return "";
29
+ const p = Array.isArray(t.content) ? t.content : [];
30
+ if (p.length === 0) {
31
+ const s = Array.isArray((e = r?.previousNode) == null ? void 0 : e.content) ? r.previousNode.content : [];
32
+ return ((o = r?.previousNode) == null ? void 0 : o.type) === "paragraph" && s.length === 0 ? n : "";
33
+ }
34
+ return a.renderChildren(p);
35
+ },
36
+ addCommands() {
37
+ return {
38
+ setParagraph: () => ({ commands: t }) => t.setNode(this.name)
39
+ };
40
+ },
41
+ addKeyboardShortcuts() {
42
+ return {
43
+ "Mod-Alt-0": () => this.editor.commands.setParagraph()
44
+ };
45
+ }
46
+ }), c = h;
47
+ export {
48
+ h as Paragraph,
49
+ c as default
50
+ };
@@ -0,0 +1,89 @@
1
+ import { M as o, a as s, b as l, m as u, g as d } from "./index-pYkcVgEL.js";
2
+ var h = /(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/, g = /(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g, c = o.create({
3
+ name: "highlight",
4
+ addOptions() {
5
+ return {
6
+ multicolor: !1,
7
+ HTMLAttributes: {}
8
+ };
9
+ },
10
+ addAttributes() {
11
+ return this.options.multicolor ? {
12
+ color: {
13
+ default: null,
14
+ // Prefer `data-color` (set by our own `renderHTML`) for lossless
15
+ // round-trips. Otherwise parse the raw inline `style` attribute so
16
+ // the original color format (e.g. `#rrggbb`) is preserved instead of
17
+ // the canonicalized `rgb(...)` value from `element.style.backgroundColor`.
18
+ parseHTML: (r) => r.getAttribute("data-color") || d(r, "background-color") || r.style.backgroundColor,
19
+ renderHTML: (r) => r.color ? {
20
+ "data-color": r.color,
21
+ style: `background-color: ${r.color}; color: inherit`
22
+ } : {}
23
+ }
24
+ } : {};
25
+ },
26
+ parseHTML() {
27
+ return [
28
+ {
29
+ tag: "mark"
30
+ }
31
+ ];
32
+ },
33
+ renderHTML({ HTMLAttributes: r }) {
34
+ return ["mark", u(this.options.HTMLAttributes, r), 0];
35
+ },
36
+ renderMarkdown: (r, t) => `==${t.renderChildren(r)}==`,
37
+ parseMarkdown: (r, t) => t.applyMark("highlight", t.parseInline(r.tokens || [])),
38
+ markdownTokenizer: {
39
+ name: "highlight",
40
+ level: "inline",
41
+ start: (r) => r.indexOf("=="),
42
+ tokenize(r, t, a) {
43
+ const e = /^(==)([^=]+)(==)/.exec(r);
44
+ if (e) {
45
+ const n = e[2].trim(), i = a.inlineTokens(n);
46
+ return {
47
+ type: "highlight",
48
+ raw: e[0],
49
+ text: n,
50
+ tokens: i
51
+ };
52
+ }
53
+ }
54
+ },
55
+ addCommands() {
56
+ return {
57
+ setHighlight: (r) => ({ commands: t }) => t.setMark(this.name, r),
58
+ toggleHighlight: (r) => ({ commands: t }) => t.toggleMark(this.name, r),
59
+ unsetHighlight: () => ({ commands: r }) => r.unsetMark(this.name)
60
+ };
61
+ },
62
+ addKeyboardShortcuts() {
63
+ return {
64
+ "Mod-Shift-h": () => this.editor.commands.toggleHighlight()
65
+ };
66
+ },
67
+ addInputRules() {
68
+ return [
69
+ l({
70
+ find: h,
71
+ type: this.type
72
+ })
73
+ ];
74
+ },
75
+ addPasteRules() {
76
+ return [
77
+ s({
78
+ find: g,
79
+ type: this.type
80
+ })
81
+ ];
82
+ }
83
+ }), m = c;
84
+ export {
85
+ c as Highlight,
86
+ m as default,
87
+ h as inputRegex,
88
+ g as pasteRegex
89
+ };
@@ -1,30 +1,29 @@
1
- import { E as n } from "./index-z-RdtcIQ.js";
2
- const s = n.create({
1
+ import { E as n } from "./index-pYkcVgEL.js";
2
+ var s = n.create({
3
3
  name: "textAlign",
4
4
  addOptions() {
5
5
  return {
6
6
  types: [],
7
- alignments: [
8
- "left",
9
- "center",
10
- "right",
11
- "justify"
12
- ],
7
+ alignments: ["left", "center", "right", "justify"],
13
8
  defaultAlignment: null
14
9
  };
15
10
  },
16
11
  addGlobalAttributes() {
17
- return [{
18
- types: this.options.types,
19
- attributes: { textAlign: {
20
- default: this.options.defaultAlignment,
21
- parseHTML: (t) => {
22
- const e = t.style.textAlign;
23
- return this.options.alignments.includes(e) ? e : this.options.defaultAlignment;
24
- },
25
- renderHTML: (t) => t.textAlign ? { style: `text-align: ${t.textAlign}` } : {}
26
- } }
27
- }];
12
+ return [
13
+ {
14
+ types: this.options.types,
15
+ attributes: {
16
+ textAlign: {
17
+ default: this.options.defaultAlignment,
18
+ parseHTML: (t) => {
19
+ const e = t.style.textAlign;
20
+ return this.options.alignments.includes(e) ? e : this.options.defaultAlignment;
21
+ },
22
+ renderHTML: (t) => t.textAlign ? { style: `text-align: ${t.textAlign}` } : {}
23
+ }
24
+ }
25
+ }
26
+ ];
28
27
  },
29
28
  addCommands() {
30
29
  return {
@@ -41,8 +40,7 @@ const s = n.create({
41
40
  "Mod-Shift-j": () => this.editor.commands.setTextAlign("justify")
42
41
  };
43
42
  }
44
- });
45
- var l = s;
43
+ }), l = s;
46
44
  export {
47
45
  s as TextAlign,
48
46
  l as default