docblocks-react-ui 0.0.0-stage → 0.1.1

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 (89) hide show
  1. package/CHANGELOG.md +107 -0
  2. package/LICENSE +21 -0
  3. package/README.md +592 -2
  4. package/dist/Editor-CiJY5R4v.mjs +26587 -0
  5. package/dist/Editor-DT7RkRXf.d.mts +32 -0
  6. package/dist/LoaderCircle-AGVFE4IP.mjs +19 -0
  7. package/dist/Skeleton-D922Ths5.mjs +13 -0
  8. package/dist/constants-D4FTL0ph.mjs +81 -0
  9. package/dist/fonts/OFL.txt +162 -0
  10. package/dist/fonts/inter-300-c.woff2 +0 -0
  11. package/dist/fonts/inter-300-l.woff2 +0 -0
  12. package/dist/fonts/inter-300i-c.woff2 +0 -0
  13. package/dist/fonts/inter-300i-l.woff2 +0 -0
  14. package/dist/fonts/inter-400-c.woff2 +0 -0
  15. package/dist/fonts/inter-400-l.woff2 +0 -0
  16. package/dist/fonts/inter-400i-c.woff2 +0 -0
  17. package/dist/fonts/inter-400i-l.woff2 +0 -0
  18. package/dist/fonts/inter-600-c.woff2 +0 -0
  19. package/dist/fonts/inter-600-l.woff2 +0 -0
  20. package/dist/fonts/inter-600i-c.woff2 +0 -0
  21. package/dist/fonts/inter-600i-l.woff2 +0 -0
  22. package/dist/fonts/jetbrains-mono-300-c.woff2 +0 -0
  23. package/dist/fonts/jetbrains-mono-300-l.woff2 +0 -0
  24. package/dist/fonts/jetbrains-mono-300i-c.woff2 +0 -0
  25. package/dist/fonts/jetbrains-mono-300i-l.woff2 +0 -0
  26. package/dist/fonts/jetbrains-mono-400-c.woff2 +0 -0
  27. package/dist/fonts/jetbrains-mono-400-l.woff2 +0 -0
  28. package/dist/fonts/jetbrains-mono-400i-c.woff2 +0 -0
  29. package/dist/fonts/jetbrains-mono-400i-l.woff2 +0 -0
  30. package/dist/fonts/jetbrains-mono-600-c.woff2 +0 -0
  31. package/dist/fonts/jetbrains-mono-600-l.woff2 +0 -0
  32. package/dist/fonts/jetbrains-mono-600i-c.woff2 +0 -0
  33. package/dist/fonts/jetbrains-mono-600i-l.woff2 +0 -0
  34. package/dist/fonts/lora-400-c.woff2 +0 -0
  35. package/dist/fonts/lora-400-l.woff2 +0 -0
  36. package/dist/fonts/lora-400i-c.woff2 +0 -0
  37. package/dist/fonts/lora-400i-l.woff2 +0 -0
  38. package/dist/fonts/lora-600-c.woff2 +0 -0
  39. package/dist/fonts/lora-600-l.woff2 +0 -0
  40. package/dist/fonts/lora-600i-c.woff2 +0 -0
  41. package/dist/fonts/lora-600i-l.woff2 +0 -0
  42. package/dist/fonts/lora-700-c.woff2 +0 -0
  43. package/dist/fonts/lora-700-l.woff2 +0 -0
  44. package/dist/fonts/lora-700i-c.woff2 +0 -0
  45. package/dist/fonts/lora-700i-l.woff2 +0 -0
  46. package/dist/fonts/open-sans-300-c.woff2 +0 -0
  47. package/dist/fonts/open-sans-300-l.woff2 +0 -0
  48. package/dist/fonts/open-sans-300i-c.woff2 +0 -0
  49. package/dist/fonts/open-sans-300i-l.woff2 +0 -0
  50. package/dist/fonts/open-sans-400-c.woff2 +0 -0
  51. package/dist/fonts/open-sans-400-l.woff2 +0 -0
  52. package/dist/fonts/open-sans-400i-c.woff2 +0 -0
  53. package/dist/fonts/open-sans-400i-l.woff2 +0 -0
  54. package/dist/fonts/open-sans-600-c.woff2 +0 -0
  55. package/dist/fonts/open-sans-600-l.woff2 +0 -0
  56. package/dist/fonts/open-sans-600i-c.woff2 +0 -0
  57. package/dist/fonts/open-sans-600i-l.woff2 +0 -0
  58. package/dist/fonts/pt-sans-400-c.woff2 +0 -0
  59. package/dist/fonts/pt-sans-400-l.woff2 +0 -0
  60. package/dist/fonts/pt-sans-400i-c.woff2 +0 -0
  61. package/dist/fonts/pt-sans-400i-l.woff2 +0 -0
  62. package/dist/fonts/pt-sans-700-c.woff2 +0 -0
  63. package/dist/fonts/pt-sans-700-l.woff2 +0 -0
  64. package/dist/fonts/pt-sans-700i-c.woff2 +0 -0
  65. package/dist/fonts/pt-sans-700i-l.woff2 +0 -0
  66. package/dist/fonts/pt-serif-400-c.woff2 +0 -0
  67. package/dist/fonts/pt-serif-400-l.woff2 +0 -0
  68. package/dist/fonts/pt-serif-400i-c.woff2 +0 -0
  69. package/dist/fonts/pt-serif-400i-l.woff2 +0 -0
  70. package/dist/fonts/pt-serif-700-c.woff2 +0 -0
  71. package/dist/fonts/pt-serif-700-l.woff2 +0 -0
  72. package/dist/fonts/pt-serif-700i-c.woff2 +0 -0
  73. package/dist/fonts/pt-serif-700i-l.woff2 +0 -0
  74. package/dist/index-D6_ysSmQ.d.mts +1075 -0
  75. package/dist/index-YJcgf8Hh.d.mts +39 -0
  76. package/dist/index.d.mts +388 -0
  77. package/dist/index.mjs +641 -0
  78. package/dist/mermaid/index.d.mts +10 -0
  79. package/dist/mermaid/index.mjs +252 -0
  80. package/dist/motion/index.d.mts +8 -0
  81. package/dist/motion/index.mjs +1009 -0
  82. package/dist/pdf/index.d.mts +5 -0
  83. package/dist/pdf/index.mjs +164 -0
  84. package/dist/pdf/jbig2.wasm +0 -0
  85. package/dist/pdf/jbig2_nowasm_fallback.js +15 -0
  86. package/dist/pdf/pdf.worker.min.mjs +28 -0
  87. package/dist/styles.css +4562 -0
  88. package/package.json +99 -4
  89. package/theme.css +128 -0
