@blogmcp/mdx-render-vue 0.1.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 (249) hide show
  1. package/dist/_virtual/_plugin-vue_export-helper.js +10 -0
  2. package/dist/_virtual/constants.js +4 -0
  3. package/dist/_virtual/index.js +5 -0
  4. package/dist/_virtual/index2.js +4 -0
  5. package/dist/composables/index.d.ts +11 -0
  6. package/dist/composables/index.js +24 -0
  7. package/dist/composables/useAudioPlayer.d.ts +22 -0
  8. package/dist/composables/useAudioPlayer.js +58 -0
  9. package/dist/composables/useCallout.d.ts +43 -0
  10. package/dist/composables/useCallout.js +71 -0
  11. package/dist/composables/useCodeBlock.d.ts +23 -0
  12. package/dist/composables/useCodeBlock.js +67 -0
  13. package/dist/composables/useGallery.d.ts +37 -0
  14. package/dist/composables/useGallery.js +84 -0
  15. package/dist/composables/useMedia.d.ts +18 -0
  16. package/dist/composables/useMedia.js +9 -0
  17. package/dist/composables/useYouTube.d.ts +31 -0
  18. package/dist/composables/useYouTube.js +32 -0
  19. package/dist/edit/AlertEdit.vue.d.ts +12 -0
  20. package/dist/edit/AlertEdit.vue.js +4 -0
  21. package/dist/edit/AlertEdit.vue2.js +18 -0
  22. package/dist/edit/AudioPlayerEdit.vue.d.ts +3 -0
  23. package/dist/edit/AudioPlayerEdit.vue.js +117 -0
  24. package/dist/edit/AudioPlayerEdit.vue2.js +4 -0
  25. package/dist/edit/BadgeEdit.vue.d.ts +2 -0
  26. package/dist/edit/BadgeEdit.vue.js +4 -0
  27. package/dist/edit/BadgeEdit.vue2.js +13 -0
  28. package/dist/edit/ButtonEdit.vue.d.ts +2 -0
  29. package/dist/edit/ButtonEdit.vue.js +4 -0
  30. package/dist/edit/ButtonEdit.vue2.js +13 -0
  31. package/dist/edit/CalloutEdit.vue.d.ts +13 -0
  32. package/dist/edit/CalloutEdit.vue.js +85 -0
  33. package/dist/edit/CalloutEdit.vue2.js +4 -0
  34. package/dist/edit/CardEdit.vue.d.ts +12 -0
  35. package/dist/edit/CardEdit.vue.js +4 -0
  36. package/dist/edit/CardEdit.vue2.js +18 -0
  37. package/dist/edit/CodeBlockEdit.vue.d.ts +12 -0
  38. package/dist/edit/CodeBlockEdit.vue.js +7 -0
  39. package/dist/edit/CodeBlockEdit.vue2.js +89 -0
  40. package/dist/edit/GalleryEdit.vue.d.ts +3 -0
  41. package/dist/edit/GalleryEdit.vue.js +64 -0
  42. package/dist/edit/GalleryEdit.vue2.js +4 -0
  43. package/dist/edit/IconEdit.vue.d.ts +2 -0
  44. package/dist/edit/IconEdit.vue.js +4 -0
  45. package/dist/edit/IconEdit.vue2.js +13 -0
  46. package/dist/edit/TooltipEdit.vue.d.ts +16 -0
  47. package/dist/edit/TooltipEdit.vue.js +4 -0
  48. package/dist/edit/TooltipEdit.vue2.js +24 -0
  49. package/dist/edit/YouTubeEdit.vue.d.ts +3 -0
  50. package/dist/edit/YouTubeEdit.vue.js +41 -0
  51. package/dist/edit/YouTubeEdit.vue2.js +4 -0
  52. package/dist/edit/index.d.ts +29 -0
  53. package/dist/edit/index.js +35 -0
  54. package/dist/index.d.ts +12 -0
  55. package/dist/index.js +75 -0
  56. package/dist/mdx-render-vue.css +31 -0
  57. package/dist/node_modules/@ark-ui/vue/dist/_virtual/_rolldown/runtime.js +13 -0
  58. package/dist/node_modules/@ark-ui/vue/dist/components/factory.js +35 -0
  59. package/dist/node_modules/@ark-ui/vue/dist/components/presence/use-presence-context.js +6 -0
  60. package/dist/node_modules/@ark-ui/vue/dist/components/presence/use-presence.js +40 -0
  61. package/dist/node_modules/@ark-ui/vue/dist/components/tooltip/tooltip-arrow-tip.js +5 -0
  62. package/dist/node_modules/@ark-ui/vue/dist/components/tooltip/tooltip-arrow-tip.vue_vue_type_script_setup_true_lang.js +21 -0
  63. package/dist/node_modules/@ark-ui/vue/dist/components/tooltip/tooltip-arrow.js +5 -0
  64. package/dist/node_modules/@ark-ui/vue/dist/components/tooltip/tooltip-arrow.vue_vue_type_script_setup_true_lang.js +21 -0
  65. package/dist/node_modules/@ark-ui/vue/dist/components/tooltip/tooltip-content.js +5 -0
  66. package/dist/node_modules/@ark-ui/vue/dist/components/tooltip/tooltip-content.vue_vue_type_script_setup_true_lang.js +25 -0
  67. package/dist/node_modules/@ark-ui/vue/dist/components/tooltip/tooltip-context.js +5 -0
  68. package/dist/node_modules/@ark-ui/vue/dist/components/tooltip/tooltip-context.vue_vue_type_script_setup_true_lang.js +14 -0
  69. package/dist/node_modules/@ark-ui/vue/dist/components/tooltip/tooltip-positioner.js +5 -0
  70. package/dist/node_modules/@ark-ui/vue/dist/components/tooltip/tooltip-positioner.vue_vue_type_script_setup_true_lang.js +23 -0
  71. package/dist/node_modules/@ark-ui/vue/dist/components/tooltip/tooltip-root-provider.js +5 -0
  72. package/dist/node_modules/@ark-ui/vue/dist/components/tooltip/tooltip-root-provider.vue_vue_type_script_setup_true_lang.js +38 -0
  73. package/dist/node_modules/@ark-ui/vue/dist/components/tooltip/tooltip-root.js +5 -0
  74. package/dist/node_modules/@ark-ui/vue/dist/components/tooltip/tooltip-root.vue_vue_type_script_setup_true_lang.js +68 -0
  75. package/dist/node_modules/@ark-ui/vue/dist/components/tooltip/tooltip-trigger.js +5 -0
  76. package/dist/node_modules/@ark-ui/vue/dist/components/tooltip/tooltip-trigger.vue_vue_type_script_setup_true_lang.js +25 -0
  77. package/dist/node_modules/@ark-ui/vue/dist/components/tooltip/tooltip.js +22 -0
  78. package/dist/node_modules/@ark-ui/vue/dist/components/tooltip/use-tooltip-context.js +6 -0
  79. package/dist/node_modules/@ark-ui/vue/dist/components/tooltip/use-tooltip.js +36 -0
  80. package/dist/node_modules/@ark-ui/vue/dist/providers/environment/use-environment-context.js +13 -0
  81. package/dist/node_modules/@ark-ui/vue/dist/providers/locale/use-locale-context.js +12 -0
  82. package/dist/node_modules/@ark-ui/vue/dist/utils/clean-props.js +8 -0
  83. package/dist/node_modules/@ark-ui/vue/dist/utils/create-context.js +14 -0
  84. package/dist/node_modules/@ark-ui/vue/dist/utils/dynamic.js +34 -0
  85. package/dist/node_modules/@ark-ui/vue/dist/utils/unref-element.js +8 -0
  86. package/dist/node_modules/@ark-ui/vue/dist/utils/use-forward-expose.js +46 -0
  87. package/dist/node_modules/@ark-ui/vue/dist/utils/use-render-strategy.js +5 -0
  88. package/dist/node_modules/@braintree/sanitize-url/dist/constants.js +20 -0
  89. package/dist/node_modules/@braintree/sanitize-url/dist/index.js +75 -0
  90. package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +728 -0
  91. package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +629 -0
  92. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +176 -0
  93. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +151 -0
  94. package/dist/node_modules/@iconify/vue/dist/iconify.js +1691 -0
  95. package/dist/node_modules/@zag-js/anatomy/dist/create-anatomy.js +29 -0
  96. package/dist/node_modules/@zag-js/core/dist/create-machine.js +28 -0
  97. package/dist/node_modules/@zag-js/core/dist/merge-props.js +55 -0
  98. package/dist/node_modules/@zag-js/core/dist/scope.js +20 -0
  99. package/dist/node_modules/@zag-js/core/dist/state.js +176 -0
  100. package/dist/node_modules/@zag-js/core/dist/types.js +11 -0
  101. package/dist/node_modules/@zag-js/dom-query/dist/chunk-QZ7TP4HQ.js +6 -0
  102. package/dist/node_modules/@zag-js/dom-query/dist/computed-style.js +11 -0
  103. package/dist/node_modules/@zag-js/dom-query/dist/event.js +37 -0
  104. package/dist/node_modules/@zag-js/dom-query/dist/node.js +64 -0
  105. package/dist/node_modules/@zag-js/dom-query/dist/overflow.js +28 -0
  106. package/dist/node_modules/@zag-js/dom-query/dist/platform.js +23 -0
  107. package/dist/node_modules/@zag-js/dom-query/dist/query.js +6 -0
  108. package/dist/node_modules/@zag-js/dom-query/dist/raf.js +52 -0
  109. package/dist/node_modules/@zag-js/dom-query/dist/set.js +22 -0
  110. package/dist/node_modules/@zag-js/dom-query/dist/shared.js +8 -0
  111. package/dist/node_modules/@zag-js/focus-visible/dist/index.js +159 -0
  112. package/dist/node_modules/@zag-js/popper/dist/get-anchor.js +39 -0
  113. package/dist/node_modules/@zag-js/popper/dist/get-placement.js +296 -0
  114. package/dist/node_modules/@zag-js/popper/dist/get-styles.js +47 -0
  115. package/dist/node_modules/@zag-js/popper/dist/middleware.js +79 -0
  116. package/dist/node_modules/@zag-js/popper/dist/placement.js +7 -0
  117. package/dist/node_modules/@zag-js/presence/dist/presence.connect.js +18 -0
  118. package/dist/node_modules/@zag-js/presence/dist/presence.machine.js +175 -0
  119. package/dist/node_modules/@zag-js/tooltip/dist/tooltip.anatomy.js +7 -0
  120. package/dist/node_modules/@zag-js/tooltip/dist/tooltip.connect.js +155 -0
  121. package/dist/node_modules/@zag-js/tooltip/dist/tooltip.dom.js +24 -0
  122. package/dist/node_modules/@zag-js/tooltip/dist/tooltip.machine.js +416 -0
  123. package/dist/node_modules/@zag-js/tooltip/dist/tooltip.store.js +9 -0
  124. package/dist/node_modules/@zag-js/types/dist/prop-types.js +14 -0
  125. package/dist/node_modules/@zag-js/utils/dist/array.js +7 -0
  126. package/dist/node_modules/@zag-js/utils/dist/equal.js +36 -0
  127. package/dist/node_modules/@zag-js/utils/dist/functions.js +11 -0
  128. package/dist/node_modules/@zag-js/utils/dist/guard.js +26 -0
  129. package/dist/node_modules/@zag-js/utils/dist/object.js +16 -0
  130. package/dist/node_modules/@zag-js/utils/dist/store.js +44 -0
  131. package/dist/node_modules/@zag-js/utils/dist/warning.js +31 -0
  132. package/dist/node_modules/@zag-js/vue/dist/bindable.js +48 -0
  133. package/dist/node_modules/@zag-js/vue/dist/machine.js +258 -0
  134. package/dist/node_modules/@zag-js/vue/dist/normalize-props.js +42 -0
  135. package/dist/node_modules/@zag-js/vue/dist/refs.js +14 -0
  136. package/dist/node_modules/@zag-js/vue/dist/track.js +22 -0
  137. package/dist/node_modules/dompurify/dist/purify.es.js +1190 -0
  138. package/dist/registry.d.ts +76 -0
  139. package/dist/registry.js +164 -0
  140. package/dist/render/alert/Alert.vue.d.ts +18 -0
  141. package/dist/render/alert/Alert.vue.js +4 -0
  142. package/dist/render/alert/Alert.vue2.js +43 -0
  143. package/dist/render/alert/index.d.ts +2 -0
  144. package/dist/render/audioplayer/AudioPlayerDefault.vue.d.ts +3 -0
  145. package/dist/render/audioplayer/AudioPlayerDefault.vue.js +116 -0
  146. package/dist/render/audioplayer/AudioPlayerDefault.vue2.js +4 -0
  147. package/dist/render/audioplayer/index.d.ts +5 -0
  148. package/dist/render/audioplayer/index.js +5 -0
  149. package/dist/render/badge/Badge.vue.d.ts +10 -0
  150. package/dist/render/badge/Badge.vue.js +4 -0
  151. package/dist/render/badge/Badge.vue2.js +28 -0
  152. package/dist/render/badge/index.d.ts +2 -0
  153. package/dist/render/button/Button.vue.d.ts +13 -0
  154. package/dist/render/button/Button.vue.js +4 -0
  155. package/dist/render/button/Button.vue2.js +42 -0
  156. package/dist/render/button/index.d.ts +2 -0
  157. package/dist/render/callout/CalloutDefault.vue.d.ts +13 -0
  158. package/dist/render/callout/CalloutDefault.vue.js +86 -0
  159. package/dist/render/callout/CalloutDefault.vue2.js +4 -0
  160. package/dist/render/callout/CalloutMinimal.vue.d.ts +13 -0
  161. package/dist/render/callout/CalloutMinimal.vue.js +27 -0
  162. package/dist/render/callout/CalloutMinimal.vue2.js +4 -0
  163. package/dist/render/callout/index.d.ts +6 -0
  164. package/dist/render/callout/index.js +7 -0
  165. package/dist/render/card/Card.vue.d.ts +15 -0
  166. package/dist/render/card/Card.vue.js +4 -0
  167. package/dist/render/card/Card.vue2.js +29 -0
  168. package/dist/render/card/index.d.ts +2 -0
  169. package/dist/render/codeblock/CodeBlockDefault.vue.d.ts +12 -0
  170. package/dist/render/codeblock/CodeBlockDefault.vue.js +7 -0
  171. package/dist/render/codeblock/CodeBlockDefault.vue2.js +92 -0
  172. package/dist/render/codeblock/index.d.ts +5 -0
  173. package/dist/render/codeblock/index.js +5 -0
  174. package/dist/render/gallery/GalleryGrid.vue.d.ts +3 -0
  175. package/dist/render/gallery/GalleryGrid.vue.js +125 -0
  176. package/dist/render/gallery/GalleryGrid.vue2.js +4 -0
  177. package/dist/render/gallery/GalleryLightbox.vue.d.ts +16 -0
  178. package/dist/render/gallery/GalleryLightbox.vue.js +7 -0
  179. package/dist/render/gallery/GalleryLightbox.vue2.js +170 -0
  180. package/dist/render/gallery/index.d.ts +6 -0
  181. package/dist/render/gallery/index.js +7 -0
  182. package/dist/render/icon/Icon.vue.d.ts +9 -0
  183. package/dist/render/icon/Icon.vue.js +4 -0
  184. package/dist/render/icon/Icon.vue2.js +25 -0
  185. package/dist/render/icon/index.d.ts +2 -0
  186. package/dist/render/index.d.ts +40 -0
  187. package/dist/render/index.js +63 -0
  188. package/dist/render/tooltip/Tooltip.vue.d.ts +18 -0
  189. package/dist/render/tooltip/Tooltip.vue.js +4 -0
  190. package/dist/render/tooltip/Tooltip.vue2.js +58 -0
  191. package/dist/render/tooltip/index.d.ts +2 -0
  192. package/dist/render/youtube/YouTubeDefault.vue.d.ts +3 -0
  193. package/dist/render/youtube/YouTubeDefault.vue.js +79 -0
  194. package/dist/render/youtube/YouTubeDefault.vue2.js +4 -0
  195. package/dist/render/youtube/index.d.ts +5 -0
  196. package/dist/render/youtube/index.js +5 -0
  197. package/dist/useAudioPlayer.d.ts +22 -0
  198. package/dist/useCallout.d.ts +46 -0
  199. package/dist/useCodeBlock.d.ts +25 -0
  200. package/dist/useGallery.d.ts +44 -0
  201. package/dist/useMedia.d.ts +16 -0
  202. package/dist/useYouTube.d.ts +32 -0
  203. package/package.json +125 -0
  204. package/src/composables/index.ts +16 -0
  205. package/src/composables/useAudioPlayer.ts +84 -0
  206. package/src/composables/useCallout.ts +103 -0
  207. package/src/composables/useCodeBlock.ts +90 -0
  208. package/src/composables/useGallery.ts +143 -0
  209. package/src/composables/useMedia.ts +23 -0
  210. package/src/composables/useYouTube.ts +58 -0
  211. package/src/edit/AlertEdit.vue +9 -0
  212. package/src/edit/AudioPlayerEdit.vue +92 -0
  213. package/src/edit/BadgeEdit.vue +7 -0
  214. package/src/edit/ButtonEdit.vue +10 -0
  215. package/src/edit/CalloutEdit.vue +107 -0
  216. package/src/edit/CardEdit.vue +9 -0
  217. package/src/edit/CodeBlockEdit.vue +76 -0
  218. package/src/edit/GalleryEdit.vue +65 -0
  219. package/src/edit/IconEdit.vue +7 -0
  220. package/src/edit/TooltipEdit.vue +15 -0
  221. package/src/edit/YouTubeEdit.vue +33 -0
  222. package/src/edit/index.ts +32 -0
  223. package/src/index.ts +62 -0
  224. package/src/registry.ts +272 -0
  225. package/src/render/alert/Alert.vue +32 -0
  226. package/src/render/alert/index.ts +2 -0
  227. package/src/render/audioplayer/AudioPlayerDefault.vue +89 -0
  228. package/src/render/audioplayer/index.ts +8 -0
  229. package/src/render/badge/Badge.vue +25 -0
  230. package/src/render/badge/index.ts +2 -0
  231. package/src/render/button/Button.vue +41 -0
  232. package/src/render/button/index.ts +2 -0
  233. package/src/render/callout/CalloutDefault.vue +101 -0
  234. package/src/render/callout/CalloutMinimal.vue +31 -0
  235. package/src/render/callout/index.ts +9 -0
  236. package/src/render/card/Card.vue +15 -0
  237. package/src/render/card/index.ts +2 -0
  238. package/src/render/codeblock/CodeBlockDefault.vue +76 -0
  239. package/src/render/codeblock/index.ts +8 -0
  240. package/src/render/gallery/GalleryGrid.vue +162 -0
  241. package/src/render/gallery/GalleryLightbox.vue +162 -0
  242. package/src/render/gallery/index.ts +9 -0
  243. package/src/render/icon/Icon.vue +22 -0
  244. package/src/render/icon/index.ts +2 -0
  245. package/src/render/index.ts +76 -0
  246. package/src/render/tooltip/Tooltip.vue +35 -0
  247. package/src/render/tooltip/index.ts +2 -0
  248. package/src/render/youtube/YouTubeDefault.vue +72 -0
  249. package/src/render/youtube/index.ts +8 -0
