@crediblemark/build 0.22.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 (52) hide show
  1. package/LICENSE +21 -0
  2. package/dist/Editor-XZF6CWVW.css +404 -0
  3. package/dist/Editor-ZC67OU2A.mjs +205 -0
  4. package/dist/Render-JBFI6HYN.mjs +55 -0
  5. package/dist/Render-WCX4AXOX.css +102 -0
  6. package/dist/actions-CEH_5LMY.d.mts +838 -0
  7. package/dist/actions-CEH_5LMY.d.ts +838 -0
  8. package/dist/chunk-3AJBFQU4.mjs +560 -0
  9. package/dist/chunk-4SQOX3ZQ.mjs +476 -0
  10. package/dist/chunk-B4BOBGYB.mjs +42 -0
  11. package/dist/chunk-CDMESQDA.mjs +148 -0
  12. package/dist/chunk-DSXRK4QJ.mjs +704 -0
  13. package/dist/chunk-GUJDGRSM.mjs +469 -0
  14. package/dist/chunk-HHBUU7WF.mjs +35 -0
  15. package/dist/chunk-IJHL7BIR.mjs +11 -0
  16. package/dist/chunk-PHGC6QYB.mjs +105 -0
  17. package/dist/chunk-QF3GD5WQ.mjs +65 -0
  18. package/dist/chunk-U2NVBXAC.mjs +2064 -0
  19. package/dist/chunk-VFD76OD5.mjs +55 -0
  20. package/dist/chunk-VGDMWS44.mjs +107 -0
  21. package/dist/chunk-VKBVSWU3.mjs +8538 -0
  22. package/dist/chunk-YH7AXYKP.mjs +109 -0
  23. package/dist/full-ABQQRJAO.css +301 -0
  24. package/dist/full-LJRK5736.mjs +94 -0
  25. package/dist/index-CkSfgrvw.d.ts +117 -0
  26. package/dist/index-Cxwg4vUV.d.mts +117 -0
  27. package/dist/index.css +2576 -0
  28. package/dist/index.d.mts +310 -0
  29. package/dist/index.d.ts +310 -0
  30. package/dist/index.js +15012 -0
  31. package/dist/index.mjs +83 -0
  32. package/dist/internal.d.mts +27 -0
  33. package/dist/internal.d.ts +27 -0
  34. package/dist/internal.js +960 -0
  35. package/dist/internal.mjs +13 -0
  36. package/dist/loaded-DWCENJKQ.mjs +55 -0
  37. package/dist/loaded-N7VXUR4O.mjs +59 -0
  38. package/dist/loaded-NE2PIHUQ.mjs +56 -0
  39. package/dist/loaded-SMEIWWHS.css +87 -0
  40. package/dist/no-external.css +2574 -0
  41. package/dist/no-external.d.mts +21 -0
  42. package/dist/no-external.d.ts +21 -0
  43. package/dist/no-external.js +15012 -0
  44. package/dist/no-external.mjs +83 -0
  45. package/dist/rsc.css +102 -0
  46. package/dist/rsc.d.mts +27 -0
  47. package/dist/rsc.d.ts +27 -0
  48. package/dist/rsc.js +1466 -0
  49. package/dist/rsc.mjs +147 -0
  50. package/dist/walk-tree-B4ZvMfxS.d.ts +29 -0
  51. package/dist/walk-tree-C78ZVz19.d.mts +29 -0
  52. package/package.json +145 -0