@@ -0,0 +1,32 @@
1
+ //#region src/Editor.d.ts
2
+ /**
3
+ * The document's view mode: the page flow (the root's children in reading
4
+ * order) or the canvas (the page as a miniature rectangle plus the surface
5
+ * elements on one canvas). View state — switching writes nothing to the
6
+ * data (like the selection).
7
+ */
8
+ type EditorView = "page" | "canvas";
9
+ interface EditorProps {
10
+ view?: EditorView;
11
+ /** The format toolbar's color palette (the default six colors). */
12
+ formatPalette?: readonly string[];
13
+ }
14
+ /**
15
+ * Renders the document's entry list in reading order (the document root's
16
+ * children, or a single subtree block when the provider got a
17
+ * `rootBlockId`). The root is the editor's focus/keyboard scope: the
18
+ * undo/redo hotkeys only fire for keys targeted inside it. The root block
19
+ * context is provided for every entry: the entry list's siblings, and the
20
+ * entry root's sequence container as the gestures' command parent (a
21
+ * subtree entry root is a page block — structurally childless, so its
22
+ * commands target the container of its sequence, not itself).
23
+ *
24
+ * The `view` prop selects the rendering: "page" (default) is the entry
25
+ * list; "canvas" renders the document's page as a page miniature and the
26
+ * root-level surfaces' elements on one canvas (see CanvasView). The
27
+ * `formatPalette` prop overrides the floating format toolbar's color
28
+ * palette.
29
+ */
30
+ declare function Editor({ view, formatPalette }: EditorProps): import("react").JSX.Element;
31
+ //#endregion
32
+ export { EditorView as n, Editor as t };
@@ -0,0 +1,19 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ //#region src/shared/ui/icons/LoaderCircle.tsx
3
+ function LoaderCircle(props) {
4
+ return /* @__PURE__ */ jsx("svg", {
5
+ xmlns: "http://www.w3.org/2000/svg",
6
+ width: 24,
7
+ height: 24,
8
+ viewBox: "0 0 24 24",
9
+ fill: "none",
10
+ stroke: "currentColor",
11
+ strokeWidth: 2,
12
+ strokeLinecap: "round",
13
+ strokeLinejoin: "round",
14
+ ...props,
15
+ children: /* @__PURE__ */ jsx("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" })
16
+ });
17
+ }
18
+ //#endregion
19
+ export { LoaderCircle as t };
@@ -0,0 +1,13 @@
1
+ import { c as cn } from "./constants-D4FTL0ph.mjs";
2
+ import "react";
3
+ import { jsx } from "react/jsx-runtime";
4
+ //#region src/shared/ui/Skeleton.tsx
5
+ function Skeleton({ className, ...props }) {
6
+ return /* @__PURE__ */ jsx("div", {
7
+ "data-slot": "skeleton",
8
+ className: cn("animate-pulse rounded-md bg-gray-300 dark:bg-gray-700", className),
9
+ ...props
10
+ });
11
+ }
12
+ //#endregion
13
+ export { Skeleton as t };
@@ -0,0 +1,81 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { clsx } from "clsx";
3
+ import { twMerge } from "tailwind-merge";
4
+ //#region src/shared/ui/cn.ts
5
+ function cn(...inputs) {
6
+ return twMerge(clsx(inputs));
7
+ }
8
+ //#endregion
9
+ //#region src/shared/utils.ts
10
+ /** Clamps a value into the inclusive [min, max] range. */
11
+ function clamp(value, min, max) {
12
+ return Math.min(max, Math.max(min, value));
13
+ }
14
+ /** The DOM event's default-cancelling handler (the chrome's press stand). */
15
+ function preventDefault(event) {
16
+ event.preventDefault();
17
+ }
18
+ /** The DOM event's propagation-stopping handler (the inner chrome's press
19
+ * stands over the outer gesture). */
20
+ function stopPropagation(event) {
21
+ event.stopPropagation();
22
+ }
23
+ /** The executable schemes a download href must not carry (a `javascript:` / `vbscript:` href runs on the click — the `download` attribute does not neutralize it). */
24
+ const UNSAFE_DOWNLOAD_SCHEME = /^[\u0000-\u0020]*(javascript|vbscript)\s*:/i;
25
+ /**
26
+ * The download href gate (the defense in depth over the consumer's BlobStore
27
+ * url): the executable schemes stand no anchor; the `data:` / the `blob:` / the
28
+ * http(s) urls stand (the default store's data urls, the consumer's CDN).
29
+ * The browser's leading-control trim is undone before the scheme check (the
30
+ * link href's stand).
31
+ */
32
+ function isSafeDownloadHref(url) {
33
+ return typeof url === "string" && !UNSAFE_DOWNLOAD_SCHEME.test(url);
34
+ }
35
+ /**
36
+ * The exhaustiveness check for a `switch` over a closed union: `value` is
37
+ * typed `never`, so once every member has a `case` the compiler narrows it
38
+ * to `never` in the `default` and the call type-checks; a member without a
39
+ * `case` fails the build. The throw is the runtime backstop for a value that
40
+ * slipped past the types.
41
+ */
42
+ function assertNever(value) {
43
+ throw new Error(`Unhandled value: ${String(value)}`);
44
+ }
45
+ //#endregion
46
+ //#region src/shared/ui/icons/TriangleAlert.tsx
47
+ function TriangleAlert(props) {
48
+ return /* @__PURE__ */ jsxs("svg", {
49
+ xmlns: "http://www.w3.org/2000/svg",
50
+ width: 24,
51
+ height: 24,
52
+ viewBox: "0 0 24 24",
53
+ fill: "none",
54
+ stroke: "currentColor",
55
+ strokeWidth: 2,
56
+ strokeLinecap: "round",
57
+ strokeLinejoin: "round",
58
+ ...props,
59
+ children: [
60
+ /* @__PURE__ */ jsx("path", { d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3" }),
61
+ /* @__PURE__ */ jsx("path", { d: "M12 9v4" }),
62
+ /* @__PURE__ */ jsx("path", { d: "M12 17h.01" })
63
+ ]
64
+ });
65
+ }
66
+ //#endregion
67
+ //#region src/pdf/constants.ts
68
+ /** The iframe's embeddable-url gate: only the http(s) scheme may stand the
69
+ * viewer's iframe. The data / blob / javascript schemes (and the
70
+ * unparseable url) stand the download-only fallback — the consumer's
71
+ * document bytes are never executed in the frame's context. */
72
+ function isEmbeddablePdfUrl(url) {
73
+ try {
74
+ const scheme = new URL(url).protocol;
75
+ return scheme === "http:" || scheme === "https:";
76
+ } catch {
77
+ return false;
78
+ }
79
+ }
80
+ //#endregion
81
+ export { isSafeDownloadHref as a, cn as c, clamp as i, TriangleAlert as n, preventDefault as o, assertNever as r, stopPropagation as s, isEmbeddablePdfUrl as t };
@@ -0,0 +1,162 @@
1
+ The following font families are bundled in this package and are each
2
+ licensed under the SIL Open Font License, Version 1.1 (the full license
3
+ text is reproduced below):
4
+
5
+ Inter Copyright 2021 The Inter Project Authors
6
+ (https://github.com/rsms/inter)
7
+ JetBrains Mono Copyright 2020 The JetBrains Mono Project Authors
8
+ (https://github.com/JetBrains/JetBrainsMono)
9
+ Lora Copyright 2011 The Lora Project Authors
10
+ (https://github.com/cyrealtype/Lora)
11
+ Open Sans Copyright 2010 The Open Sans Project Authors
12
+ (https://github.com/googlefonts/opensans)
13
+ PT Sans Copyright 2009 ParaType Ltd. (http://www.paratype.com)
14
+ PT Serif Copyright 2010 ParaType Ltd. (http://www.paratype.com)
15
+
16
+ This Font Software is licensed under the SIL Open Font License, Version 1.1.
17
+
18
+ This license is copied below, and is also available with a FAQ at:
19
+
20
+ https://openfontlicense.org
21
+
22
+ -----------------------------------------------------------
23
+
24
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
25
+
26
+ -----------------------------------------------------------
27
+
28
+ PREAMBLE
29
+
30
+ The goals of the Open Font License (OFL) are to stimulate worldwide
31
+
32
+ development of collaborative font projects, to support the font creation
33
+
34
+ efforts of academic and linguistic communities, and to provide a free and
35
+
36
+ open framework in which fonts may be shared and improved in partnership
37
+
38
+ with others.
39
+
40
+ The OFL allows the licensed fonts to be used, studied, modified and
41
+
42
+ redistributed freely as long as they are not sold by themselves. The
43
+
44
+ fonts, including any derivative works, can be bundled, embedded,
45
+
46
+ redistributed and/or sold with any software provided that any reserved
47
+
48
+ names are not used by derivative works. The fonts and derivatives,
49
+
50
+ however, cannot be released under any other type of license. The
51
+
52
+ requirement for fonts to remain under this license does not apply
53
+
54
+ to any document created using the fonts or their derivatives.
55
+
56
+ DEFINITIONS
57
+
58
+ "Font Software" refers to the set of files released by the Copyright
59
+
60
+ Holder(s) under this license and clearly marked as such. This may
61
+
62
+ include source files, build scripts and documentation.
63
+
64
+ "Reserved Font Name" refers to any names specified as such after the
65
+
66
+ copyright statement(s).
67
+
68
+ "Original Version" refers to the collection of Font Software components as
69
+
70
+ distributed by the Copyright Holder(s).
71
+
72
+ "Modified Version" refers to any derivative made by adding to, deleting,
73
+
74
+ or substituting -- in part or in whole -- any of the components of the
75
+
76
+ Original Version, by changing formats or by porting the Font Software to a
77
+
78
+ new environment.
79
+
80
+ "Author" refers to any designer, engineer, programmer, technical
81
+
82
+ writer or other person who contributed to the Font Software.
83
+
84
+ PERMISSION & CONDITIONS
85
+
86
+ Permission is hereby granted, free of charge, to any person obtaining
87
+
88
+ a copy of the Font Software, to use, study, copy, merge, embed, modify,
89
+
90
+ redistribute, and sell modified and unmodified copies of the Font
91
+
92
+ Software, subject to the following conditions:
93
+
94
+ 1) Neither the Font Software nor any of its individual components,
95
+
96
+ in Original or Modified Versions, may be sold by itself.
97
+
98
+ 2) Original or Modified Versions of the Font Software may be bundled,
99
+
100
+ redistributed and/or sold with any software, provided that each copy
101
+
102
+ contains the above copyright notice and this license. These can be
103
+
104
+ included either as stand-alone text files, human-readable headers or
105
+
106
+ in the appropriate machine-readable metadata fields within text or
107
+
108
+ binary files as long as those fields can be easily viewed by the user.
109
+
110
+ 3) No Modified Version of the Font Software may use the Reserved Font
111
+
112
+ Name(s) unless explicit written permission is granted by the corresponding
113
+
114
+ Copyright Holder. This restriction only applies to the primary font name as
115
+
116
+ presented to the users.
117
+
118
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
119
+
120
+ Software shall not be used to promote, endorse or advertise any
121
+
122
+ Modified Version, except to acknowledge the contribution(s) of the
123
+
124
+ Copyright Holder(s) and the Author(s) or with their explicit written
125
+
126
+ permission.
127
+
128
+ 5) The Font Software, modified or unmodified, in part or in whole,
129
+
130
+ must be distributed entirely under this license, and must not be
131
+
132
+ distributed under any other license. The requirement for fonts to
133
+
134
+ remain under this license does not apply to any document created
135
+
136
+ using the Font Software.
137
+
138
+ TERMINATION
139
+
140
+ This license becomes null and void if any of the above conditions are
141
+
142
+ not met.
143
+
144
+ DISCLAIMER
145
+
146
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
147
+
148
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
149
+
150
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
151
+
152
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
153
+
154
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
155
+
156
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
157
+
158
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
159
+
160
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
161
+
162
+ OTHER DEALINGS IN THE FONT SOFTWARE.
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file