@vizel/core 0.0.1-alpha.5 → 1.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.
Files changed (75) hide show
  1. package/dist/components.css +1 -1
  2. package/dist/components.css.map +1 -1
  3. package/dist/index.d.ts +230 -15
  4. package/dist/index.js +78 -75
  5. package/dist/index10.js +1 -1
  6. package/dist/index11.js +4 -4
  7. package/dist/index14.js +1 -1
  8. package/dist/index15.js +134 -127
  9. package/dist/index17.js +2 -2
  10. package/dist/index18.js +1 -1
  11. package/dist/index19.js +86 -86
  12. package/dist/index20.js +2 -2
  13. package/dist/index21.js +2 -2
  14. package/dist/index22.js +16 -13
  15. package/dist/index24.js +164 -11
  16. package/dist/index25.js +12 -53
  17. package/dist/index26.js +49 -136
  18. package/dist/index27.js +132 -59
  19. package/dist/index28.js +66 -32
  20. package/dist/index29.js +35 -21
  21. package/dist/index3.js +91 -90
  22. package/dist/index30.js +23 -9
  23. package/dist/index31.js +9 -147
  24. package/dist/index32.js +138 -256
  25. package/dist/index33.js +258 -85
  26. package/dist/index34.js +84 -55
  27. package/dist/index35.js +64 -4
  28. package/dist/index36.js +4 -123
  29. package/dist/index37.js +111 -315
  30. package/dist/index38.js +321 -481
  31. package/dist/index39.js +12 -47
  32. package/dist/index4.js +1 -1
  33. package/dist/index40.js +463 -655
  34. package/dist/index41.js +48 -4
  35. package/dist/index42.js +694 -4
  36. package/dist/index43.js +4 -238
  37. package/dist/index44.js +4 -82
  38. package/dist/index45.js +237 -16
  39. package/dist/index46.js +81 -57
  40. package/dist/index47.js +17 -15
  41. package/dist/index48.js +57 -285
  42. package/dist/index49.js +15 -202
  43. package/dist/index5.js +78 -68
  44. package/dist/index50.js +281 -1497
  45. package/dist/index51.js +202 -5
  46. package/dist/index52.js +1408 -1467
  47. package/dist/index53.js +5 -723
  48. package/dist/index54.js +1109 -81
  49. package/dist/index55.js +703 -226
  50. package/dist/index56.js +84 -3
  51. package/dist/index57.js +219 -1205
  52. package/dist/index58.js +3 -734
  53. package/dist/index59.js +1232 -21
  54. package/dist/index6.js +1 -1
  55. package/dist/index60.js +734 -10
  56. package/dist/index61.js +21 -7
  57. package/dist/index62.js +10 -8
  58. package/dist/index63.js +6 -13
  59. package/dist/index64.js +7 -18
  60. package/dist/index65.js +12 -23
  61. package/dist/index66.js +17 -53
  62. package/dist/index67.js +23 -1059
  63. package/dist/index68.js +54 -90
  64. package/dist/index69.js +1061 -98
  65. package/dist/index7.js +108 -96
  66. package/dist/index70.js +98 -4
  67. package/dist/index71.js +93 -0
  68. package/dist/index72.js +6 -0
  69. package/dist/index8.js +1 -1
  70. package/dist/index9.js +75 -65
  71. package/dist/mathematics.css +1 -0
  72. package/dist/mathematics.css.map +1 -0
  73. package/dist/styles.css +1 -1
  74. package/dist/styles.css.map +1 -1
  75. package/package.json +90 -52