@@ -0,0 +1,55 @@
1
+ import {
2
+ TextAlignCenter,
3
+ TextAlignEnd,
4
+ TextAlignJustify,
5
+ TextAlignStart
6
+ } from "./chunk-U2NVBXAC.mjs";
7
+ import {
8
+ init_react_import
9
+ } from "./chunk-B4BOBGYB.mjs";
10
+
11
+ // components/RichTextMenu/controls/AlignSelect/use-options.ts
12
+ init_react_import();
13
+ import { useMemo } from "react";
14
+ var optionNodes = {
15
+ left: { label: "Left", icon: TextAlignStart },
16
+ center: { label: "Center", icon: TextAlignCenter },
17
+ right: { label: "Right", icon: TextAlignEnd },
18
+ justify: { label: "Justify", icon: TextAlignJustify }
19
+ };
20
+ var useAlignOptions = (fieldOptions) => {
21
+ const blockOptions = useMemo(() => {
22
+ const options = [];
23
+ if (fieldOptions?.textAlign !== false) {
24
+ if (!fieldOptions?.textAlign?.alignments) {
25
+ return ["left", "center", "right", "justify"];
26
+ } else {
27
+ if (fieldOptions?.textAlign.alignments.includes("left")) {
28
+ options.push("left");
29
+ }
30
+ if (fieldOptions?.textAlign.alignments.includes("center")) {
31
+ options.push("center");
32
+ }
33
+ if (fieldOptions?.textAlign.alignments.includes("right")) {
34
+ options.push("right");
35
+ }
36
+ if (fieldOptions?.textAlign.alignments.includes("justify")) {
37
+ options.push("justify");
38
+ }
39
+ }
40
+ }
41
+ return options;
42
+ }, [fieldOptions?.textAlign]);
43
+ return useMemo(
44
+ () => blockOptions.map((item) => ({
45
+ value: item,
46
+ label: optionNodes[item].label,
47
+ icon: optionNodes[item].icon
48
+ })),
49
+ [blockOptions]
50
+ );
51
+ };
52
+
53
+ export {
54
+ useAlignOptions
55
+ };
@@ -0,0 +1,107 @@
1
+ import {
2
+ styles_module_default
3
+ } from "./chunk-IJHL7BIR.mjs";
4
+ import {
5
+ LoadedRichTextMenuInner
6
+ } from "./chunk-DSXRK4QJ.mjs";
7
+ import {
8
+ useAppStore,
9
+ useAppStoreApi
10
+ } from "./chunk-U2NVBXAC.mjs";
11
+ import {
12
+ get_class_name_factory_default
13
+ } from "./chunk-YH7AXYKP.mjs";
14
+ import {
15
+ init_react_import
16
+ } from "./chunk-B4BOBGYB.mjs";
17
+
18
+ // components/RichTextEditor/components/EditorInner.tsx
19
+ init_react_import();
20
+ import {
21
+ memo,
22
+ useCallback
23
+ } from "react";
24
+ import { jsx, jsxs } from "react/jsx-runtime";
25
+ var getClassName = get_class_name_factory_default("RichTextEditor", styles_module_default);
26
+ var EditorInner = memo(
27
+ ({
28
+ children,
29
+ menu,
30
+ readOnly = false,
31
+ field,
32
+ inline = false,
33
+ editor,
34
+ id
35
+ }) => {
36
+ const { initialHeight } = field;
37
+ const isActive = useAppStore(
38
+ (s) => s.currentRichText?.id === id && inline === s.currentRichText.inline
39
+ );
40
+ const appStoreApi = useAppStoreApi();
41
+ const handleHotkeyCapture = useCallback(
42
+ (event) => {
43
+ if ((event.metaKey || event.ctrlKey) && event.key.toLowerCase() === "i") {
44
+ event.stopPropagation();
45
+ event.preventDefault();
46
+ editor?.commands.toggleItalic?.();
47
+ }
48
+ if (event.key.toLowerCase() === "backspace") {
49
+ event.stopPropagation();
50
+ }
51
+ },
52
+ [editor]
53
+ );
54
+ const handleBlur = useCallback(
55
+ (e) => {
56
+ const targetInMenu = !!e.relatedTarget?.closest?.(
57
+ "[data-credbuild-rte-menu]"
58
+ );
59
+ if (e.relatedTarget && !targetInMenu) {
60
+ appStoreApi.setState({
61
+ currentRichText: null
62
+ });
63
+ } else {
64
+ e.stopPropagation();
65
+ }
66
+ },
67
+ [appStoreApi]
68
+ );
69
+ return /* @__PURE__ */ jsxs(
70
+ "div",
71
+ {
72
+ className: getClassName({
73
+ editor: !inline,
74
+ inline,
75
+ isActive,
76
+ disabled: readOnly
77
+ }),
78
+ style: inline ? {} : { height: initialHeight ?? 192, overflowY: "auto" },
79
+ onKeyDownCapture: handleHotkeyCapture,
80
+ onBlur: handleBlur,
81
+ children: [
82
+ !inline && /* @__PURE__ */ jsx("div", { className: getClassName("menu"), children: menu }),
83
+ children
84
+ ]
85
+ }
86
+ );
87
+ }
88
+ );
89
+ EditorInner.displayName = "EditorInner";
90
+
91
+ // components/RichTextMenu/index.tsx
92
+ init_react_import();
93
+ import { lazy, Suspense } from "react";
94
+ import { jsx as jsx2 } from "react/jsx-runtime";
95
+ var LoadedRichTextMenuFull = lazy(
96
+ () => import("./full-LJRK5736.mjs").then((m) => ({
97
+ default: m.LoadedRichTextMenuFull
98
+ }))
99
+ );
100
+ var LoadedRichTextMenu = (props) => {
101
+ return /* @__PURE__ */ jsx2(Suspense, { fallback: /* @__PURE__ */ jsx2(LoadedRichTextMenuInner, { ...props }), children: /* @__PURE__ */ jsx2(LoadedRichTextMenuFull, { ...props }) });
102
+ };
103
+
104
+ export {
105
+ EditorInner,
106
+ LoadedRichTextMenu
107
+ };