astro-md-editor 0.0.6 → 0.0.8

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 (53) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/assets/index-CstiJsWh.js +378 -0
  3. package/.output/public/assets/{main-DzXOjsqg.js → main-Cc9C-tdG.js} +1 -1
  4. package/.output/public/assets/styles-DCSwPMSs.css +1 -0
  5. package/.output/server/{__root-CL_tq3ov.mjs → __root-Bv3dTvZ5.mjs} +1 -1
  6. package/.output/server/_libs/@radix-ui/react-dismissable-layer+[...].mjs +210 -0
  7. package/.output/server/_libs/@radix-ui/react-use-callback-ref+[...].mjs +11 -0
  8. package/.output/server/_libs/@radix-ui/react-use-controllable-state+[...].mjs +69 -0
  9. package/.output/server/_libs/@radix-ui/react-use-effect-event+[...].mjs +1 -0
  10. package/.output/server/_libs/@radix-ui/react-use-escape-keydown+[...].mjs +17 -0
  11. package/.output/server/_libs/@radix-ui/react-use-layout-effect+[...].mjs +6 -0
  12. package/.output/server/_libs/ajv.mjs +640 -42
  13. package/.output/server/_libs/aria-hidden.mjs +122 -0
  14. package/.output/server/_libs/base-ui__react.mjs +2548 -2548
  15. package/.output/server/_libs/base-ui__utils.mjs +2 -2
  16. package/.output/server/_libs/cmdk.mjs +315 -0
  17. package/.output/server/_libs/detect-node-es.mjs +1 -0
  18. package/.output/server/_libs/get-nonce.mjs +9 -0
  19. package/.output/server/_libs/lucide-react.mjs +25 -17
  20. package/.output/server/_libs/radix-ui__primitive.mjs +11 -0
  21. package/.output/server/_libs/radix-ui__react-compose-refs.mjs +39 -0
  22. package/.output/server/_libs/radix-ui__react-context.mjs +78 -0
  23. package/.output/server/_libs/radix-ui__react-dialog.mjs +319 -0
  24. package/.output/server/_libs/radix-ui__react-focus-guards.mjs +29 -0
  25. package/.output/server/_libs/radix-ui__react-focus-scope.mjs +206 -0
  26. package/.output/server/_libs/radix-ui__react-id.mjs +14 -0
  27. package/.output/server/_libs/radix-ui__react-portal.mjs +16 -0
  28. package/.output/server/_libs/radix-ui__react-presence.mjs +128 -0
  29. package/.output/server/_libs/radix-ui__react-primitive.mjs +75 -0
  30. package/.output/server/_libs/radix-ui__react-slot.mjs +184 -0
  31. package/.output/server/_libs/react-remove-scroll-bar.mjs +82 -0
  32. package/.output/server/_libs/react-remove-scroll.mjs +328 -0
  33. package/.output/server/_libs/react-style-singleton.mjs +69 -0
  34. package/.output/server/_libs/react.mjs +2 -0
  35. package/.output/server/_libs/tslib.mjs +576 -0
  36. package/.output/server/_libs/use-callback-ref.mjs +66 -0
  37. package/.output/server/_libs/use-sidecar.mjs +106 -0
  38. package/.output/server/_ssr/{ImageAssetBrowser-DNDdTqtf.mjs → ImageAssetBrowser-DuPVChYO.mjs} +2 -2
  39. package/.output/server/_ssr/{collections.server-s12asITg.mjs → collections.server-DjgohZR7.mjs} +2 -1
  40. package/.output/server/_ssr/{file-history.api-oydnxFVV.mjs → file-history.api-JMkTXrYq.mjs} +1 -1
  41. package/.output/server/_ssr/{image-assets.server-Ci2E1_Tm.mjs → image-assets.server-2-0DgxSb.mjs} +1 -1
  42. package/.output/server/_ssr/{image-preview.api-pcN5PQhH.mjs → image-preview.api-V_Q-MBx9.mjs} +2 -2
  43. package/.output/server/_ssr/{index-BjQuGIib.mjs → index-ByW88Uz2.mjs} +3 -2
  44. package/.output/server/_ssr/{index-Bn1uKwTu.mjs → index-C6Fb3DjG.mjs} +806 -408
  45. package/.output/server/_ssr/index.mjs +15 -15
  46. package/.output/server/_ssr/{router-dPC3iVPs.mjs → router-DbnWNAi_.mjs} +2 -2
  47. package/.output/server/{_tanstack-start-manifest_v-Da8tuNDH.mjs → _tanstack-start-manifest_v-BDWWBEf1.mjs} +1 -1
  48. package/.output/server/index.mjs +46 -46
  49. package/LICENSE.md +1 -1
  50. package/package.json +2 -1
  51. package/scripts/bootstrap-collections.mjs +50 -2
  52. package/.output/public/assets/index-UQt6zCrS.js +0 -334
  53. package/.output/public/assets/styles-CezfLgHY.css +0 -1
