@pibit.ai/cure-design-system 0.6.47 → 0.6.49

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 (57) hide show
  1. package/dist/_virtual/index.js +2 -3
  2. package/dist/_virtual/index2.js +3 -2
  3. package/dist/code-editor/code-editor.d.ts +88 -0
  4. package/dist/code-editor/code-editor.d.ts.map +1 -0
  5. package/dist/code-editor/code-editor.js +219 -0
  6. package/dist/code-editor/formatJsonEditorValue.d.ts +2 -0
  7. package/dist/code-editor/formatJsonEditorValue.d.ts.map +1 -0
  8. package/dist/code-editor/formatJsonEditorValue.js +20 -0
  9. package/dist/code-editor/index.d.ts +5 -0
  10. package/dist/code-editor/index.d.ts.map +1 -1
  11. package/dist/code-editor/index.js +12 -4
  12. package/dist/code-editor/json-code-editor.d.ts +26 -0
  13. package/dist/code-editor/json-code-editor.d.ts.map +1 -0
  14. package/dist/code-editor/json-code-editor.js +64 -0
  15. package/dist/code-editor/languages.d.ts +5 -0
  16. package/dist/code-editor/languages.d.ts.map +1 -0
  17. package/dist/code-editor/languages.js +31 -0
  18. package/dist/node_modules/recharts/es6/util/ReactUtils.js +1 -1
  19. package/dist/node_modules/use-sync-external-store/shim/index.js +1 -1
  20. package/dist/rich-text/index.d.ts +9 -0
  21. package/dist/rich-text/index.d.ts.map +1 -1
  22. package/dist/rich-text/index.js +37 -1
  23. package/dist/rich-text/platform.d.ts +9 -0
  24. package/dist/rich-text/platform.d.ts.map +1 -0
  25. package/dist/rich-text/platform.js +35 -0
  26. package/dist/rich-text/text-editor-button.d.ts +7 -0
  27. package/dist/rich-text/text-editor-button.d.ts.map +1 -0
  28. package/dist/rich-text/text-editor-button.js +33 -0
  29. package/dist/rich-text/text-editor-character-count.d.ts +50 -0
  30. package/dist/rich-text/text-editor-character-count.d.ts.map +1 -0
  31. package/dist/rich-text/text-editor-character-count.js +34 -0
  32. package/dist/rich-text/text-editor-extensions.d.ts +95 -0
  33. package/dist/rich-text/text-editor-extensions.d.ts.map +1 -0
  34. package/dist/rich-text/text-editor-extensions.js +553 -0
  35. package/dist/rich-text/text-editor-heading-refocus.d.ts +21 -0
  36. package/dist/rich-text/text-editor-heading-refocus.d.ts.map +1 -0
  37. package/dist/rich-text/text-editor-heading-refocus.js +24 -0
  38. package/dist/rich-text/text-editor-line-utils.d.ts +8 -0
  39. package/dist/rich-text/text-editor-line-utils.d.ts.map +1 -0
  40. package/dist/rich-text/text-editor-line-utils.js +29 -0
  41. package/dist/rich-text/text-editor-mention.d.ts +32 -0
  42. package/dist/rich-text/text-editor-mention.d.ts.map +1 -0
  43. package/dist/rich-text/text-editor-mention.js +92 -0
  44. package/dist/rich-text/text-editor-shortcuts.d.ts +9 -0
  45. package/dist/rich-text/text-editor-shortcuts.d.ts.map +1 -0
  46. package/dist/rich-text/text-editor-shortcuts.js +6 -0
  47. package/dist/rich-text/text-editor-toolbar.d.ts +15 -0
  48. package/dist/rich-text/text-editor-toolbar.d.ts.map +1 -0
  49. package/dist/rich-text/text-editor-toolbar.js +104 -0
  50. package/dist/rich-text/text-editor-tooltip.d.ts +5 -0
  51. package/dist/rich-text/text-editor-tooltip.d.ts.map +1 -0
  52. package/dist/rich-text/text-editor-tooltip.js +31 -0
  53. package/dist/rich-text/text-editor.d.ts +55 -0
  54. package/dist/rich-text/text-editor.d.ts.map +1 -0
  55. package/dist/rich-text/text-editor.js +324 -0
  56. package/dist/styles/components.css +1 -1
  57. package/package.json +12 -2
