@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.
- package/dist/_virtual/_plugin-vue_export-helper.js +10 -0
- package/dist/_virtual/constants.js +4 -0
- package/dist/_virtual/index.js +5 -0
- package/dist/_virtual/index2.js +4 -0
- package/dist/composables/index.d.ts +11 -0
- package/dist/composables/index.js +24 -0
- package/dist/composables/useAudioPlayer.d.ts +22 -0
- package/dist/composables/useAudioPlayer.js +58 -0
- package/dist/composables/useCallout.d.ts +43 -0
- package/dist/composables/useCallout.js +71 -0
- package/dist/composables/useCodeBlock.d.ts +23 -0
- package/dist/composables/useCodeBlock.js +67 -0
- package/dist/composables/useGallery.d.ts +37 -0
- package/dist/composables/useGallery.js +84 -0
- package/dist/composables/useMedia.d.ts +18 -0
- package/dist/composables/useMedia.js +9 -0
- package/dist/composables/useYouTube.d.ts +31 -0
- package/dist/composables/useYouTube.js +32 -0
- package/dist/edit/AlertEdit.vue.d.ts +12 -0
- package/dist/edit/AlertEdit.vue.js +4 -0
- package/dist/edit/AlertEdit.vue2.js +18 -0
- package/dist/edit/AudioPlayerEdit.vue.d.ts +3 -0
- package/dist/edit/AudioPlayerEdit.vue.js +117 -0
- package/dist/edit/AudioPlayerEdit.vue2.js +4 -0
- package/dist/edit/BadgeEdit.vue.d.ts +2 -0
- package/dist/edit/BadgeEdit.vue.js +4 -0
- package/dist/edit/BadgeEdit.vue2.js +13 -0
- package/dist/edit/ButtonEdit.vue.d.ts +2 -0
- package/dist/edit/ButtonEdit.vue.js +4 -0
- package/dist/edit/ButtonEdit.vue2.js +13 -0
- package/dist/edit/CalloutEdit.vue.d.ts +13 -0
- package/dist/edit/CalloutEdit.vue.js +85 -0
- package/dist/edit/CalloutEdit.vue2.js +4 -0
- package/dist/edit/CardEdit.vue.d.ts +12 -0
- package/dist/edit/CardEdit.vue.js +4 -0
- package/dist/edit/CardEdit.vue2.js +18 -0
- package/dist/edit/CodeBlockEdit.vue.d.ts +12 -0
- package/dist/edit/CodeBlockEdit.vue.js +7 -0
- package/dist/edit/CodeBlockEdit.vue2.js +89 -0
- package/dist/edit/GalleryEdit.vue.d.ts +3 -0
- package/dist/edit/GalleryEdit.vue.js +64 -0
- package/dist/edit/GalleryEdit.vue2.js +4 -0
- package/dist/edit/IconEdit.vue.d.ts +2 -0
- package/dist/edit/IconEdit.vue.js +4 -0
- package/dist/edit/IconEdit.vue2.js +13 -0
- package/dist/edit/TooltipEdit.vue.d.ts +16 -0
- package/dist/edit/TooltipEdit.vue.js +4 -0
- package/dist/edit/TooltipEdit.vue2.js +24 -0
- package/dist/edit/YouTubeEdit.vue.d.ts +3 -0
- package/dist/edit/YouTubeEdit.vue.js +41 -0
- package/dist/edit/YouTubeEdit.vue2.js +4 -0
- package/dist/edit/index.d.ts +29 -0
- package/dist/edit/index.js +35 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +75 -0
- package/dist/mdx-render-vue.css +31 -0
- package/dist/node_modules/@ark-ui/vue/dist/_virtual/_rolldown/runtime.js +13 -0
- package/dist/node_modules/@ark-ui/vue/dist/components/factory.js +35 -0
- package/dist/node_modules/@ark-ui/vue/dist/components/presence/use-presence-context.js +6 -0
- package/dist/node_modules/@ark-ui/vue/dist/components/presence/use-presence.js +40 -0
- package/dist/node_modules/@ark-ui/vue/dist/components/tooltip/tooltip-arrow-tip.js +5 -0
- package/dist/node_modules/@ark-ui/vue/dist/components/tooltip/tooltip-arrow-tip.vue_vue_type_script_setup_true_lang.js +21 -0
- package/dist/node_modules/@ark-ui/vue/dist/components/tooltip/tooltip-arrow.js +5 -0
- package/dist/node_modules/@ark-ui/vue/dist/components/tooltip/tooltip-arrow.vue_vue_type_script_setup_true_lang.js +21 -0
- package/dist/node_modules/@ark-ui/vue/dist/components/tooltip/tooltip-content.js +5 -0
- package/dist/node_modules/@ark-ui/vue/dist/components/tooltip/tooltip-content.vue_vue_type_script_setup_true_lang.js +25 -0
- package/dist/node_modules/@ark-ui/vue/dist/components/tooltip/tooltip-context.js +5 -0
- package/dist/node_modules/@ark-ui/vue/dist/components/tooltip/tooltip-context.vue_vue_type_script_setup_true_lang.js +14 -0
- package/dist/node_modules/@ark-ui/vue/dist/components/tooltip/tooltip-positioner.js +5 -0
- package/dist/node_modules/@ark-ui/vue/dist/components/tooltip/tooltip-positioner.vue_vue_type_script_setup_true_lang.js +23 -0
- package/dist/node_modules/@ark-ui/vue/dist/components/tooltip/tooltip-root-provider.js +5 -0
- package/dist/node_modules/@ark-ui/vue/dist/components/tooltip/tooltip-root-provider.vue_vue_type_script_setup_true_lang.js +38 -0
- package/dist/node_modules/@ark-ui/vue/dist/components/tooltip/tooltip-root.js +5 -0
- package/dist/node_modules/@ark-ui/vue/dist/components/tooltip/tooltip-root.vue_vue_type_script_setup_true_lang.js +68 -0
- package/dist/node_modules/@ark-ui/vue/dist/components/tooltip/tooltip-trigger.js +5 -0
- package/dist/node_modules/@ark-ui/vue/dist/components/tooltip/tooltip-trigger.vue_vue_type_script_setup_true_lang.js +25 -0
- package/dist/node_modules/@ark-ui/vue/dist/components/tooltip/tooltip.js +22 -0
- package/dist/node_modules/@ark-ui/vue/dist/components/tooltip/use-tooltip-context.js +6 -0
- package/dist/node_modules/@ark-ui/vue/dist/components/tooltip/use-tooltip.js +36 -0
- package/dist/node_modules/@ark-ui/vue/dist/providers/environment/use-environment-context.js +13 -0
- package/dist/node_modules/@ark-ui/vue/dist/providers/locale/use-locale-context.js +12 -0
- package/dist/node_modules/@ark-ui/vue/dist/utils/clean-props.js +8 -0
- package/dist/node_modules/@ark-ui/vue/dist/utils/create-context.js +14 -0
- package/dist/node_modules/@ark-ui/vue/dist/utils/dynamic.js +34 -0
- package/dist/node_modules/@ark-ui/vue/dist/utils/unref-element.js +8 -0
- package/dist/node_modules/@ark-ui/vue/dist/utils/use-forward-expose.js +46 -0
- package/dist/node_modules/@ark-ui/vue/dist/utils/use-render-strategy.js +5 -0
- package/dist/node_modules/@braintree/sanitize-url/dist/constants.js +20 -0
- package/dist/node_modules/@braintree/sanitize-url/dist/index.js +75 -0
- package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +728 -0
- package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +629 -0
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +176 -0
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +151 -0
- package/dist/node_modules/@iconify/vue/dist/iconify.js +1691 -0
- package/dist/node_modules/@zag-js/anatomy/dist/create-anatomy.js +29 -0
- package/dist/node_modules/@zag-js/core/dist/create-machine.js +28 -0
- package/dist/node_modules/@zag-js/core/dist/merge-props.js +55 -0
- package/dist/node_modules/@zag-js/core/dist/scope.js +20 -0
- package/dist/node_modules/@zag-js/core/dist/state.js +176 -0
- package/dist/node_modules/@zag-js/core/dist/types.js +11 -0
- package/dist/node_modules/@zag-js/dom-query/dist/chunk-QZ7TP4HQ.js +6 -0
- package/dist/node_modules/@zag-js/dom-query/dist/computed-style.js +11 -0
- package/dist/node_modules/@zag-js/dom-query/dist/event.js +37 -0
- package/dist/node_modules/@zag-js/dom-query/dist/node.js +64 -0
- package/dist/node_modules/@zag-js/dom-query/dist/overflow.js +28 -0
- package/dist/node_modules/@zag-js/dom-query/dist/platform.js +23 -0
- package/dist/node_modules/@zag-js/dom-query/dist/query.js +6 -0
- package/dist/node_modules/@zag-js/dom-query/dist/raf.js +52 -0
- package/dist/node_modules/@zag-js/dom-query/dist/set.js +22 -0
- package/dist/node_modules/@zag-js/dom-query/dist/shared.js +8 -0
- package/dist/node_modules/@zag-js/focus-visible/dist/index.js +159 -0
- package/dist/node_modules/@zag-js/popper/dist/get-anchor.js +39 -0
- package/dist/node_modules/@zag-js/popper/dist/get-placement.js +296 -0
- package/dist/node_modules/@zag-js/popper/dist/get-styles.js +47 -0
- package/dist/node_modules/@zag-js/popper/dist/middleware.js +79 -0
- package/dist/node_modules/@zag-js/popper/dist/placement.js +7 -0
- package/dist/node_modules/@zag-js/presence/dist/presence.connect.js +18 -0
- package/dist/node_modules/@zag-js/presence/dist/presence.machine.js +175 -0
- package/dist/node_modules/@zag-js/tooltip/dist/tooltip.anatomy.js +7 -0
- package/dist/node_modules/@zag-js/tooltip/dist/tooltip.connect.js +155 -0
- package/dist/node_modules/@zag-js/tooltip/dist/tooltip.dom.js +24 -0
- package/dist/node_modules/@zag-js/tooltip/dist/tooltip.machine.js +416 -0
- package/dist/node_modules/@zag-js/tooltip/dist/tooltip.store.js +9 -0
- package/dist/node_modules/@zag-js/types/dist/prop-types.js +14 -0
- package/dist/node_modules/@zag-js/utils/dist/array.js +7 -0
- package/dist/node_modules/@zag-js/utils/dist/equal.js +36 -0
- package/dist/node_modules/@zag-js/utils/dist/functions.js +11 -0
- package/dist/node_modules/@zag-js/utils/dist/guard.js +26 -0
- package/dist/node_modules/@zag-js/utils/dist/object.js +16 -0
- package/dist/node_modules/@zag-js/utils/dist/store.js +44 -0
- package/dist/node_modules/@zag-js/utils/dist/warning.js +31 -0
- package/dist/node_modules/@zag-js/vue/dist/bindable.js +48 -0
- package/dist/node_modules/@zag-js/vue/dist/machine.js +258 -0
- package/dist/node_modules/@zag-js/vue/dist/normalize-props.js +42 -0
- package/dist/node_modules/@zag-js/vue/dist/refs.js +14 -0
- package/dist/node_modules/@zag-js/vue/dist/track.js +22 -0
- package/dist/node_modules/dompurify/dist/purify.es.js +1190 -0
- package/dist/registry.d.ts +76 -0
- package/dist/registry.js +164 -0
- package/dist/render/alert/Alert.vue.d.ts +18 -0
- package/dist/render/alert/Alert.vue.js +4 -0
- package/dist/render/alert/Alert.vue2.js +43 -0
- package/dist/render/alert/index.d.ts +2 -0
- package/dist/render/audioplayer/AudioPlayerDefault.vue.d.ts +3 -0
- package/dist/render/audioplayer/AudioPlayerDefault.vue.js +116 -0
- package/dist/render/audioplayer/AudioPlayerDefault.vue2.js +4 -0
- package/dist/render/audioplayer/index.d.ts +5 -0
- package/dist/render/audioplayer/index.js +5 -0
- package/dist/render/badge/Badge.vue.d.ts +10 -0
- package/dist/render/badge/Badge.vue.js +4 -0
- package/dist/render/badge/Badge.vue2.js +28 -0
- package/dist/render/badge/index.d.ts +2 -0
- package/dist/render/button/Button.vue.d.ts +13 -0
- package/dist/render/button/Button.vue.js +4 -0
- package/dist/render/button/Button.vue2.js +42 -0
- package/dist/render/button/index.d.ts +2 -0
- package/dist/render/callout/CalloutDefault.vue.d.ts +13 -0
- package/dist/render/callout/CalloutDefault.vue.js +86 -0
- package/dist/render/callout/CalloutDefault.vue2.js +4 -0
- package/dist/render/callout/CalloutMinimal.vue.d.ts +13 -0
- package/dist/render/callout/CalloutMinimal.vue.js +27 -0
- package/dist/render/callout/CalloutMinimal.vue2.js +4 -0
- package/dist/render/callout/index.d.ts +6 -0
- package/dist/render/callout/index.js +7 -0
- package/dist/render/card/Card.vue.d.ts +15 -0
- package/dist/render/card/Card.vue.js +4 -0
- package/dist/render/card/Card.vue2.js +29 -0
- package/dist/render/card/index.d.ts +2 -0
- package/dist/render/codeblock/CodeBlockDefault.vue.d.ts +12 -0
- package/dist/render/codeblock/CodeBlockDefault.vue.js +7 -0
- package/dist/render/codeblock/CodeBlockDefault.vue2.js +92 -0
- package/dist/render/codeblock/index.d.ts +5 -0
- package/dist/render/codeblock/index.js +5 -0
- package/dist/render/gallery/GalleryGrid.vue.d.ts +3 -0
- package/dist/render/gallery/GalleryGrid.vue.js +125 -0
- package/dist/render/gallery/GalleryGrid.vue2.js +4 -0
- package/dist/render/gallery/GalleryLightbox.vue.d.ts +16 -0
- package/dist/render/gallery/GalleryLightbox.vue.js +7 -0
- package/dist/render/gallery/GalleryLightbox.vue2.js +170 -0
- package/dist/render/gallery/index.d.ts +6 -0
- package/dist/render/gallery/index.js +7 -0
- package/dist/render/icon/Icon.vue.d.ts +9 -0
- package/dist/render/icon/Icon.vue.js +4 -0
- package/dist/render/icon/Icon.vue2.js +25 -0
- package/dist/render/icon/index.d.ts +2 -0
- package/dist/render/index.d.ts +40 -0
- package/dist/render/index.js +63 -0
- package/dist/render/tooltip/Tooltip.vue.d.ts +18 -0
- package/dist/render/tooltip/Tooltip.vue.js +4 -0
- package/dist/render/tooltip/Tooltip.vue2.js +58 -0
- package/dist/render/tooltip/index.d.ts +2 -0
- package/dist/render/youtube/YouTubeDefault.vue.d.ts +3 -0
- package/dist/render/youtube/YouTubeDefault.vue.js +79 -0
- package/dist/render/youtube/YouTubeDefault.vue2.js +4 -0
- package/dist/render/youtube/index.d.ts +5 -0
- package/dist/render/youtube/index.js +5 -0
- package/dist/useAudioPlayer.d.ts +22 -0
- package/dist/useCallout.d.ts +46 -0
- package/dist/useCodeBlock.d.ts +25 -0
- package/dist/useGallery.d.ts +44 -0
- package/dist/useMedia.d.ts +16 -0
- package/dist/useYouTube.d.ts +32 -0
- package/package.json +125 -0
- package/src/composables/index.ts +16 -0
- package/src/composables/useAudioPlayer.ts +84 -0
- package/src/composables/useCallout.ts +103 -0
- package/src/composables/useCodeBlock.ts +90 -0
- package/src/composables/useGallery.ts +143 -0
- package/src/composables/useMedia.ts +23 -0
- package/src/composables/useYouTube.ts +58 -0
- package/src/edit/AlertEdit.vue +9 -0
- package/src/edit/AudioPlayerEdit.vue +92 -0
- package/src/edit/BadgeEdit.vue +7 -0
- package/src/edit/ButtonEdit.vue +10 -0
- package/src/edit/CalloutEdit.vue +107 -0
- package/src/edit/CardEdit.vue +9 -0
- package/src/edit/CodeBlockEdit.vue +76 -0
- package/src/edit/GalleryEdit.vue +65 -0
- package/src/edit/IconEdit.vue +7 -0
- package/src/edit/TooltipEdit.vue +15 -0
- package/src/edit/YouTubeEdit.vue +33 -0
- package/src/edit/index.ts +32 -0
- package/src/index.ts +62 -0
- package/src/registry.ts +272 -0
- package/src/render/alert/Alert.vue +32 -0
- package/src/render/alert/index.ts +2 -0
- package/src/render/audioplayer/AudioPlayerDefault.vue +89 -0
- package/src/render/audioplayer/index.ts +8 -0
- package/src/render/badge/Badge.vue +25 -0
- package/src/render/badge/index.ts +2 -0
- package/src/render/button/Button.vue +41 -0
- package/src/render/button/index.ts +2 -0
- package/src/render/callout/CalloutDefault.vue +101 -0
- package/src/render/callout/CalloutMinimal.vue +31 -0
- package/src/render/callout/index.ts +9 -0
- package/src/render/card/Card.vue +15 -0
- package/src/render/card/index.ts +2 -0
- package/src/render/codeblock/CodeBlockDefault.vue +76 -0
- package/src/render/codeblock/index.ts +8 -0
- package/src/render/gallery/GalleryGrid.vue +162 -0
- package/src/render/gallery/GalleryLightbox.vue +162 -0
- package/src/render/gallery/index.ts +9 -0
- package/src/render/icon/Icon.vue +22 -0
- package/src/render/icon/index.ts +2 -0
- package/src/render/index.ts +76 -0
- package/src/render/tooltip/Tooltip.vue +35 -0
- package/src/render/tooltip/index.ts +2 -0
- package/src/render/youtube/YouTubeDefault.vue +72 -0
- 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,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,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,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
|
+
};
|