@pagelines/sdk 1.0.663 → 1.0.665

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 (66) hide show
  1. package/dist/AgentProvider.vue_vue_type_script_setup_true_lang.js +4208 -0
  2. package/dist/AgentProvider.vue_vue_type_script_setup_true_lang.js.map +1 -0
  3. package/dist/AgentWidgetInline.js +32 -44
  4. package/dist/AgentWidgetInline.js.map +1 -1
  5. package/dist/AgentWidgetModal.js +64 -75
  6. package/dist/AgentWidgetModal.js.map +1 -1
  7. package/dist/AgentWidgetOnboard.js +5 -0
  8. package/dist/AgentWidgetOnboard.js.map +1 -0
  9. package/dist/AgentWrap.vue_vue_type_script_setup_true_lang.js +5098 -0
  10. package/dist/AgentWrap.vue_vue_type_script_setup_true_lang.js.map +1 -0
  11. package/dist/FModal.vue_vue_type_script_setup_true_lang.js +181 -0
  12. package/dist/FModal.vue_vue_type_script_setup_true_lang.js.map +1 -0
  13. package/dist/agent/test/AgentController.test.d.ts +1 -0
  14. package/dist/agent/test/ChatRichText.client.test.d.ts +1 -0
  15. package/dist/agent/test/ChatVisualBlock.client.test.d.ts +1 -0
  16. package/dist/agent/test/ElAgentChat.client.test.d.ts +1 -0
  17. package/dist/agent/test/ElAgentChatPreview.client.test.d.ts +1 -0
  18. package/dist/agent/test/VoiceRecorderController.unit.test.d.ts +1 -0
  19. package/dist/agent/test/auth-inputs.test.d.ts +1 -0
  20. package/dist/agent/test/chat-visual-format.unit.test.d.ts +1 -0
  21. package/dist/agent/test/utils.test.d.ts +1 -0
  22. package/dist/agent/test/webhook.test.d.ts +1 -0
  23. package/dist/agent.js +186 -157
  24. package/dist/agent.js.map +1 -1
  25. package/dist/contract/regenerate.d.ts +2 -0
  26. package/dist/contract/test/build.unit.test.d.ts +1 -0
  27. package/dist/contract/test/conversation-wire-shapes.unit.test.d.ts +14 -0
  28. package/dist/contract/test/snapshot.unit.test.d.ts +1 -0
  29. package/dist/demo.js +259 -242
  30. package/dist/demo.js.map +1 -1
  31. package/dist/index.js +872 -0
  32. package/dist/index.js.map +1 -0
  33. package/dist/sdk.css +1 -2
  34. package/dist/sdk.js +14 -4
  35. package/dist/sdk.js.map +1 -0
  36. package/dist/sdkClient.js +867 -775
  37. package/dist/sdkClient.js.map +1 -1
  38. package/dist/socialPlatforms.js +82 -0
  39. package/dist/socialPlatforms.js.map +1 -0
  40. package/dist/test/agent-client.test.d.ts +4 -0
  41. package/dist/test/api.test.d.ts +1 -0
  42. package/dist/test/billing-client.test.d.ts +4 -0
  43. package/dist/test/build.test.d.ts +1 -0
  44. package/dist/test/chat-authenticated.test.d.ts +1 -0
  45. package/dist/test/chat-issue-presentation.test.d.ts +1 -0
  46. package/dist/test/derive-mode.test.d.ts +1 -0
  47. package/dist/test/sdk-token-capture.test.d.ts +13 -0
  48. package/dist/vite.config.sdk.d.ts +2 -0
  49. package/dist/vitest.config.d.ts +2 -0
  50. package/dist/widget.js +7 -721
  51. package/dist/widget.js.map +1 -1
  52. package/package.json +12 -12
  53. package/dist/AgentProvider.js +0 -2782
  54. package/dist/AgentProvider.js.map +0 -1
  55. package/dist/AgentWrap.js +0 -5251
  56. package/dist/AgentWrap.js.map +0 -1
  57. package/dist/FModal.js +0 -165
  58. package/dist/FModal.js.map +0 -1
  59. package/dist/constants.js +0 -80
  60. package/dist/constants.js.map +0 -1
  61. package/dist/contract.js +0 -6271
  62. package/dist/contract.js.map +0 -1
  63. package/dist/node_modules/.vue-global-types/vue_3.5_false.d.ts +0 -4
  64. package/dist/rolldown-runtime.js +0 -14
  65. package/dist/useWidgetState.js +0 -21
  66. package/dist/useWidgetState.js.map +0 -1