package/dist/index46.js CHANGED
@@ -1,60 +1,84 @@
1
- import { defaultIconProps as k } from "./index59.js";
2
- import { defaultIconCustomisations as y } from "./index60.js";
3
- import { calculateSize as b } from "./index64.js";
4
- import { wrapSVGContent as C } from "./index65.js";
5
- const I = (s) => s === "unset" || s === "undefined" || s === "none";
6
- function H(s, x) {
7
- const n = {
8
- ...k,
9
- ...s
10
- }, g = {
11
- ...y,
12
- ...x
13
- }, t = {
14
- left: n.left,
15
- top: n.top,
16
- width: n.width,
17
- height: n.height
18
- };
19
- let u = n.body;
20
- [n, g].forEach((r) => {
21
- const o = [], F = r.hFlip, S = r.vFlip;
22
- let e = r.rotate;
23
- F ? S ? e += 2 : (o.push("translate(" + (t.width + t.left).toString() + " " + (0 - t.top).toString() + ")"), o.push("scale(-1 1)"), t.top = t.left = 0) : S && (o.push("translate(" + (0 - t.left).toString() + " " + (t.height + t.top).toString() + ")"), o.push("scale(1 -1)"), t.top = t.left = 0);
24
- let i;
25
- switch (e < 0 && (e -= Math.floor(e / 4) * 4), e = e % 4, e) {
26
- case 1:
27
- i = t.height / 2 + t.top, o.unshift("rotate(90 " + i.toString() + " " + i.toString() + ")");
28
- break;
29
- case 2:
30
- o.unshift("rotate(180 " + (t.width / 2 + t.left).toString() + " " + (t.height / 2 + t.top).toString() + ")");
31
- break;
32
- case 3:
33
- i = t.width / 2 + t.left, o.unshift("rotate(-90 " + i.toString() + " " + i.toString() + ")");
34
- break;
1
+ import { Mark as a, markPasteRule as s, markInputRule as l, mergeAttributes as u } from "@tiptap/core";
2
+ var h = /(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/, d = /(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g, m = a.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
+ parseHTML: (r) => r.getAttribute("data-color") || r.style.backgroundColor,
15
+ renderHTML: (r) => r.color ? {
16
+ "data-color": r.color,
17
+ style: `background-color: ${r.color}; color: inherit`
18
+ } : {}
19
+ }
20
+ } : {};
21
+ },
22
+ parseHTML() {
23
+ return [
24
+ {
25
+ tag: "mark"
26
+ }
27
+ ];
28
+ },
29
+ renderHTML({ HTMLAttributes: r }) {
30
+ return ["mark", u(this.options.HTMLAttributes, r), 0];
31
+ },
32
+ renderMarkdown: (r, t) => `==${t.renderChildren(r)}==`,
33
+ parseMarkdown: (r, t) => t.applyMark("highlight", t.parseInline(r.tokens || [])),
34
+ markdownTokenizer: {
35
+ name: "highlight",
36
+ level: "inline",
37
+ start: (r) => r.indexOf("=="),
38
+ tokenize(r, t, i) {
39
+ const e = /^(==)([^=]+)(==)/.exec(r);
40
+ if (e) {
41
+ const n = e[2].trim(), o = i.inlineTokens(n);
42
+ return {
43
+ type: "highlight",
44
+ raw: e[0],
45
+ text: n,
46
+ tokens: o
47
+ };
48
+ }
35
49
  }
36
- e % 2 === 1 && (t.left !== t.top && (i = t.left, t.left = t.top, t.top = i), t.width !== t.height && (i = t.width, t.width = t.height, t.height = i)), o.length && (u = C(u, '<g transform="' + o.join(" ") + '">', "</g>"));
37
- });
38
- const p = g.width, h = g.height, f = t.width, l = t.height;
39
- let a, c;
40
- p === null ? (c = h === null ? "1em" : h === "auto" ? l : h, a = b(c, f / l)) : (a = p === "auto" ? f : p, c = h === null ? b(a, l / f) : h === "auto" ? l : h);
41
- const d = {}, w = (r, o) => {
42
- I(o) || (d[r] = o.toString());
43
- };
44
- w("width", a), w("height", c);
45
- const m = [
46
- t.left,
47
- t.top,
48
- f,
49
- l
50
- ];
51
- return d.viewBox = m.join(" "), {
52
- attributes: d,
53
- viewBox: m,
54
- body: u
55
- };
56
- }
50
+ },
51
+ addCommands() {
52
+ return {
53
+ setHighlight: (r) => ({ commands: t }) => t.setMark(this.name, r),
54
+ toggleHighlight: (r) => ({ commands: t }) => t.toggleMark(this.name, r),
55
+ unsetHighlight: () => ({ commands: r }) => r.unsetMark(this.name)
56
+ };
57
+ },
58
+ addKeyboardShortcuts() {
59
+ return {
60
+ "Mod-Shift-h": () => this.editor.commands.toggleHighlight()
61
+ };
62
+ },
63
+ addInputRules() {
64
+ return [
65
+ l({
66
+ find: h,
67
+ type: this.type
68
+ })
69
+ ];
70
+ },
71
+ addPasteRules() {
72
+ return [
73
+ s({
74
+ find: d,
75
+ type: this.type
76
+ })
77
+ ];
78
+ }
79
+ });
57
80
  export {
58
- H as iconToSVG,
59
- I as isUnsetKeyword
81
+ m as Highlight,
82
+ h as inputRegex,
83
+ d as pasteRegex
60
84
  };