@@ -0,0 +1,210 @@
1
+ import { r as reactExports, j as jsxRuntimeExports } from "../react.mjs";
2
+ import { c as composeEventHandlers } from "../radix-ui__primitive.mjs";
3
+ import { a as Primitive, d as dispatchDiscreteCustomEvent } from "../radix-ui__react-primitive.mjs";
4
+ import { u as useComposedRefs } from "../radix-ui__react-compose-refs.mjs";
5
+ import { u as useCallbackRef } from "./react-use-callback-ref+[...].mjs";
6
+ import { u as useEscapeKeydown } from "./react-use-escape-keydown+[...].mjs";
7
+ var DISMISSABLE_LAYER_NAME = "DismissableLayer";
8
+ var CONTEXT_UPDATE = "dismissableLayer.update";
9
+ var POINTER_DOWN_OUTSIDE = "dismissableLayer.pointerDownOutside";
10
+ var FOCUS_OUTSIDE = "dismissableLayer.focusOutside";
11
+ var originalBodyPointerEvents;
12
+ var DismissableLayerContext = reactExports.createContext({
13
+ layers: /* @__PURE__ */ new Set(),
14
+ layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
15
+ branches: /* @__PURE__ */ new Set()
16
+ });
17
+ var DismissableLayer = reactExports.forwardRef(
18
+ (props, forwardedRef) => {
19
+ const {
20
+ disableOutsidePointerEvents = false,
21
+ onEscapeKeyDown,
22
+ onPointerDownOutside,
23
+ onFocusOutside,
24
+ onInteractOutside,
25
+ onDismiss,
26
+ ...layerProps
27
+ } = props;
28
+ const context = reactExports.useContext(DismissableLayerContext);
29
+ const [node, setNode] = reactExports.useState(null);
30
+ const ownerDocument = node?.ownerDocument ?? globalThis?.document;
31
+ const [, force] = reactExports.useState({});
32
+ const composedRefs = useComposedRefs(forwardedRef, (node2) => setNode(node2));
33
+ const layers = Array.from(context.layers);
34
+ const [highestLayerWithOutsidePointerEventsDisabled] = [...context.layersWithOutsidePointerEventsDisabled].slice(-1);
35
+ const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled);
36
+ const index = node ? layers.indexOf(node) : -1;
37
+ const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0;
38
+ const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex;
39
+ const pointerDownOutside = usePointerDownOutside((event) => {
40
+ const target = event.target;
41
+ const isPointerDownOnBranch = [...context.branches].some((branch) => branch.contains(target));
42
+ if (!isPointerEventsEnabled || isPointerDownOnBranch) return;
43
+ onPointerDownOutside?.(event);
44
+ onInteractOutside?.(event);
45
+ if (!event.defaultPrevented) onDismiss?.();
46
+ }, ownerDocument);
47
+ const focusOutside = useFocusOutside((event) => {
48
+ const target = event.target;
49
+ const isFocusInBranch = [...context.branches].some((branch) => branch.contains(target));
50
+ if (isFocusInBranch) return;
51
+ onFocusOutside?.(event);
52
+ onInteractOutside?.(event);
53
+ if (!event.defaultPrevented) onDismiss?.();
54
+ }, ownerDocument);
55
+ useEscapeKeydown((event) => {
56
+ const isHighestLayer = index === context.layers.size - 1;
57
+ if (!isHighestLayer) return;
58
+ onEscapeKeyDown?.(event);
59
+ if (!event.defaultPrevented && onDismiss) {
60
+ event.preventDefault();
61
+ onDismiss();
62
+ }
63
+ }, ownerDocument);
64
+ reactExports.useEffect(() => {
65
+ if (!node) return;
66
+ if (disableOutsidePointerEvents) {
67
+ if (context.layersWithOutsidePointerEventsDisabled.size === 0) {
68
+ originalBodyPointerEvents = ownerDocument.body.style.pointerEvents;
69
+ ownerDocument.body.style.pointerEvents = "none";
70
+ }
71
+ context.layersWithOutsidePointerEventsDisabled.add(node);
72
+ }
73
+ context.layers.add(node);
74
+ dispatchUpdate();
75
+ return () => {
76
+ if (disableOutsidePointerEvents && context.layersWithOutsidePointerEventsDisabled.size === 1) {
77
+ ownerDocument.body.style.pointerEvents = originalBodyPointerEvents;
78
+ }
79
+ };
80
+ }, [node, ownerDocument, disableOutsidePointerEvents, context]);
81
+ reactExports.useEffect(() => {
82
+ return () => {
83
+ if (!node) return;
84
+ context.layers.delete(node);
85
+ context.layersWithOutsidePointerEventsDisabled.delete(node);
86
+ dispatchUpdate();
87
+ };
88
+ }, [node, context]);
89
+ reactExports.useEffect(() => {
90
+ const handleUpdate = () => force({});
91
+ document.addEventListener(CONTEXT_UPDATE, handleUpdate);
92
+ return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);
93
+ }, []);
94
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
95
+ Primitive.div,
96
+ {
97
+ ...layerProps,
98
+ ref: composedRefs,
99
+ style: {
100
+ pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? "auto" : "none" : void 0,
101
+ ...props.style
102
+ },
103
+ onFocusCapture: composeEventHandlers(props.onFocusCapture, focusOutside.onFocusCapture),
104
+ onBlurCapture: composeEventHandlers(props.onBlurCapture, focusOutside.onBlurCapture),
105
+ onPointerDownCapture: composeEventHandlers(
106
+ props.onPointerDownCapture,
107
+ pointerDownOutside.onPointerDownCapture
108
+ )
109
+ }
110
+ );
111
+ }
112
+ );
113
+ DismissableLayer.displayName = DISMISSABLE_LAYER_NAME;
114
+ var BRANCH_NAME = "DismissableLayerBranch";
115
+ var DismissableLayerBranch = reactExports.forwardRef((props, forwardedRef) => {
116
+ const context = reactExports.useContext(DismissableLayerContext);
117
+ const ref = reactExports.useRef(null);
118
+ const composedRefs = useComposedRefs(forwardedRef, ref);
119
+ reactExports.useEffect(() => {
120
+ const node = ref.current;
121
+ if (node) {
122
+ context.branches.add(node);
123
+ return () => {
124
+ context.branches.delete(node);
125
+ };
126
+ }
127
+ }, [context.branches]);
128
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Primitive.div, { ...props, ref: composedRefs });
129
+ });
130
+ DismissableLayerBranch.displayName = BRANCH_NAME;
131
+ function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis?.document) {
132
+ const handlePointerDownOutside = useCallbackRef(onPointerDownOutside);
133
+ const isPointerInsideReactTreeRef = reactExports.useRef(false);
134
+ const handleClickRef = reactExports.useRef(() => {
135
+ });
136
+ reactExports.useEffect(() => {
137
+ const handlePointerDown = (event) => {
138
+ if (event.target && !isPointerInsideReactTreeRef.current) {
139
+ let handleAndDispatchPointerDownOutsideEvent2 = function() {
140
+ handleAndDispatchCustomEvent(
141
+ POINTER_DOWN_OUTSIDE,
142
+ handlePointerDownOutside,
143
+ eventDetail,
144
+ { discrete: true }
145
+ );
146
+ };
147
+ const eventDetail = { originalEvent: event };
148
+ if (event.pointerType === "touch") {
149
+ ownerDocument.removeEventListener("click", handleClickRef.current);
150
+ handleClickRef.current = handleAndDispatchPointerDownOutsideEvent2;
151
+ ownerDocument.addEventListener("click", handleClickRef.current, { once: true });
152
+ } else {
153
+ handleAndDispatchPointerDownOutsideEvent2();
154
+ }
155
+ } else {
156
+ ownerDocument.removeEventListener("click", handleClickRef.current);
157
+ }
158
+ isPointerInsideReactTreeRef.current = false;
159
+ };
160
+ const timerId = window.setTimeout(() => {
161
+ ownerDocument.addEventListener("pointerdown", handlePointerDown);
162
+ }, 0);
163
+ return () => {
164
+ window.clearTimeout(timerId);
165
+ ownerDocument.removeEventListener("pointerdown", handlePointerDown);
166
+ ownerDocument.removeEventListener("click", handleClickRef.current);
167
+ };
168
+ }, [ownerDocument, handlePointerDownOutside]);
169
+ return {
170
+ // ensures we check React component tree (not just DOM tree)
171
+ onPointerDownCapture: () => isPointerInsideReactTreeRef.current = true
172
+ };
173
+ }
174
+ function useFocusOutside(onFocusOutside, ownerDocument = globalThis?.document) {
175
+ const handleFocusOutside = useCallbackRef(onFocusOutside);
176
+ const isFocusInsideReactTreeRef = reactExports.useRef(false);
177
+ reactExports.useEffect(() => {
178
+ const handleFocus = (event) => {
179
+ if (event.target && !isFocusInsideReactTreeRef.current) {
180
+ const eventDetail = { originalEvent: event };
181
+ handleAndDispatchCustomEvent(FOCUS_OUTSIDE, handleFocusOutside, eventDetail, {
182
+ discrete: false
183
+ });
184
+ }
185
+ };
186
+ ownerDocument.addEventListener("focusin", handleFocus);
187
+ return () => ownerDocument.removeEventListener("focusin", handleFocus);
188
+ }, [ownerDocument, handleFocusOutside]);
189
+ return {
190
+ onFocusCapture: () => isFocusInsideReactTreeRef.current = true,
191
+ onBlurCapture: () => isFocusInsideReactTreeRef.current = false
192
+ };
193
+ }
194
+ function dispatchUpdate() {
195
+ const event = new CustomEvent(CONTEXT_UPDATE);
196
+ document.dispatchEvent(event);
197
+ }
198
+ function handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {
199
+ const target = detail.originalEvent.target;
200
+ const event = new CustomEvent(name, { bubbles: false, cancelable: true, detail });
201
+ if (handler) target.addEventListener(name, handler, { once: true });
202
+ if (discrete) {
203
+ dispatchDiscreteCustomEvent(target, event);
204
+ } else {
205
+ target.dispatchEvent(event);
206
+ }
207
+ }
208
+ export {
209
+ DismissableLayer as D
210
+ };
@@ -0,0 +1,11 @@
1
+ import { r as reactExports } from "../react.mjs";
2
+ function useCallbackRef(callback) {
3
+ const callbackRef = reactExports.useRef(callback);
4
+ reactExports.useEffect(() => {
5
+ callbackRef.current = callback;
6
+ });
7
+ return reactExports.useMemo(() => (...args) => callbackRef.current?.(...args), []);
8
+ }
9
+ export {
10
+ useCallbackRef as u
11
+ };
@@ -0,0 +1,69 @@
1
+ import { r as reactExports, R as React } from "../react.mjs";
2
+ import { u as useLayoutEffect2 } from "./react-use-layout-effect+[...].mjs";
3
+ var useInsertionEffect = React[" useInsertionEffect ".trim().toString()] || useLayoutEffect2;
4
+ function useControllableState({
5
+ prop,
6
+ defaultProp,
7
+ onChange = () => {
8
+ },
9
+ caller
10
+ }) {
11
+ const [uncontrolledProp, setUncontrolledProp, onChangeRef] = useUncontrolledState({
12
+ defaultProp,
13
+ onChange
14
+ });
15
+ const isControlled = prop !== void 0;
16
+ const value = isControlled ? prop : uncontrolledProp;
17
+ {
18
+ const isControlledRef = reactExports.useRef(prop !== void 0);
19
+ reactExports.useEffect(() => {
20
+ const wasControlled = isControlledRef.current;
21
+ if (wasControlled !== isControlled) {
22
+ const from = wasControlled ? "controlled" : "uncontrolled";
23
+ const to = isControlled ? "controlled" : "uncontrolled";
24
+ console.warn(
25
+ `${caller} is changing from ${from} to ${to}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`
26
+ );
27
+ }
28
+ isControlledRef.current = isControlled;
29
+ }, [isControlled, caller]);
30
+ }
31
+ const setValue = reactExports.useCallback(
32
+ (nextValue) => {
33
+ if (isControlled) {
34
+ const value2 = isFunction(nextValue) ? nextValue(prop) : nextValue;
35
+ if (value2 !== prop) {
36
+ onChangeRef.current?.(value2);
37
+ }
38
+ } else {
39
+ setUncontrolledProp(nextValue);
40
+ }
41
+ },
42
+ [isControlled, prop, setUncontrolledProp, onChangeRef]
43
+ );
44
+ return [value, setValue];
45
+ }
46
+ function useUncontrolledState({
47
+ defaultProp,
48
+ onChange
49
+ }) {
50
+ const [value, setValue] = reactExports.useState(defaultProp);
51
+ const prevValueRef = reactExports.useRef(value);
52
+ const onChangeRef = reactExports.useRef(onChange);
53
+ useInsertionEffect(() => {
54
+ onChangeRef.current = onChange;
55
+ }, [onChange]);
56
+ reactExports.useEffect(() => {
57
+ if (prevValueRef.current !== value) {
58
+ onChangeRef.current?.(value);
59
+ prevValueRef.current = value;
60
+ }
61
+ }, [value, prevValueRef]);
62
+ return [value, setValue, onChangeRef];
63
+ }
64
+ function isFunction(value) {
65
+ return typeof value === "function";
66
+ }
67
+ export {
68
+ useControllableState as u
69
+ };
@@ -0,0 +1,17 @@
1
+ import { r as reactExports } from "../react.mjs";
2
+ import { u as useCallbackRef } from "./react-use-callback-ref+[...].mjs";
3
+ function useEscapeKeydown(onEscapeKeyDownProp, ownerDocument = globalThis?.document) {
4
+ const onEscapeKeyDown = useCallbackRef(onEscapeKeyDownProp);
5
+ reactExports.useEffect(() => {
6
+ const handleKeyDown = (event) => {
7
+ if (event.key === "Escape") {
8
+ onEscapeKeyDown(event);
9
+ }
10
+ };
11
+ ownerDocument.addEventListener("keydown", handleKeyDown, { capture: true });
12
+ return () => ownerDocument.removeEventListener("keydown", handleKeyDown, { capture: true });
13
+ }, [onEscapeKeyDown, ownerDocument]);
14
+ }
15
+ export {
16
+ useEscapeKeydown as u
17
+ };
@@ -0,0 +1,6 @@
1
+ import { r as reactExports } from "../react.mjs";
2
+ var useLayoutEffect2 = globalThis?.document ? reactExports.useLayoutEffect : () => {
3
+ };
4
+ export {
5
+ useLayoutEffect2 as u
6
+ };