@@ -0,0 +1,36 @@
1
+ import { useEnvironmentContext, DEFAULT_ENVIRONMENT } from "../../providers/environment/use-environment-context.js";
2
+ import { useLocaleContext, DEFAULT_LOCALE } from "../../providers/locale/use-locale-context.js";
3
+ import { cleanProps } from "../../utils/clean-props.js";
4
+ import { useId, computed, toValue } from "vue";
5
+ import { useMachine } from "../../../../../@zag-js/vue/dist/machine.js";
6
+ import { connect } from "../../../../../@zag-js/tooltip/dist/tooltip.connect.js";
7
+ import { machine } from "../../../../../@zag-js/tooltip/dist/tooltip.machine.js";
8
+ import { normalizeProps } from "../../../../../@zag-js/vue/dist/normalize-props.js";
9
+ var useTooltip = (props = {}, emit) => {
10
+ const id = useId();
11
+ const env = useEnvironmentContext(DEFAULT_ENVIRONMENT);
12
+ const locale = useLocaleContext(DEFAULT_LOCALE);
13
+ const context = computed(() => {
14
+ const localProps = toValue(props);
15
+ return {
16
+ id,
17
+ dir: locale.value.dir,
18
+ getRootNode: env?.value.getRootNode,
19
+ ...cleanProps(localProps),
20
+ onOpenChange: (details) => {
21
+ emit?.("openChange", details);
22
+ emit?.("update:open", details.open);
23
+ localProps.onOpenChange?.(details);
24
+ },
25
+ onTriggerValueChange: (details) => {
26
+ emit?.("triggerValueChange", details);
27
+ localProps.onTriggerValueChange?.(details);
28
+ }
29
+ };
30
+ });
31
+ const service = useMachine(machine, context);
32
+ return computed(() => connect(service, normalizeProps));
33
+ };
34
+ export {
35
+ useTooltip
36
+ };
@@ -0,0 +1,13 @@
1
+ import { createContext } from "../../utils/create-context.js";
2
+ import { computed } from "vue";
3
+ var [EnvironmentContextProvider, useEnvironmentContext] = createContext("EnvironmentContext");
4
+ var DEFAULT_ENVIRONMENT = computed(() => ({
5
+ getRootNode: () => document,
6
+ getDocument: () => document,
7
+ getWindow: () => window
8
+ }));
9
+ export {
10
+ DEFAULT_ENVIRONMENT,
11
+ EnvironmentContextProvider,
12
+ useEnvironmentContext
13
+ };
@@ -0,0 +1,12 @@
1
+ import { createContext } from "../../utils/create-context.js";
2
+ import { computed } from "vue";
3
+ var DEFAULT_LOCALE = computed(() => ({
4
+ dir: "ltr",
5
+ locale: "en-US"
6
+ }));
7
+ var [LocaleContextProvider, useLocaleContext] = createContext("LocaleContext");
8
+ export {
9
+ DEFAULT_LOCALE,
10
+ LocaleContextProvider,
11
+ useLocaleContext
12
+ };
@@ -0,0 +1,8 @@
1
+ var cleanProps = (obj) => {
2
+ const result = {};
3
+ for (const [key, value] of Object.entries(obj)) if (value !== void 0) result[key] = value;
4
+ return result;
5
+ };
6
+ export {
7
+ cleanProps
8
+ };
@@ -0,0 +1,14 @@
1
+ import { provide, inject } from "vue";
2
+ var createContext = (id) => {
3
+ const contextId = Symbol(id);
4
+ const provider = (value) => provide(contextId, value);
5
+ const consumer = (fallback) => inject(contextId, fallback);
6
+ return [
7
+ provider,
8
+ consumer,
9
+ contextId
10
+ ];
11
+ };
12
+ export {
13
+ createContext
14
+ };
@@ -0,0 +1,34 @@
1
+ import { defineComponent, cloneVNode, Fragment } from "vue";
2
+ import { mergeProps } from "../../../../@zag-js/core/dist/merge-props.js";
3
+ var Dynamic = defineComponent({
4
+ name: "Dynamic",
5
+ inheritAttrs: false,
6
+ setup(_, { attrs, slots }) {
7
+ return () => {
8
+ if (!slots.default) return null;
9
+ const children = renderSlotFragments(slots.default());
10
+ const [firstChildren, ...otherChildren] = children;
11
+ if (firstChildren && Object.keys(attrs).length > 0) {
12
+ delete firstChildren.props?.ref;
13
+ const mergedProps = mergeProps(attrs, firstChildren.props ?? {});
14
+ const cloned = cloneVNode(firstChildren, mergedProps);
15
+ for (const prop in mergedProps) if (prop.startsWith("on")) {
16
+ cloned.props ||= {};
17
+ cloned.props[prop] = mergedProps[prop];
18
+ }
19
+ return children.length === 1 ? cloned : [cloned, ...otherChildren];
20
+ }
21
+ return children;
22
+ };
23
+ }
24
+ });
25
+ function renderSlotFragments(children) {
26
+ if (!children) return [];
27
+ return children.flatMap((child) => {
28
+ if (child.type === Fragment) return renderSlotFragments(child.children);
29
+ return [child];
30
+ });
31
+ }
32
+ export {
33
+ Dynamic
34
+ };
@@ -0,0 +1,8 @@
1
+ import { toValue } from "vue";
2
+ function unrefElement(elRef) {
3
+ const plain = toValue(elRef);
4
+ return plain?.$el ?? plain;
5
+ }
6
+ export {
7
+ unrefElement
8
+ };
@@ -0,0 +1,46 @@
1
+ import { unrefElement } from "./unref-element.js";
2
+ import { getCurrentInstance, ref, computed } from "vue";
3
+ var isElement = (el) => Object.prototype.hasOwnProperty.call(el, "nodeName") && typeof el.nodeName === "string";
4
+ function useForwardExpose() {
5
+ const instance = getCurrentInstance();
6
+ const currentRef = ref();
7
+ const currentElement = computed(() => {
8
+ return ["#text", "#comment"].includes(currentRef.value?.$el.nodeName) ? currentRef.value?.$el.nextElementSibling : unrefElement(currentRef);
9
+ });
10
+ const localExpose = Object.assign({}, instance.exposed);
11
+ const ret = {};
12
+ for (const key in instance.props) Object.defineProperty(ret, key, {
13
+ enumerable: true,
14
+ configurable: true,
15
+ get: () => instance.props[key]
16
+ });
17
+ if (Object.keys(localExpose).length > 0) for (const key in localExpose) Object.defineProperty(ret, key, {
18
+ enumerable: true,
19
+ configurable: true,
20
+ get: () => localExpose[key]
21
+ });
22
+ Object.defineProperty(ret, "$el", {
23
+ enumerable: true,
24
+ configurable: true,
25
+ get: () => instance.vnode.el
26
+ });
27
+ instance.exposed = ret;
28
+ function forwardRef(ref2) {
29
+ currentRef.value = ref2;
30
+ if (!ref2) return;
31
+ Object.defineProperty(ret, "$el", {
32
+ enumerable: true,
33
+ configurable: true,
34
+ get: () => isElement(ref2) ? ref2 : ref2.$el
35
+ });
36
+ instance.exposed = ret;
37
+ }
38
+ return {
39
+ forwardRef,
40
+ currentRef,
41
+ currentElement
42
+ };
43
+ }
44
+ export {
45
+ useForwardExpose
46
+ };
@@ -0,0 +1,5 @@
1
+ import { createContext } from "./create-context.js";
2
+ var [RenderStrategyPropsProvider] = createContext("RenderStrategyProps");
3
+ export {
4
+ RenderStrategyPropsProvider
5
+ };
@@ -0,0 +1,20 @@
1
+ import { __exports as constants } from "../../../../_virtual/constants.js";
2
+ var hasRequiredConstants;
3
+ function requireConstants() {
4
+ if (hasRequiredConstants) return constants;
5
+ hasRequiredConstants = 1;
6
+ Object.defineProperty(constants, "__esModule", { value: true });
7
+ constants.BLANK_URL = constants.relativeFirstCharacters = constants.whitespaceEscapeCharsRegex = constants.urlSchemeRegex = constants.ctrlCharactersRegex = constants.htmlCtrlEntityRegex = constants.htmlEntitiesRegex = constants.invalidProtocolRegex = void 0;
8
+ constants.invalidProtocolRegex = /^([^\w]*)(javascript|data|vbscript)/im;
9
+ constants.htmlEntitiesRegex = /&#(\w+)(^\w|;)?/g;
10
+ constants.htmlCtrlEntityRegex = /&(newline|tab);/gi;
11
+ constants.ctrlCharactersRegex = /[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim;
12
+ constants.urlSchemeRegex = /^.+(:|:)/gim;
13
+ constants.whitespaceEscapeCharsRegex = /(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g;
14
+ constants.relativeFirstCharacters = [".", "/"];
15
+ constants.BLANK_URL = "about:blank";
16
+ return constants;
17
+ }
18
+ export {
19
+ requireConstants as __require
20
+ };
@@ -0,0 +1,75 @@
1
+ import { __exports as dist } from "../../../../_virtual/index2.js";
2
+ import { __require as requireConstants } from "./constants.js";
3
+ var hasRequiredDist;
4
+ function requireDist() {
5
+ if (hasRequiredDist) return dist;
6
+ hasRequiredDist = 1;
7
+ Object.defineProperty(dist, "__esModule", { value: true });
8
+ dist.sanitizeUrl = sanitizeUrl;
9
+ var constants_1 = requireConstants();
10
+ function isRelativeUrlWithoutProtocol(url) {
11
+ return constants_1.relativeFirstCharacters.indexOf(url[0]) > -1;
12
+ }
13
+ function decodeHtmlCharacters(str) {
14
+ var removedNullByte = str.replace(constants_1.ctrlCharactersRegex, "");
15
+ return removedNullByte.replace(constants_1.htmlEntitiesRegex, function(match, dec) {
16
+ return String.fromCharCode(dec);
17
+ });
18
+ }
19
+ function isValidUrl(url) {
20
+ return URL.canParse(url);
21
+ }
22
+ function decodeURI(uri) {
23
+ try {
24
+ return decodeURIComponent(uri);
25
+ } catch (e) {
26
+ return uri;
27
+ }
28
+ }
29
+ function sanitizeUrl(url) {
30
+ if (!url) {
31
+ return constants_1.BLANK_URL;
32
+ }
33
+ var charsToDecode;
34
+ var decodedUrl = decodeURI(url.trim());
35
+ do {
36
+ decodedUrl = decodeHtmlCharacters(decodedUrl).replace(constants_1.htmlCtrlEntityRegex, "").replace(constants_1.ctrlCharactersRegex, "").replace(constants_1.whitespaceEscapeCharsRegex, "").trim();
37
+ decodedUrl = decodeURI(decodedUrl);
38
+ charsToDecode = decodedUrl.match(constants_1.ctrlCharactersRegex) || decodedUrl.match(constants_1.htmlEntitiesRegex) || decodedUrl.match(constants_1.htmlCtrlEntityRegex) || decodedUrl.match(constants_1.whitespaceEscapeCharsRegex);
39
+ } while (charsToDecode && charsToDecode.length > 0);
40
+ var sanitizedUrl = decodedUrl;
41
+ if (!sanitizedUrl) {
42
+ return constants_1.BLANK_URL;
43
+ }
44
+ if (isRelativeUrlWithoutProtocol(sanitizedUrl)) {
45
+ return sanitizedUrl;
46
+ }
47
+ var trimmedUrl = sanitizedUrl.trimStart();
48
+ var urlSchemeParseResults = trimmedUrl.match(constants_1.urlSchemeRegex);
49
+ if (!urlSchemeParseResults) {
50
+ return sanitizedUrl;
51
+ }
52
+ var urlScheme = urlSchemeParseResults[0].toLowerCase().trim();
53
+ if (constants_1.invalidProtocolRegex.test(urlScheme)) {
54
+ return constants_1.BLANK_URL;
55
+ }
56
+ var backSanitized = trimmedUrl.replace(/\\/g, "/");
57
+ if (urlScheme === "mailto:" || urlScheme.includes("://")) {
58
+ return backSanitized;
59
+ }
60
+ if (urlScheme === "http:" || urlScheme === "https:") {
61
+ if (!isValidUrl(backSanitized)) {
62
+ return constants_1.BLANK_URL;
63
+ }
64
+ var url_1 = new URL(backSanitized);
65
+ url_1.protocol = url_1.protocol.toLowerCase();
66
+ url_1.hostname = url_1.hostname.toLowerCase();
67
+ return url_1.toString();
68
+ }
69
+ return backSanitized;
70
+ }
71
+ return dist;
72
+ }
73
+ export {
74
+ requireDist as __require
75
+ };