@@ -0,0 +1,35 @@
1
+ function n() {
2
+ if (typeof navigator > "u") return "";
3
+ const t = navigator.userAgentData;
4
+ return (t == null ? void 0 : t.platform) || navigator.platform || "";
5
+ }
6
+ function l(t = n()) {
7
+ return /mac|iphone|ipad|ipod/i.test(t);
8
+ }
9
+ function f(t, r, o = n()) {
10
+ if (l(o)) {
11
+ const a = {
12
+ meta: "⌘",
13
+ ctrl: "⌃",
14
+ alt: "⌥",
15
+ shift: "⇧"
16
+ };
17
+ return `${t.map((i) => a[i]).join("")}${r}`;
18
+ }
19
+ const e = {
20
+ meta: "Ctrl",
21
+ ctrl: "Ctrl",
22
+ alt: "Alt",
23
+ shift: "Shift"
24
+ };
25
+ return `${t.map((a) => e[a]).join("+")}+${r}`;
26
+ }
27
+ function c(t, r) {
28
+ return f(t, r, n());
29
+ }
30
+ export {
31
+ n as getNavigatorPlatform,
32
+ c as getPlatformShortcutLabel,
33
+ f as getShortcutLabel,
34
+ l as isMacPlatform
35
+ };
@@ -0,0 +1,7 @@
1
+ import { ButtonProps } from 'react-aria-components';
2
+ interface EditorButtonProps extends ButtonProps {
3
+ isActive?: boolean;
4
+ }
5
+ export declare const EditorButton: ({ isActive, isDisabled, className, children, preventFocusOnPress, onMouseDown, ...props }: EditorButtonProps) => import("react/jsx-runtime").JSX.Element;
6
+ export {};
7
+ //# sourceMappingURL=text-editor-button.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text-editor-button.d.ts","sourceRoot":"","sources":["../../src/rich-text/text-editor-button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAwB,KAAK,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAG/E,UAAU,iBAAkB,SAAQ,WAAW;IAC7C,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,YAAY,GAAI,2FAQ1B,iBAAiB,4CA4BnB,CAAC"}
@@ -0,0 +1,33 @@
1
+ import { jsx as p } from "react/jsx-runtime";
2
+ import { Button as a } from "react-aria-components";
3
+ import { cx as d } from "../utils/cn.js";
4
+ const c = ({
5
+ isActive: n,
6
+ isDisabled: o,
7
+ className: t,
8
+ children: f,
9
+ preventFocusOnPress: i = !0,
10
+ onMouseDown: e,
11
+ ...u
12
+ }) => /* @__PURE__ */ p(
13
+ a,
14
+ {
15
+ ...u,
16
+ type: "button",
17
+ preventFocusOnPress: i,
18
+ onMouseDown: (r) => {
19
+ e == null || e(r), i && !r.defaultPrevented && r.preventDefault();
20
+ },
21
+ isDisabled: o,
22
+ className: (r) => d(
23
+ "flex size-8 cursor-pointer items-center justify-center rounded-md p-0! text-fg-quaternary outline-focus-ring transition duration-100 ease-linear focus-visible:outline-2 focus-visible:outline-offset-2 pressed:bg-primary_hover pressed:outline-hidden",
24
+ n ? "bg-primary_hover text-fg-secondary" : "hover:bg-primary_hover hover:text-fg-quaternary_hover",
25
+ o && "cursor-not-allowed",
26
+ typeof t == "function" ? t(r) : t
27
+ ),
28
+ children: f
29
+ }
30
+ );
31
+ export {
32
+ c as EditorButton
33
+ };
@@ -0,0 +1,50 @@
1
+ import { Extension } from '@tiptap/core';
2
+ import { Node as ProseMirrorNode } from '@tiptap/pm/model';
3
+ interface CharacterCountOptions {
4
+ /**
5
+ * The mode by which the size is calculated. If set to `textSize`, the textContent of the document is used.
6
+ * If set to `nodeSize`, the nodeSize of the document is used.
7
+ * @default 'textSize'
8
+ * @example 'textSize'
9
+ */
10
+ mode: "textSize" | "nodeSize";
11
+ /**
12
+ * The text counter function to use. Defaults to a simple character count.
13
+ * @default (text) => text.length
14
+ * @example (text) => [...new Intl.Segmenter().segment(text)].length
15
+ */
16
+ textCounter: (text: string) => number;
17
+ /**
18
+ * The word counter function to use. Defaults to a simple word count.
19
+ * @default (text) => text.split(' ').filter(word => word !== '').length
20
+ * @example (text) => text.split(/\s+/).filter(word => word !== '').length
21
+ */
22
+ wordCounter: (text: string) => number;
23
+ }
24
+ interface CharacterCountStorage {
25
+ /**
26
+ * Get the number of characters for the current document.
27
+ * @param options The options for the character count. (optional)
28
+ * @param options.node The node to get the characters from. Defaults to the current document.
29
+ * @param options.mode The mode by which the size is calculated. If set to `textSize`, the textContent of the document is used.
30
+ */
31
+ characters: (options?: {
32
+ node?: ProseMirrorNode;
33
+ mode?: "textSize" | "nodeSize";
34
+ }) => number;
35
+ /**
36
+ * Get the number of words for the current document.
37
+ * @param options The options for the character count. (optional)
38
+ * @param options.node The node to get the words from. Defaults to the current document.
39
+ */
40
+ words: (options?: {
41
+ node?: ProseMirrorNode;
42
+ }) => number;
43
+ }
44
+ /**
45
+ * This extension allows you to count the characters and words of your document.
46
+ * @see https://tiptap.dev/api/extensions/character-count
47
+ */
48
+ export declare const CharacterCount: Extension<CharacterCountOptions, CharacterCountStorage>;
49
+ export {};
50
+ //# sourceMappingURL=text-editor-character-count.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text-editor-character-count.d.ts","sourceRoot":"","sources":["../../src/rich-text/text-editor-character-count.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,KAAK,EAAE,IAAI,IAAI,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEhE,UAAU,qBAAqB;IAC7B;;;;;OAKG;IACH,IAAI,EAAE,UAAU,GAAG,UAAU,CAAC;IAC9B;;;;OAIG;IACH,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;IACtC;;;;OAIG;IACH,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;CACvC;AAED,UAAU,qBAAqB;IAC7B;;;;;OAKG;IACH,UAAU,EAAE,CAAC,OAAO,CAAC,EAAE;QACrB,IAAI,CAAC,EAAE,eAAe,CAAC;QACvB,IAAI,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC;KAChC,KAAK,MAAM,CAAC;IAEb;;;;OAIG;IACH,KAAK,EAAE,CAAC,OAAO,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,eAAe,CAAA;KAAE,KAAK,MAAM,CAAC;CACzD;AAED;;;GAGG;AACH,eAAO,MAAM,cAAc,yDA4CzB,CAAC"}
@@ -0,0 +1,34 @@
1
+ import { Extension as d } from "@tiptap/core";
2
+ const a = d.create({
3
+ name: "characterCount",
4
+ addOptions() {
5
+ return {
6
+ limit: null,
7
+ mode: "textSize",
8
+ textCounter: (e) => e.length,
9
+ wordCounter: (e) => e.split(" ").filter((t) => t !== "").length
10
+ };
11
+ },
12
+ addStorage() {
13
+ return {
14
+ characters: () => 0,
15
+ words: () => 0
16
+ };
17
+ },
18
+ onBeforeCreate() {
19
+ this.storage.characters = (e) => {
20
+ const t = (e == null ? void 0 : e.node) || this.editor.state.doc;
21
+ if (((e == null ? void 0 : e.mode) || this.options.mode) === "textSize") {
22
+ const n = t.textBetween(0, t.content.size, void 0, " ");
23
+ return this.options.textCounter(n);
24
+ }
25
+ return t.nodeSize;
26
+ }, this.storage.words = (e) => {
27
+ const t = (e == null ? void 0 : e.node) || this.editor.state.doc, r = t.textBetween(0, t.content.size, " ", " ");
28
+ return this.options.wordCounter(r);
29
+ };
30
+ }
31
+ });
32
+ export {
33
+ a as CharacterCount
34
+ };
@@ -0,0 +1,95 @@
1
+ /**
2
+ * Text editor button that toggles bold text.
3
+ */
4
+ export declare const RichTextEditorBold: ({ className }: {
5
+ className?: string;
6
+ }) => import("react/jsx-runtime").JSX.Element;
7
+ /**
8
+ * Text editor button that toggles italic text.
9
+ */
10
+ export declare const RichTextEditorItalic: ({ className }: {
11
+ className?: string;
12
+ }) => import("react/jsx-runtime").JSX.Element;
13
+ /**
14
+ * Text editor button that toggles underline text.
15
+ */
16
+ export declare const RichTextEditorUnderline: ({ className, }: {
17
+ className?: string;
18
+ }) => import("react/jsx-runtime").JSX.Element;
19
+ /**
20
+ * Text editor button that toggles strikethrough text.
21
+ */
22
+ export declare const RichTextEditorStrikethrough: ({ className, }: {
23
+ className?: string;
24
+ }) => import("react/jsx-runtime").JSX.Element;
25
+ /**
26
+ * Text editor button that toggles bullet list.
27
+ */
28
+ export declare const RichTextEditorBulletList: ({ className, }: {
29
+ className?: string;
30
+ }) => import("react/jsx-runtime").JSX.Element;
31
+ /**
32
+ * Text editor button that toggles left alignment.
33
+ */
34
+ export declare const RichTextEditorAlignLeft: ({ className, }: {
35
+ className?: string;
36
+ }) => import("react/jsx-runtime").JSX.Element;
37
+ /**
38
+ * Text editor button that toggles center alignment.
39
+ */
40
+ export declare const RichTextEditorAlignCenter: ({ className, }: {
41
+ className?: string;
42
+ }) => import("react/jsx-runtime").JSX.Element;
43
+ /**
44
+ * Text editor button that generates text.
45
+ */
46
+ export declare const RichTextEditorGenerate: () => import("react/jsx-runtime").JSX.Element;
47
+ /**
48
+ * Text editor button for inserting a link.
49
+ */
50
+ export declare const RichTextEditorLink: ({ className }: {
51
+ className?: string;
52
+ }) => import("react/jsx-runtime").JSX.Element;
53
+ /**
54
+ * Text editor button for inserting an image.
55
+ */
56
+ export declare const RichTextEditorImage: ({ className }: {
57
+ className?: string;
58
+ }) => import("react/jsx-runtime").JSX.Element;
59
+ /**
60
+ * Text editor button for changing the text color.
61
+ */
62
+ export declare const RichTextEditorColor: ({ className }: {
63
+ className?: string;
64
+ }) => import("react/jsx-runtime").JSX.Element;
65
+ /**
66
+ * Text editor button for changing the text font family.
67
+ */
68
+ export declare const RichTextEditorFontFamily: ({ className, }: {
69
+ className?: string;
70
+ }) => import("react/jsx-runtime").JSX.Element;
71
+ /**
72
+ * Text editor dropdown for selecting heading level (Paragraph / H1 / H2 / H3).
73
+ */
74
+ export declare const RichTextEditorHeading: ({ className, }: {
75
+ className?: string;
76
+ }) => import("react/jsx-runtime").JSX.Element;
77
+ /**
78
+ * Text editor button that toggles ordered (numbered) list.
79
+ */
80
+ export declare const RichTextEditorOrderedList: ({ className, }: {
81
+ className?: string;
82
+ }) => import("react/jsx-runtime").JSX.Element;
83
+ /**
84
+ * Text editor button that toggles blockquote.
85
+ */
86
+ export declare const RichTextEditorBlockquote: ({ className, }: {
87
+ className?: string;
88
+ }) => import("react/jsx-runtime").JSX.Element;
89
+ /**
90
+ * Text editor button for changing the text font size.
91
+ */
92
+ export declare const RichTextEditorFontSize: ({ className, }: {
93
+ className?: string;
94
+ }) => import("react/jsx-runtime").JSX.Element;
95
+ //# sourceMappingURL=text-editor-extensions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text-editor-extensions.d.ts","sourceRoot":"","sources":["../../src/rich-text/text-editor-extensions.tsx"],"names":[],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