package/dist/FModal.js DELETED
@@ -1,165 +0,0 @@
1
- import "./rolldown-runtime.js";
2
- import { Teleport as e, Transition as t, computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createVNode as s, defineComponent as c, guardReactiveProps as l, normalizeClass as u, normalizeProps as d, onMounted as f, onUnmounted as p, openBlock as m, ref as h, renderSlot as g, toDisplayString as _, watch as v, withCtx as y, withModifiers as b } from "vue";
3
- //#region ../../src/ui/common/FClose.vue?vue&type=script&setup=true&lang.ts
4
- var x = ["aria-label"], S = { class: "absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[28px] h-[28px] overflow-hidden" }, C = /* @__PURE__ */ c({
5
- name: "FClose",
6
- __name: "FClose",
7
- props: { ariaLabel: {} },
8
- emits: ["click"],
9
- setup(e) {
10
- let t = h(!1);
11
- return f(() => {
12
- setTimeout(() => {
13
- t.value = !0;
14
- }, 100);
15
- }), (n, r) => (m(), a("button", {
16
- type: "button",
17
- "aria-label": e.ariaLabel || "Close",
18
- class: "close block cursor-pointer w-[60px] h-[60px] rounded-full transition-all duration-1000 ease-[cubic-bezier(0.25,1,0.33,1)] hover:scale-110 active:scale-90 hover:rotate-90",
19
- onClick: r[0] || (r[0] = (e) => n.$emit("click", e))
20
- }, [r[1] || (r[1] = o("span", { class: "absolute inset-0 rounded-full transition-all" }, null, -1)), o("span", S, [o("span", {
21
- class: u(["absolute h-full w-[3px] rounded-[5px] left-[13px] transition-all duration-[400ms] ease-[cubic-bezier(0.52,0.01,0.16,1)]", t.value ? "translate-y-0 translate-x-0 rotate-45" : "translate-y-[30px] -translate-x-[30px] rotate-0"]),
22
- style: {
23
- "background-color": "currentColor",
24
- "transition-delay": "0.15s"
25
- }
26
- }, null, 2), o("span", {
27
- class: u(["absolute h-full w-[3px] rounded-[5px] left-[13px] transition-all duration-[400ms] ease-[cubic-bezier(0.52,0.01,0.16,1)]", t.value ? "translate-y-0 translate-x-0 -rotate-45" : "-translate-y-[30px] -translate-x-[30px] rotate-0"]),
28
- style: {
29
- "background-color": "currentColor",
30
- "transition-delay": "0.45s"
31
- }
32
- }, null, 2)])], 8, x));
33
- }
34
- }), w = { class: "flex min-h-full items-center justify-center text-center p-4" }, T = {
35
- key: 0,
36
- class: "text-base p-4 font-semibold"
37
- }, E = {
38
- key: 1,
39
- class: "flex items-center gap-2 px-2"
40
- }, D = /* @__PURE__ */ c({
41
- inheritAttrs: !1,
42
- name: "FModal",
43
- __name: "FModal",
44
- props: {
45
- vis: {
46
- type: Boolean,
47
- default: !1
48
- },
49
- modalClass: {},
50
- styleClass: {},
51
- fullScreen: {
52
- type: Boolean,
53
- default: !1
54
- },
55
- hasClose: {
56
- type: Boolean,
57
- default: !1
58
- },
59
- title: { default: "" },
60
- transitionMode: { default: "modal" },
61
- teleportTo: { default: "body" },
62
- disableTeleport: {
63
- type: Boolean,
64
- default: !1
65
- }
66
- },
67
- emits: [
68
- "update:vis",
69
- "close",
70
- "escape"
71
- ],
72
- setup(c, { emit: x }) {
73
- let S = x, D = h(!1);
74
- function close(e) {
75
- let { reason: t } = e;
76
- S("update:vis", !1), S("close", !0), t === "escape" && S("escape", !0);
77
- }
78
- let O = n(() => {
79
- let e = c.modalClass ? [c.modalClass] : ["max-w-screen-md p-24"], t = c.styleClass ? [c.styleClass] : ["bg-theme-0", "shadow-xl"];
80
- return c.fullScreen ? e.push("fixed inset-0") : e.push("rounded-2xl"), [
81
- "relative",
82
- "text-left",
83
- "transform",
84
- "transition-all",
85
- "w-full",
86
- "overflow-hidden",
87
- ...e,
88
- ...t
89
- ];
90
- }), k = h(!1), A = [];
91
- function onKeydown(e) {
92
- e.key === "Escape" && c.vis && close({ reason: "escape" });
93
- }
94
- f(async () => {
95
- D.value = !0;
96
- let e = v(() => c.vis, (e) => {
97
- e ? setTimeout(() => k.value = !0, 300) : k.value = !1;
98
- }, { immediate: !0 });
99
- A.push(e), typeof document < "u" && (document.addEventListener("keydown", onKeydown), A.push(() => document.removeEventListener("keydown", onKeydown)));
100
- }), p(() => {
101
- A.forEach((e) => e());
102
- });
103
- let j = n(() => c.transitionMode === "slideUp" ? {
104
- enterActiveClass: "ease-[cubic-bezier(0.25,1,0.33,1)] duration-500",
105
- enterFromClass: "opacity-0 translate-y-full scale-95",
106
- enterToClass: "opacity-100 translate-y-0 scale-100",
107
- leaveActiveClass: "ease-[cubic-bezier(0.25,1,0.33,1)] duration-500",
108
- leaveFromClass: "opacity-100 translate-y-0 scale-100",
109
- leaveToClass: "opacity-0 translate-y-full scale-95"
110
- } : {
111
- enterActiveClass: "ease-[cubic-bezier(0.25,1,0.33,1)] duration-500",
112
- enterFromClass: "opacity-0 scale-75",
113
- enterToClass: "opacity-100 translate-y-0 scale-100",
114
- leaveActiveClass: "ease-[cubic-bezier(0.25,1,0.33,1)] duration-500",
115
- leaveFromClass: "opacity-100 translate-y-0 scale-100",
116
- leaveToClass: "opacity-0 scale-75"
117
- });
118
- return (n, f) => D.value ? (m(), r(e, {
119
- key: 0,
120
- to: c.teleportTo,
121
- disabled: c.disableTeleport
122
- }, [o("div", {
123
- class: u(["fixed inset-0 z-50", c.vis ? "" : "pointer-events-none"]),
124
- "aria-labelledby": "modal-title",
125
- role: "dialog",
126
- "aria-modal": "true"
127
- }, [s(t, {
128
- "enter-active-class": "ease-out duration-300",
129
- "enter-from-class": "opacity-0",
130
- "enter-to-class": "opacity-100",
131
- "leave-active-class": "ease-in duration-200",
132
- "leave-from-class": "opacity-100",
133
- "leave-to-class": "opacity-0"
134
- }, {
135
- default: y(() => [c.vis ? (m(), a("div", {
136
- key: 0,
137
- class: "fixed inset-0 bg-theme-800/60 active:bg-theme-800/80 cursor-pointer dark:bg-theme-600/90 backdrop-blur-sm transition-opacity",
138
- onClick: f[0] || (f[0] = (e) => close({ reason: "escape" }))
139
- })) : i("", !0)]),
140
- _: 1
141
- }), o("div", {
142
- class: "fixed inset-0 z-40 overflow-y-auto overscroll-contain no-scrollbar",
143
- onClick: f[3] || (f[3] = (e) => close({ reason: "escape" }))
144
- }, [o("div", w, [s(t, d(l(j.value)), {
145
- default: y(() => [c.vis ? (m(), a("div", {
146
- key: 0,
147
- class: u([O.value, "w-full"]),
148
- onClick: f[2] || (f[2] = b(() => {}, ["stop"]))
149
- }, [c.hasClose || c.title || n.$slots.actions ? (m(), a("div", {
150
- key: 0,
151
- class: u(!c.title && (c.hasClose || n.$slots.actions) ? "absolute top-0 right-0 z-10" : "flex justify-between items-center")
152
- }, [c.title ? (m(), a("h2", T, _(c.title), 1)) : i("", !0), c.hasClose || n.$slots.actions ? (m(), a("div", E, [g(n.$slots, "actions"), c.hasClose ? (m(), r(C, {
153
- key: 0,
154
- class: "relative",
155
- "data-test-id": "close-modal",
156
- onClick: f[1] || (f[1] = b((e) => close({ reason: "escape" }), ["stop"]))
157
- })) : i("", !0)])) : i("", !0)], 2)) : i("", !0), g(n.$slots, "default")], 2)) : i("", !0)]),
158
- _: 3
159
- }, 16)])])], 2)], 8, ["to", "disabled"])) : i("", !0);
160
- }
161
- });
162
- //#endregion
163
- export { D as t };
164
-
165
- //# sourceMappingURL=FModal.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FModal.js","names":["$emit","$slots"],"sources":["../../../src/ui/common/FClose.vue","../../../src/ui/common/FClose.vue","../../../src/ui/common/FModal.vue","../../../src/ui/common/FModal.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { onMounted, ref } from 'vue'\n\ndefineOptions({ name: 'FClose' })\n\ndefineProps<{\n ariaLabel?: string\n}>()\n\ndefineEmits<{\n click: [event: MouseEvent]\n}>()\n\nconst inView = ref(false)\n\nonMounted(() => {\n setTimeout(() => {\n inView.value = true\n }, 100)\n})\n</script>\n\n<template>\n <button\n type=\"button\"\n :aria-label=\"ariaLabel || 'Close'\"\n class=\"close block cursor-pointer w-[60px] h-[60px] rounded-full transition-all duration-1000 ease-[cubic-bezier(0.25,1,0.33,1)] hover:scale-110 active:scale-90 hover:rotate-90\"\n @click=\"$emit('click', $event)\"\n >\n <!-- Background circle (invisible, for hover area) -->\n <span class=\"absolute inset-0 rounded-full transition-all\" />\n\n <!-- Close lines container -->\n <span class=\"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[28px] h-[28px] overflow-hidden\">\n <!-- Line 1 - animates from bottom-left to center, rotates 45deg -->\n <span\n class=\"absolute h-full w-[3px] rounded-[5px] left-[13px] transition-all duration-[400ms] ease-[cubic-bezier(0.52,0.01,0.16,1)]\"\n :class=\"inView ? 'translate-y-0 translate-x-0 rotate-45' : 'translate-y-[30px] -translate-x-[30px] rotate-0'\"\n style=\"background-color: currentColor; transition-delay: 0.15s\"\n />\n\n <!-- Line 2 - animates from top-left to center, rotates -45deg -->\n <span\n class=\"absolute h-full w-[3px] rounded-[5px] left-[13px] transition-all duration-[400ms] ease-[cubic-bezier(0.52,0.01,0.16,1)]\"\n :class=\"inView ? 'translate-y-0 translate-x-0 -rotate-45' : '-translate-y-[30px] -translate-x-[30px] rotate-0'\"\n style=\"background-color: currentColor; transition-delay: 0.45s\"\n />\n </span>\n </button>\n</template>\n","<script lang=\"ts\" setup>\nimport { onMounted, ref } from 'vue'\n\ndefineOptions({ name: 'FClose' })\n\ndefineProps<{\n ariaLabel?: string\n}>()\n\ndefineEmits<{\n click: [event: MouseEvent]\n}>()\n\nconst inView = ref(false)\n\nonMounted(() => {\n setTimeout(() => {\n inView.value = true\n }, 100)\n})\n</script>\n\n<template>\n <button\n type=\"button\"\n :aria-label=\"ariaLabel || 'Close'\"\n class=\"close block cursor-pointer w-[60px] h-[60px] rounded-full transition-all duration-1000 ease-[cubic-bezier(0.25,1,0.33,1)] hover:scale-110 active:scale-90 hover:rotate-90\"\n @click=\"$emit('click', $event)\"\n >\n <!-- Background circle (invisible, for hover area) -->\n <span class=\"absolute inset-0 rounded-full transition-all\" />\n\n <!-- Close lines container -->\n <span class=\"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[28px] h-[28px] overflow-hidden\">\n <!-- Line 1 - animates from bottom-left to center, rotates 45deg -->\n <span\n class=\"absolute h-full w-[3px] rounded-[5px] left-[13px] transition-all duration-[400ms] ease-[cubic-bezier(0.52,0.01,0.16,1)]\"\n :class=\"inView ? 'translate-y-0 translate-x-0 rotate-45' : 'translate-y-[30px] -translate-x-[30px] rotate-0'\"\n style=\"background-color: currentColor; transition-delay: 0.15s\"\n />\n\n <!-- Line 2 - animates from top-left to center, rotates -45deg -->\n <span\n class=\"absolute h-full w-[3px] rounded-[5px] left-[13px] transition-all duration-[400ms] ease-[cubic-bezier(0.52,0.01,0.16,1)]\"\n :class=\"inView ? 'translate-y-0 translate-x-0 -rotate-45' : '-translate-y-[30px] -translate-x-[30px] rotate-0'\"\n style=\"background-color: currentColor; transition-delay: 0.45s\"\n />\n </span>\n </button>\n</template>\n","<script lang=\"ts\" setup>\nimport { computed, onMounted, onUnmounted, ref, watch } from 'vue'\nimport FClose from './FClose.vue'\n\ndefineOptions({ name: 'FModal' })\n\nconst {\n vis = false,\n modalClass,\n styleClass,\n fullScreen = false,\n hasClose = false,\n title = '',\n transitionMode = 'modal',\n teleportTo = 'body',\n disableTeleport = false,\n} = defineProps<{\n vis?: boolean\n modalClass?: string\n styleClass?: string\n fullScreen?: boolean\n hasClose?: boolean\n title?: string\n transitionMode?: 'modal' | 'slideUp'\n teleportTo?: string | Element\n disableTeleport?: boolean\n}>()\n\nconst emit = defineEmits<{\n 'update:vis': [value: boolean]\n 'close': [value: boolean]\n 'escape': [value: boolean]\n}>()\n\nconst isMounted = ref(false)\n\nfunction close(args: { reason: 'escape' | 'reset' }): void {\n const { reason } = args\n emit('update:vis', false)\n emit('close', true)\n if (reason === 'escape')\n emit('escape', true)\n}\n\nconst classes = computed(() => {\n const cls = modalClass ? [modalClass] : ['max-w-screen-md p-24']\n const style = styleClass ? [styleClass] : ['bg-theme-0', 'shadow-xl']\n\n if (fullScreen)\n cls.push('fixed inset-0')\n else\n cls.push('rounded-2xl')\n\n return [\n 'relative',\n 'text-left',\n 'transform',\n 'transition-all',\n 'w-full',\n 'overflow-hidden',\n ...cls,\n ...style,\n ]\n})\n\nconst afterVisible = ref(false)\nconst cleanups: (() => void)[] = []\n\nfunction onKeydown(event: KeyboardEvent): void {\n if (event.key === 'Escape' && vis)\n close({ reason: 'escape' })\n}\n\nonMounted(async () => {\n isMounted.value = true\n\n const unwatch = watch(\n () => vis,\n (vis) => {\n if (vis) {\n setTimeout(() => (afterVisible.value = true), 300)\n } else {\n afterVisible.value = false\n }\n },\n { immediate: true },\n )\n\n cleanups.push(unwatch)\n\n if (typeof document !== 'undefined') {\n document.addEventListener('keydown', onKeydown)\n cleanups.push(() => document.removeEventListener('keydown', onKeydown))\n }\n})\n\nonUnmounted(() => {\n cleanups.forEach((c) => c())\n})\n\nconst modalTransition = computed(() => {\n if (transitionMode === 'slideUp') {\n return {\n enterActiveClass: 'ease-[cubic-bezier(0.25,1,0.33,1)] duration-500',\n enterFromClass: 'opacity-0 translate-y-full scale-95',\n enterToClass: 'opacity-100 translate-y-0 scale-100',\n leaveActiveClass: 'ease-[cubic-bezier(0.25,1,0.33,1)] duration-500',\n leaveFromClass: 'opacity-100 translate-y-0 scale-100',\n leaveToClass: 'opacity-0 translate-y-full scale-95',\n }\n }\n return {\n enterActiveClass: 'ease-[cubic-bezier(0.25,1,0.33,1)] duration-500',\n enterFromClass: 'opacity-0 scale-75',\n enterToClass: 'opacity-100 translate-y-0 scale-100',\n leaveActiveClass: 'ease-[cubic-bezier(0.25,1,0.33,1)] duration-500',\n leaveFromClass: 'opacity-100 translate-y-0 scale-100',\n leaveToClass: 'opacity-0 scale-75',\n }\n})\n</script>\n\n<script lang=\"ts\">\nexport default {\n inheritAttrs: false,\n}\n</script>\n\n<template>\n <Teleport v-if=\"isMounted\" :to=\"teleportTo\" :disabled=\"disableTeleport\">\n <div\n class=\"fixed inset-0 z-50\"\n aria-labelledby=\"modal-title\"\n role=\"dialog\"\n aria-modal=\"true\"\n :class=\"!vis ? 'pointer-events-none' : ''\"\n >\n <Transition\n enter-active-class=\"ease-out duration-300\"\n enter-from-class=\"opacity-0\"\n enter-to-class=\"opacity-100\"\n leave-active-class=\"ease-in duration-200\"\n leave-from-class=\"opacity-100\"\n leave-to-class=\"opacity-0\"\n >\n <div\n v-if=\"vis\"\n class=\"fixed inset-0 bg-theme-800/60 active:bg-theme-800/80 cursor-pointer dark:bg-theme-600/90 backdrop-blur-sm transition-opacity\"\n @click=\"close({ reason: 'escape' })\"\n />\n </Transition>\n <div\n class=\"fixed inset-0 z-40 overflow-y-auto overscroll-contain no-scrollbar\"\n @click=\"close({ reason: 'escape' })\"\n >\n <!-- min-h-full, never h-full: a taller-than-viewport panel must grow this\n row so the outer layer scrolls; h-full + items-center centers the\n overflow and clips the modal top unreachably. p-4 = the 1em minimum\n viewport gap for tall modals. -->\n <div class=\"flex min-h-full items-center justify-center text-center p-4\">\n <Transition v-bind=\"modalTransition\">\n <div\n v-if=\"vis\"\n :class=\"classes\"\n class=\"w-full\"\n @click.stop\n >\n <div\n v-if=\"hasClose || title || $slots.actions\"\n :class=\"!title && (hasClose || $slots.actions) ? 'absolute top-0 right-0 z-10' : 'flex justify-between items-center'\"\n >\n <h2 v-if=\"title\" class=\"text-base p-4 font-semibold\">\n {{ title }}\n </h2>\n <div v-if=\"hasClose || $slots.actions\" class=\"flex items-center gap-2 px-2\">\n <slot name=\"actions\" />\n <FClose\n v-if=\"hasClose\"\n class=\"relative\"\n data-test-id=\"close-modal\"\n @click.stop=\"close({ reason: 'escape' })\"\n />\n </div>\n </div>\n <slot />\n </div>\n </Transition>\n </div>\n </div>\n </div>\n </Teleport>\n</template>\n","<script lang=\"ts\" setup>\nimport { computed, onMounted, onUnmounted, ref, watch } from 'vue'\nimport FClose from './FClose.vue'\n\ndefineOptions({ name: 'FModal' })\n\nconst {\n vis = false,\n modalClass,\n styleClass,\n fullScreen = false,\n hasClose = false,\n title = '',\n transitionMode = 'modal',\n teleportTo = 'body',\n disableTeleport = false,\n} = defineProps<{\n vis?: boolean\n modalClass?: string\n styleClass?: string\n fullScreen?: boolean\n hasClose?: boolean\n title?: string\n transitionMode?: 'modal' | 'slideUp'\n teleportTo?: string | Element\n disableTeleport?: boolean\n}>()\n\nconst emit = defineEmits<{\n 'update:vis': [value: boolean]\n 'close': [value: boolean]\n 'escape': [value: boolean]\n}>()\n\nconst isMounted = ref(false)\n\nfunction close(args: { reason: 'escape' | 'reset' }): void {\n const { reason } = args\n emit('update:vis', false)\n emit('close', true)\n if (reason === 'escape')\n emit('escape', true)\n}\n\nconst classes = computed(() => {\n const cls = modalClass ? [modalClass] : ['max-w-screen-md p-24']\n const style = styleClass ? [styleClass] : ['bg-theme-0', 'shadow-xl']\n\n if (fullScreen)\n cls.push('fixed inset-0')\n else\n cls.push('rounded-2xl')\n\n return [\n 'relative',\n 'text-left',\n 'transform',\n 'transition-all',\n 'w-full',\n 'overflow-hidden',\n ...cls,\n ...style,\n ]\n})\n\nconst afterVisible = ref(false)\nconst cleanups: (() => void)[] = []\n\nfunction onKeydown(event: KeyboardEvent): void {\n if (event.key === 'Escape' && vis)\n close({ reason: 'escape' })\n}\n\nonMounted(async () => {\n isMounted.value = true\n\n const unwatch = watch(\n () => vis,\n (vis) => {\n if (vis) {\n setTimeout(() => (afterVisible.value = true), 300)\n } else {\n afterVisible.value = false\n }\n },\n { immediate: true },\n )\n\n cleanups.push(unwatch)\n\n if (typeof document !== 'undefined') {\n document.addEventListener('keydown', onKeydown)\n cleanups.push(() => document.removeEventListener('keydown', onKeydown))\n }\n})\n\nonUnmounted(() => {\n cleanups.forEach((c) => c())\n})\n\nconst modalTransition = computed(() => {\n if (transitionMode === 'slideUp') {\n return {\n enterActiveClass: 'ease-[cubic-bezier(0.25,1,0.33,1)] duration-500',\n enterFromClass: 'opacity-0 translate-y-full scale-95',\n enterToClass: 'opacity-100 translate-y-0 scale-100',\n leaveActiveClass: 'ease-[cubic-bezier(0.25,1,0.33,1)] duration-500',\n leaveFromClass: 'opacity-100 translate-y-0 scale-100',\n leaveToClass: 'opacity-0 translate-y-full scale-95',\n }\n }\n return {\n enterActiveClass: 'ease-[cubic-bezier(0.25,1,0.33,1)] duration-500',\n enterFromClass: 'opacity-0 scale-75',\n enterToClass: 'opacity-100 translate-y-0 scale-100',\n leaveActiveClass: 'ease-[cubic-bezier(0.25,1,0.33,1)] duration-500',\n leaveFromClass: 'opacity-100 translate-y-0 scale-100',\n leaveToClass: 'opacity-0 scale-75',\n }\n})\n</script>\n\n<script lang=\"ts\">\nexport default {\n inheritAttrs: false,\n}\n</script>\n\n<template>\n <Teleport v-if=\"isMounted\" :to=\"teleportTo\" :disabled=\"disableTeleport\">\n <div\n class=\"fixed inset-0 z-50\"\n aria-labelledby=\"modal-title\"\n role=\"dialog\"\n aria-modal=\"true\"\n :class=\"!vis ? 'pointer-events-none' : ''\"\n >\n <Transition\n enter-active-class=\"ease-out duration-300\"\n enter-from-class=\"opacity-0\"\n enter-to-class=\"opacity-100\"\n leave-active-class=\"ease-in duration-200\"\n leave-from-class=\"opacity-100\"\n leave-to-class=\"opacity-0\"\n >\n <div\n v-if=\"vis\"\n class=\"fixed inset-0 bg-theme-800/60 active:bg-theme-800/80 cursor-pointer dark:bg-theme-600/90 backdrop-blur-sm transition-opacity\"\n @click=\"close({ reason: 'escape' })\"\n />\n </Transition>\n <div\n class=\"fixed inset-0 z-40 overflow-y-auto overscroll-contain no-scrollbar\"\n @click=\"close({ reason: 'escape' })\"\n >\n <!-- min-h-full, never h-full: a taller-than-viewport panel must grow this\n row so the outer layer scrolls; h-full + items-center centers the\n overflow and clips the modal top unreachably. p-4 = the 1em minimum\n viewport gap for tall modals. -->\n <div class=\"flex min-h-full items-center justify-center text-center p-4\">\n <Transition v-bind=\"modalTransition\">\n <div\n v-if=\"vis\"\n :class=\"classes\"\n class=\"w-full\"\n @click.stop\n >\n <div\n v-if=\"hasClose || title || $slots.actions\"\n :class=\"!title && (hasClose || $slots.actions) ? 'absolute top-0 right-0 z-10' : 'flex justify-between items-center'\"\n >\n <h2 v-if=\"title\" class=\"text-base p-4 font-semibold\">\n {{ title }}\n </h2>\n <div v-if=\"hasClose || $slots.actions\" class=\"flex items-center gap-2 px-2\">\n <slot name=\"actions\" />\n <FClose\n v-if=\"hasClose\"\n class=\"relative\"\n data-test-id=\"close-modal\"\n @click.stop=\"close({ reason: 'escape' })\"\n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CJ,OAAM;GACL,SAAK,EAAA,OAAA,EAAA,MAAA,MAAE,MAAK,EAAA,QAAA,SAAA,CAAA;MAMb,EA4BM,OA5BN,GA4BM,CA3BJ,EA0Ba,GAAA,EAAA,EA1BO,EAAA,KAAe,CAAA,GAAA;oBAyB3B,CAvBE,EAAA,OAAA,EAAA,GADR,EAwBM,OAAA;;IAtBH,OAAK,EAAA,CAAE,EAAA,OACF,QAAQ,CAAA;IACb,SAAK,EAAA,OAAA,EAAA,KAAA,QAAN,CAAA,GAAW,CAAA,MAAA,CAAA;OAGH,EAAA,YAAY,EAAA,SAASC,EAAAA,OAAO,WAAA,EAAA,GADpC,EAgBM,OAAA;;IAdH,OAAK,EAAA,CAAG,EAAA,UAAU,EAAA,YAAYA,EAAAA,OAAO,WAAO,gCAAA,mCAAA;OAEnC,EAAA,SAAA,EAAA,GAAV,EAEK,MAFL,GAEK,EADA,EAAA,KAAK,GAAA,CAAA,KAAA,EAAA,IAAA,EAAA,GAEC,EAAA,YAAYA,EAAAA,OAAO,WAAA,EAAA,GAA9B,EAQM,OARN,GAQM,CAPJ,EAAuB,EAAA,QAAA,SAAA,GAEf,EAAA,YAAA,EAAA,GADR,EAKE,GAAA;;IAHA,OAAM;IACN,gBAAa;IACZ,SAAK,EAAA,OAAA,EAAA,KAAA,GAAA,MAAO,MAAK,EAAA,QAAA,SAAA,CAAA,GAAA,CAAA,MAAA,CAAA;qDAIxB,EAAQ,EAAA,QAAA,SAAA,CAAA,GAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,CAAA"}
package/dist/constants.js DELETED
@@ -1,80 +0,0 @@
1
- import "./rolldown-runtime.js";
2
- //#region constants/socialPlatforms.ts
3
- var e = {
4
- linkedin: {
5
- label: "LinkedIn",
6
- icon: "i-simple-icons-linkedin",
7
- placeholder: "john-smith",
8
- getUrl: (e) => `https://linkedin.com/in/${e}`
9
- },
10
- x: {
11
- label: "X",
12
- icon: "i-simple-icons-x",
13
- placeholder: "johnsmith",
14
- getUrl: (e) => `https://x.com/${e}`
15
- },
16
- facebook: {
17
- label: "Facebook",
18
- icon: "i-simple-icons-facebook",
19
- placeholder: "johnsmith",
20
- getUrl: (e) => `https://facebook.com/${e}`
21
- },
22
- tiktok: {
23
- label: "TikTok",
24
- icon: "i-simple-icons-tiktok",
25
- placeholder: "johnsmith",
26
- getUrl: (e) => `https://tiktok.com/@${e}`
27
- },
28
- youtube: {
29
- label: "YouTube",
30
- icon: "i-tabler-brand-youtube",
31
- placeholder: "johnsmith",
32
- getUrl: (e) => `https://youtube.com/@${e}`
33
- },
34
- github: {
35
- label: "GitHub",
36
- icon: "i-tabler-brand-github",
37
- placeholder: "johnsmith",
38
- getUrl: (e) => `https://github.com/${e}`
39
- },
40
- instagram: {
41
- label: "Instagram",
42
- icon: "i-simple-icons-instagram",
43
- placeholder: "johnsmith",
44
- getUrl: (e) => `https://instagram.com/${e}`
45
- },
46
- threads: {
47
- label: "Threads",
48
- icon: "i-simple-icons-threads",
49
- placeholder: "johnsmith",
50
- getUrl: (e) => `https://threads.net/@${e}`
51
- },
52
- email: {
53
- label: "Email",
54
- icon: "i-tabler-mail",
55
- placeholder: "hello@example.com",
56
- getUrl: (e) => `mailto:${e}`
57
- },
58
- phone: {
59
- label: "Phone",
60
- icon: "i-tabler-phone",
61
- placeholder: "+1-555-123-4567",
62
- getUrl: (e) => `tel:${e.replace(/[^0-9+]/g, "")}`
63
- },
64
- website: {
65
- label: "Website",
66
- icon: "i-tabler-world",
67
- placeholder: "https://example.com",
68
- getUrl: (e) => e
69
- },
70
- calendar: {
71
- label: "Calendar",
72
- icon: "i-tabler-calendar",
73
- placeholder: "https://cal.com/username",
74
- getUrl: (e) => e
75
- }
76
- };
77
- //#endregion
78
- export { e as SOCIAL_PLATFORMS };
79
-
80
- //# sourceMappingURL=constants.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.js","names":[],"sources":["../constants/socialPlatforms.ts"],"sourcesContent":["import type { SocialAccount } from '@pagelines/core'\n\n// Extract platform type from schema to ensure type safety\ntype Platform = SocialAccount['platform']\n\n// Platform metadata for URL generation and display\n// TypeScript enforces completeness - must include all platforms from schema\nexport const SOCIAL_PLATFORMS: Record<Platform, {\n label: string\n icon: string\n placeholder: string\n getUrl: (handle: string) => string\n}> = {\n linkedin: {\n label: 'LinkedIn',\n icon: 'i-simple-icons-linkedin',\n placeholder: 'john-smith',\n getUrl: (handle: string) => `https://linkedin.com/in/${handle}`,\n },\n x: {\n label: 'X',\n icon: 'i-simple-icons-x',\n placeholder: 'johnsmith',\n getUrl: (handle: string) => `https://x.com/${handle}`,\n },\n facebook: {\n label: 'Facebook',\n icon: 'i-simple-icons-facebook',\n placeholder: 'johnsmith',\n getUrl: (handle: string) => `https://facebook.com/${handle}`,\n },\n tiktok: {\n label: 'TikTok',\n icon: 'i-simple-icons-tiktok',\n placeholder: 'johnsmith',\n getUrl: (handle: string) => `https://tiktok.com/@${handle}`,\n },\n youtube: {\n label: 'YouTube',\n icon: 'i-tabler-brand-youtube',\n placeholder: 'johnsmith',\n getUrl: (handle: string) => `https://youtube.com/@${handle}`,\n },\n github: {\n label: 'GitHub',\n icon: 'i-tabler-brand-github',\n placeholder: 'johnsmith',\n getUrl: (handle: string) => `https://github.com/${handle}`,\n },\n instagram: {\n label: 'Instagram',\n icon: 'i-simple-icons-instagram',\n placeholder: 'johnsmith',\n getUrl: (handle: string) => `https://instagram.com/${handle}`,\n },\n threads: {\n label: 'Threads',\n icon: 'i-simple-icons-threads',\n placeholder: 'johnsmith',\n getUrl: (handle: string) => `https://threads.net/@${handle}`,\n },\n email: {\n label: 'Email',\n icon: 'i-tabler-mail',\n placeholder: 'hello@example.com',\n getUrl: (handle: string) => `mailto:${handle}`,\n },\n phone: {\n label: 'Phone',\n icon: 'i-tabler-phone',\n placeholder: '+1-555-123-4567',\n getUrl: (handle: string) => `tel:${handle.replace(/[^0-9+]/g, '')}`,\n },\n website: {\n label: 'Website',\n icon: 'i-tabler-world',\n placeholder: 'https://example.com',\n getUrl: (handle: string) => handle, // handle IS the URL\n },\n calendar: {\n label: 'Calendar',\n icon: 'i-tabler-calendar',\n placeholder: 'https://cal.com/username',\n getUrl: (handle: string) => handle, // handle IS the URL (e.g., Cal.com link)\n },\n} as const\n\nexport type SocialPlatform = keyof typeof SOCIAL_PLATFORMS\n"],"mappings":";;AAOA,IAAa,IAKR;CACH,UAAU;EACR,OAAO;EACP,MAAM;EACN,aAAa;EACb,SAAS,MAAmB,2BAA2B;CACzD;CACA,GAAG;EACD,OAAO;EACP,MAAM;EACN,aAAa;EACb,SAAS,MAAmB,iBAAiB;CAC/C;CACA,UAAU;EACR,OAAO;EACP,MAAM;EACN,aAAa;EACb,SAAS,MAAmB,wBAAwB;CACtD;CACA,QAAQ;EACN,OAAO;EACP,MAAM;EACN,aAAa;EACb,SAAS,MAAmB,uBAAuB;CACrD;CACA,SAAS;EACP,OAAO;EACP,MAAM;EACN,aAAa;EACb,SAAS,MAAmB,wBAAwB;CACtD;CACA,QAAQ;EACN,OAAO;EACP,MAAM;EACN,aAAa;EACb,SAAS,MAAmB,sBAAsB;CACpD;CACA,WAAW;EACT,OAAO;EACP,MAAM;EACN,aAAa;EACb,SAAS,MAAmB,yBAAyB;CACvD;CACA,SAAS;EACP,OAAO;EACP,MAAM;EACN,aAAa;EACb,SAAS,MAAmB,wBAAwB;CACtD;CACA,OAAO;EACL,OAAO;EACP,MAAM;EACN,aAAa;EACb,SAAS,MAAmB,UAAU;CACxC;CACA,OAAO;EACL,OAAO;EACP,MAAM;EACN,aAAa;EACb,SAAS,MAAmB,OAAO,EAAO,QAAQ,YAAY,EAAE;CAClE;CACA,SAAS;EACP,OAAO;EACP,MAAM;EACN,aAAa;EACb,SAAS,MAAmB;CAC9B;CACA,UAAU;EACR,OAAO;EACP,MAAM;EACN,aAAa;EACb,SAAS,MAAmB;CAC9B;AACF"}