@inpageedit/core 0.6.0 → 0.7.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/IconQuickEdit-YVn1ANbm.js +27 -0
- package/dist/IconQuickEdit-YVn1ANbm.js.map +1 -0
- package/dist/InPageEdit.d.ts +7 -5
- package/dist/components/Icon/IconEdit.d.ts +2 -0
- package/dist/components/Icon/IconQuickEdit.d.ts +2 -0
- package/dist/components/MwUserLinks.d.ts +2 -0
- package/dist/index-1JtE4urY.js +1256 -0
- package/dist/{index-5zB57uWM.js.map → index-1JtE4urY.js.map} +1 -1
- package/dist/{index-CPCQc37I.js → index-2AEdgbUL.js} +4 -4
- package/dist/index-2AEdgbUL.js.map +1 -0
- package/dist/index-2kN4SKmT.js +116 -0
- package/dist/index-2kN4SKmT.js.map +1 -0
- package/dist/{index-BqqQgaGG.js → index-B3Bsg_nE.js} +5 -4
- package/dist/index-B3Bsg_nE.js.map +1 -0
- package/dist/{index-clwjxJi5.js → index-BCMwmSfQ.js} +2 -2
- package/dist/{index-clwjxJi5.js.map → index-BCMwmSfQ.js.map} +1 -1
- package/dist/{index-ClYojws9.js → index-C0ci6Ll1.js} +3 -2
- package/dist/index-C0ci6Ll1.js.map +1 -0
- package/dist/{index-BHruEVsx.js → index-CZnu6cRK.js} +2 -2
- package/dist/{index-BHruEVsx.js.map → index-CZnu6cRK.js.map} +1 -1
- package/dist/{index-B7Ok-t-3.js → index-CheNjwas.js} +2 -2
- package/dist/{index-B7Ok-t-3.js.map → index-CheNjwas.js.map} +1 -1
- package/dist/{index-SDBp__LY.js → index-CrWxZ0yl.js} +66 -63
- package/dist/{index-SDBp__LY.js.map → index-CrWxZ0yl.js.map} +1 -1
- package/dist/{index-BnRuHI16.js → index-DqfQ7hp6.js} +1018 -925
- package/dist/index-DqfQ7hp6.js.map +1 -0
- package/dist/index-sfkutNHj.js +201 -0
- package/dist/index-sfkutNHj.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/models/WikiTitle/index.d.ts +1 -0
- package/dist/plugins/in-article-links/index.d.ts +19 -1
- package/dist/plugins/quick-diff/PluginQuickDiffCore.d.ts +2 -0
- package/dist/plugins/quick-diff/components/DiffTable.d.ts +17 -0
- package/dist/plugins/quick-preview/index.d.ts +2 -2
- package/dist/services/ApiService.d.ts +2 -2
- package/dist/services/ModalService/IPEModal.d.ts +1 -1
- package/dist/services/SiteMetadataService.d.ts +36 -1
- package/dist/style.css +1 -1
- package/dist/utils/url.d.ts +24 -0
- package/lib/index.umd.js +28 -28
- package/lib/index.umd.js.map +1 -1
- package/lib/style.css +1 -1
- package/package.json +10 -1
- package/dist/index-5zB57uWM.js +0 -1142
- package/dist/index-BnRuHI16.js.map +0 -1
- package/dist/index-BqqQgaGG.js.map +0 -1
- package/dist/index-Bs5MFAHs.js +0 -110
- package/dist/index-Bs5MFAHs.js.map +0 -1
- package/dist/index-C9QOZJ8o.js +0 -167
- package/dist/index-C9QOZJ8o.js.map +0 -1
- package/dist/index-CPCQc37I.js.map +0 -1
- package/dist/index-ClYojws9.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-B7Ok-t-3.js","sources":["../src/plugins/toolbox/index.tsx"],"sourcesContent":["import { Inject, InPageEdit, Schema, Service } from '@/InPageEdit'\nimport { ReactElement } from 'jsx-dom'\nimport './styles.scss'\n\ndeclare module '@/InPageEdit' {\n interface InPageEdit {\n toolbox: PluginToolbox\n }\n interface Events {\n 'toolbox/button-added'(payload: { ctx: InPageEdit; button: HTMLElement }): void\n 'toolbox/button-removed'(payload: { ctx: InPageEdit; id: string }): void\n }\n}\n\n@RegisterPreferences(\n Schema.object({\n toolboxAlwaysShow: Schema.boolean()\n .description('Make the toolbox opened by default')\n .default(false),\n }).description('Toolbox preferences')\n)\n@Inject(['preferences'])\nexport class PluginToolbox extends Service {\n container!: HTMLElement\n\n constructor(public ctx: InPageEdit) {\n super(ctx, 'toolbox', false)\n }\n\n protected async start(): Promise<void> {\n this.container = this.createToolbox()\n this.ctx.preferences.get('toolboxAlwaysShow').then((val) => {\n if (val) {\n this.container.classList.add('is-persistent')\n }\n })\n this.setupHoverLogic()\n document.body.appendChild(this.container)\n\n // 初始化时更新按钮延迟\n this.updateButtonDelays()\n }\n\n protected stop(): void | Promise<void> {\n this.container?.remove()\n }\n\n private setupHoverLogic() {\n let hoverTimeout: number | null = null\n\n // 检查是否处于持久化状态的辅助函数\n const isPersistent = () => {\n return this.container.classList.contains('is-persistent')\n }\n\n // 鼠标进入时暂时展开\n this.container.addEventListener('mouseenter', () => {\n if (hoverTimeout) {\n clearTimeout(hoverTimeout)\n hoverTimeout = null\n }\n\n // 如果不在持久化状态,则添加hover展开效果\n if (!isPersistent()) {\n this.container.classList.add('is-hovered')\n }\n })\n\n // 鼠标离开时收起(如果不是持久化状态)\n this.container.addEventListener('mouseleave', () => {\n if (!isPersistent()) {\n hoverTimeout = window.setTimeout(() => {\n this.container.classList.remove('is-hovered')\n }, 150) // 延迟150ms收起,避免快速移动鼠标时闪烁\n }\n })\n }\n\n /**\n * 计算按钮动画延迟\n * @param index 按钮索引(从0开始)\n * @param totalCount 总按钮数量\n * @returns 延迟时间(秒)\n */\n private calculateButtonDelay(index: number, totalCount: number): number {\n if (totalCount <= 1) return 0\n\n // 总动画时长150ms = 0.15s\n const totalDuration = 0.15\n // 使用平方根函数创建非线性延迟,差值逐渐缩小\n const normalizedIndex = index / (totalCount - 1)\n const delay = totalDuration * Math.sqrt(normalizedIndex)\n\n return Math.round(delay * 1000) / 1000 // 保留3位小数\n }\n\n /**\n * 更新按钮组的动画延迟\n */\n private updateButtonDelays() {\n const btnGroups = this.container.querySelectorAll('.btn-group')\n\n btnGroups.forEach((group) => {\n const buttons = group.querySelectorAll('.btn-tip-group')\n const totalCount = buttons.length\n\n buttons.forEach((button, index) => {\n const delay = this.calculateButtonDelay(index, totalCount)\n ;(button as HTMLElement).style.setProperty('--transition-delay', `${delay}s`)\n ;(button as HTMLElement).style.setProperty('--max-transition-delay', '0.15s')\n })\n })\n }\n\n private createToolbox() {\n const toggler = (\n <button\n className=\"ipe-toolbox-btn\"\n id=\"toolbox-toggler\"\n onClick={() => {\n const isPersistent = this.container.classList.contains('is-persistent')\n const newPersistent = !isPersistent\n this.container.classList.toggle('is-persistent', newPersistent)\n this.ctx.preferences.set('toolboxAlwaysShow', newPersistent)\n }}\n >\n {/* Font Awesome 5 Solid: Plus */}\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"448\" height=\"512\" viewBox=\"0 0 448 512\">\n <rect width=\"448\" height=\"512\" fill=\"none\" />\n <path\n fill=\"currentColor\"\n d=\"M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32\"\n />\n </svg>\n </button>\n )\n const element = (\n <div id=\"ipe-edit-toolbox\">\n <ul className=\"btn-group group1\" style={{ display: 'flex', flexDirection: 'column' }}></ul>\n <ul className=\"btn-group group2\" style={{ display: 'flex', flexDirection: 'row' }}></ul>\n {toggler}\n </div>\n )\n\n return element as HTMLElement\n }\n\n private normalizeButtonId(id: string) {\n if (!id) {\n id = Math.random().toString(36).substring(2, 8)\n }\n return `ipe-toolbox__${id.trim()}`.replace(/\\s\\.#/g, '-')\n }\n\n addButton(payload: {\n id: string\n group?: 'auto' | 'group1' | 'group2'\n icon: string | HTMLElement | SVGElement | ReactElement\n tooltip?: string | HTMLElement\n buttonProps?: Record<string, any>\n onClick?: (event: MouseEvent) => void\n index?: number\n }) {\n let { id, group, icon, tooltip, buttonProps, onClick, index } = payload\n id = this.normalizeButtonId(id)\n\n const existingButton = this.container.querySelector(`#${id}`)\n if (existingButton) {\n this.ctx.logger('toolbox').warn(`Button with id ${id} already exists, replacing it.`)\n existingButton.remove()\n }\n\n let groupEl: HTMLElement | null = null\n if (typeof group === 'undefined' || group === 'auto') {\n // 选择按钮最少的那一组,一样多就选第一组\n const group1 = this.container.querySelector('.btn-group.group1') as HTMLElement\n const group2 = this.container.querySelector('.btn-group.group2') as HTMLElement\n const group1Count = group1?.children.length || 0\n const group2Count = group2?.children.length || 0\n groupEl = group1Count <= group2Count ? group1 : group2\n } else {\n groupEl = this.container.querySelector(`.btn-group.${group}`)\n }\n if (!groupEl) throw new Error(`Button group ${group} not found`)\n\n const button = (\n <li class=\"btn-tip-group\" id={id} onClick={onClick}>\n <div class=\"btn-tip\">{tooltip}</div>\n <button id={`${id}-btn`} class=\"ipe-toolbox-btn\" {...buttonProps}>\n {icon}\n </button>\n </li>\n )\n\n if (typeof index === 'number') {\n if (index <= 0) {\n groupEl.prepend(button)\n } else if (index >= groupEl.children.length) {\n groupEl.appendChild(button)\n } else {\n groupEl.children[index]?.before(button)\n }\n } else {\n groupEl.appendChild(button)\n }\n\n this.ctx.emit('toolbox/button-added', {\n ctx: this.ctx,\n button: button as HTMLElement,\n })\n\n // 更新按钮延迟\n this.updateButtonDelays()\n\n return button as HTMLElement\n }\n\n removeButton(id: string) {\n const button = this.container.querySelector(`.ipe-toolbox-btn#${id}`)\n button?.remove()\n this.ctx.emit('toolbox/button-removed', { ctx: this.ctx, id })\n\n // 更新按钮延迟\n this.updateButtonDelays()\n }\n}\n"],"names":["_PluginToolbox_decorators","_init","_a","RegisterPreferences","Schema","Inject","PluginToolbox","Service","ctx","val","hoverTimeout","isPersistent","index","totalCount","totalDuration","normalizedIndex","delay","group","buttons","button","jsxs","jsx","newPersistent","id","payload","icon","tooltip","buttonProps","onClick","existingButton","groupEl","group1","group2","group1Count","group2Count","__decoratorStart","__decorateElement","__runInitializers"],"mappings":";;;;;;;;;;;;;;GAAAA,GAAAC,GAAAC;AAcAF,IAAA,CAACG;AAAA,EACCC,EAAO,OAAO;AAAA,IACZ,mBAAmBA,EAAO,QAAA,EACvB,YAAY,oCAAoC,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QAAQ,OAAM,mBAAmB,GAAGI,GAClD,UAAAF,EAAA,CACH;AAAA,IAAA,GACF;AAGF,WAAI,OAAOb,KAAU,WACfA,KAAS,IACXkB,EAAQ,QAAQX,CAAM,IACbP,KAASkB,EAAQ,SAAS,SACnCA,EAAQ,YAAYX,CAAM,IAE1BW,EAAQ,SAASlB,CAAK,GAAG,OAAOO,CAAM,IAGxCW,EAAQ,YAAYX,CAAM,GAG5B,KAAK,IAAI,KAAK,wBAAwB;AAAA,MACpC,KAAK,KAAK;AAAA,MACV,QAAAA;AAAA,IAAA,CACD,GAGD,KAAK,mBAAA,GAEEA;AAAA,EACT;AAAA,EAEA,aAAaI,GAAY;AAEvB,IADe,KAAK,UAAU,cAAc,oBAAoBA,CAAE,EAAE,GAC5D,OAAA,GACR,KAAK,IAAI,KAAK,0BAA0B,EAAE,KAAK,KAAK,KAAK,IAAAA,GAAI,GAG7D,KAAK,mBAAA;AAAA,EACP;AACF;AA3MOtB,IAAAkC,EAAAjC,CAAA;AAAMI,IAAN8B,yBARPpC,GAQaM,CAAA;AAAN+B,EAAApC,GAAA,GAAMK,CAAA;"}
|
|
1
|
+
{"version":3,"file":"index-CheNjwas.js","sources":["../src/plugins/toolbox/index.tsx"],"sourcesContent":["import { Inject, InPageEdit, Schema, Service } from '@/InPageEdit'\nimport { ReactElement } from 'jsx-dom'\nimport './styles.scss'\n\ndeclare module '@/InPageEdit' {\n interface InPageEdit {\n toolbox: PluginToolbox\n }\n interface Events {\n 'toolbox/button-added'(payload: { ctx: InPageEdit; button: HTMLElement }): void\n 'toolbox/button-removed'(payload: { ctx: InPageEdit; id: string }): void\n }\n}\n\n@RegisterPreferences(\n Schema.object({\n toolboxAlwaysShow: Schema.boolean()\n .description('Make the toolbox opened by default')\n .default(false),\n }).description('Toolbox preferences')\n)\n@Inject(['preferences'])\nexport class PluginToolbox extends Service {\n container!: HTMLElement\n\n constructor(public ctx: InPageEdit) {\n super(ctx, 'toolbox', false)\n }\n\n protected async start(): Promise<void> {\n this.container = this.createToolbox()\n this.ctx.preferences.get('toolboxAlwaysShow').then((val) => {\n if (val) {\n this.container.classList.add('is-persistent')\n }\n })\n this.setupHoverLogic()\n document.body.appendChild(this.container)\n\n // 初始化时更新按钮延迟\n this.updateButtonDelays()\n }\n\n protected stop(): void | Promise<void> {\n this.container?.remove()\n }\n\n private setupHoverLogic() {\n let hoverTimeout: number | null = null\n\n // 检查是否处于持久化状态的辅助函数\n const isPersistent = () => {\n return this.container.classList.contains('is-persistent')\n }\n\n // 鼠标进入时暂时展开\n this.container.addEventListener('mouseenter', () => {\n if (hoverTimeout) {\n clearTimeout(hoverTimeout)\n hoverTimeout = null\n }\n\n // 如果不在持久化状态,则添加hover展开效果\n if (!isPersistent()) {\n this.container.classList.add('is-hovered')\n }\n })\n\n // 鼠标离开时收起(如果不是持久化状态)\n this.container.addEventListener('mouseleave', () => {\n if (!isPersistent()) {\n hoverTimeout = window.setTimeout(() => {\n this.container.classList.remove('is-hovered')\n }, 150) // 延迟150ms收起,避免快速移动鼠标时闪烁\n }\n })\n }\n\n /**\n * 计算按钮动画延迟\n * @param index 按钮索引(从0开始)\n * @param totalCount 总按钮数量\n * @returns 延迟时间(秒)\n */\n private calculateButtonDelay(index: number, totalCount: number): number {\n if (totalCount <= 1) return 0\n\n // 总动画时长150ms = 0.15s\n const totalDuration = 0.15\n // 使用平方根函数创建非线性延迟,差值逐渐缩小\n const normalizedIndex = index / (totalCount - 1)\n const delay = totalDuration * Math.sqrt(normalizedIndex)\n\n return Math.round(delay * 1000) / 1000 // 保留3位小数\n }\n\n /**\n * 更新按钮组的动画延迟\n */\n private updateButtonDelays() {\n const btnGroups = this.container.querySelectorAll('.btn-group')\n\n btnGroups.forEach((group) => {\n const buttons = group.querySelectorAll('.btn-tip-group')\n const totalCount = buttons.length\n\n buttons.forEach((button, index) => {\n const delay = this.calculateButtonDelay(index, totalCount)\n ;(button as HTMLElement).style.setProperty('--transition-delay', `${delay}s`)\n ;(button as HTMLElement).style.setProperty('--max-transition-delay', '0.15s')\n })\n })\n }\n\n private createToolbox() {\n const toggler = (\n <button\n className=\"ipe-toolbox-btn\"\n id=\"toolbox-toggler\"\n onClick={() => {\n const isPersistent = this.container.classList.contains('is-persistent')\n const newPersistent = !isPersistent\n this.container.classList.toggle('is-persistent', newPersistent)\n this.ctx.preferences.set('toolboxAlwaysShow', newPersistent)\n }}\n >\n {/* Font Awesome 5 Solid: Plus */}\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"448\" height=\"512\" viewBox=\"0 0 448 512\">\n <rect width=\"448\" height=\"512\" fill=\"none\" />\n <path\n fill=\"currentColor\"\n d=\"M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32\"\n />\n </svg>\n </button>\n )\n const element = (\n <div id=\"ipe-edit-toolbox\">\n <ul className=\"btn-group group1\" style={{ display: 'flex', flexDirection: 'column' }}></ul>\n <ul className=\"btn-group group2\" style={{ display: 'flex', flexDirection: 'row' }}></ul>\n {toggler}\n </div>\n )\n\n return element as HTMLElement\n }\n\n private normalizeButtonId(id: string) {\n if (!id) {\n id = Math.random().toString(36).substring(2, 8)\n }\n return `ipe-toolbox__${id.trim()}`.replace(/\\s\\.#/g, '-')\n }\n\n addButton(payload: {\n id: string\n group?: 'auto' | 'group1' | 'group2'\n icon: string | HTMLElement | SVGElement | ReactElement\n tooltip?: string | HTMLElement\n buttonProps?: Record<string, any>\n onClick?: (event: MouseEvent) => void\n index?: number\n }) {\n let { id, group, icon, tooltip, buttonProps, onClick, index } = payload\n id = this.normalizeButtonId(id)\n\n const existingButton = this.container.querySelector(`#${id}`)\n if (existingButton) {\n this.ctx.logger('toolbox').warn(`Button with id ${id} already exists, replacing it.`)\n existingButton.remove()\n }\n\n let groupEl: HTMLElement | null = null\n if (typeof group === 'undefined' || group === 'auto') {\n // 选择按钮最少的那一组,一样多就选第一组\n const group1 = this.container.querySelector('.btn-group.group1') as HTMLElement\n const group2 = this.container.querySelector('.btn-group.group2') as HTMLElement\n const group1Count = group1?.children.length || 0\n const group2Count = group2?.children.length || 0\n groupEl = group1Count <= group2Count ? group1 : group2\n } else {\n groupEl = this.container.querySelector(`.btn-group.${group}`)\n }\n if (!groupEl) throw new Error(`Button group ${group} not found`)\n\n const button = (\n <li class=\"btn-tip-group\" id={id} onClick={onClick}>\n <div class=\"btn-tip\">{tooltip}</div>\n <button id={`${id}-btn`} class=\"ipe-toolbox-btn\" {...buttonProps}>\n {icon}\n </button>\n </li>\n )\n\n if (typeof index === 'number') {\n if (index <= 0) {\n groupEl.prepend(button)\n } else if (index >= groupEl.children.length) {\n groupEl.appendChild(button)\n } else {\n groupEl.children[index]?.before(button)\n }\n } else {\n groupEl.appendChild(button)\n }\n\n this.ctx.emit('toolbox/button-added', {\n ctx: this.ctx,\n button: button as HTMLElement,\n })\n\n // 更新按钮延迟\n this.updateButtonDelays()\n\n return button as HTMLElement\n }\n\n removeButton(id: string) {\n const button = this.container.querySelector(`.ipe-toolbox-btn#${id}`)\n button?.remove()\n this.ctx.emit('toolbox/button-removed', { ctx: this.ctx, id })\n\n // 更新按钮延迟\n this.updateButtonDelays()\n }\n}\n"],"names":["_PluginToolbox_decorators","_init","_a","RegisterPreferences","Schema","Inject","PluginToolbox","Service","ctx","val","hoverTimeout","isPersistent","index","totalCount","totalDuration","normalizedIndex","delay","group","buttons","button","jsxs","jsx","newPersistent","id","payload","icon","tooltip","buttonProps","onClick","existingButton","groupEl","group1","group2","group1Count","group2Count","__decoratorStart","__decorateElement","__runInitializers"],"mappings":";;;;;;;;;;;;;;GAAAA,GAAAC,GAAAC;AAcAF,IAAA,CAACG;AAAA,EACCC,EAAO,OAAO;AAAA,IACZ,mBAAmBA,EAAO,QAAA,EACvB,YAAY,oCAAoC,EAChD,Q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OAAM,mBAAmB,GAAGI,GAClD,UAAAF,EAAA,CACH;AAAA,IAAA,GACF;AAGF,WAAI,OAAOb,KAAU,WACfA,KAAS,IACXkB,EAAQ,QAAQX,CAAM,IACbP,KAASkB,EAAQ,SAAS,SACnCA,EAAQ,YAAYX,CAAM,IAE1BW,EAAQ,SAASlB,CAAK,GAAG,OAAOO,CAAM,IAGxCW,EAAQ,YAAYX,CAAM,GAG5B,KAAK,IAAI,KAAK,wBAAwB;AAAA,MACpC,KAAK,KAAK;AAAA,MACV,QAAAA;AAAA,IAAA,CACD,GAGD,KAAK,mBAAA,GAEEA;AAAA,EACT;AAAA,EAEA,aAAaI,GAAY;AAEvB,IADe,KAAK,UAAU,cAAc,oBAAoBA,CAAE,EAAE,GAC5D,OAAA,GACR,KAAK,IAAI,KAAK,0BAA0B,EAAE,KAAK,KAAK,KAAK,IAAAA,GAAI,GAG7D,KAAK,mBAAA;AAAA,EACP;AACF;AA3MOtB,IAAAkC,EAAAjC,CAAA;AAAMI,IAAN8B,yBARPpC,GAQaM,CAAA;AAAN+B,EAAApC,GAAA,GAAMK,CAAA;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { B as Ni, I as Di } from "./index-
|
|
1
|
+
import { j as Ge, P as Fi, F as Ri } from "./index-CvhkVj_L.js";
|
|
2
|
+
import { B as Ni, I as Di } from "./index-DqfQ7hp6.js";
|
|
3
3
|
/**
|
|
4
4
|
* @vue/shared v3.5.22
|
|
5
5
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
@@ -391,7 +391,7 @@ function yr(e) {
|
|
|
391
391
|
s !== e && (e.prevSub = s, s && (s.nextSub = e)), e.dep.subs = e;
|
|
392
392
|
}
|
|
393
393
|
}
|
|
394
|
-
const Ns = /* @__PURE__ */ new WeakMap(),
|
|
394
|
+
const Ns = /* @__PURE__ */ new WeakMap(), et = Symbol(
|
|
395
395
|
""
|
|
396
396
|
), Ds = Symbol(
|
|
397
397
|
""
|
|
@@ -427,13 +427,13 @@ function Fe(e, t, s, n, r, i) {
|
|
|
427
427
|
} else
|
|
428
428
|
switch ((s !== void 0 || o.has(void 0)) && l(o.get(s)), h && l(o.get(Nt)), t) {
|
|
429
429
|
case "add":
|
|
430
|
-
c ? h && l(o.get("length")) : (l(o.get(
|
|
430
|
+
c ? h && l(o.get("length")) : (l(o.get(et)), ct(e) && l(o.get(Ds)));
|
|
431
431
|
break;
|
|
432
432
|
case "delete":
|
|
433
|
-
c || (l(o.get(
|
|
433
|
+
c || (l(o.get(et)), ct(e) && l(o.get(Ds)));
|
|
434
434
|
break;
|
|
435
435
|
case "set":
|
|
436
|
-
ct(e) && l(o.get(
|
|
436
|
+
ct(e) && l(o.get(et));
|
|
437
437
|
break;
|
|
438
438
|
}
|
|
439
439
|
}
|
|
@@ -661,7 +661,7 @@ class Sr extends Cr {
|
|
|
661
661
|
return te(
|
|
662
662
|
t,
|
|
663
663
|
"iterate",
|
|
664
|
-
M(t) ? "length" :
|
|
664
|
+
M(t) ? "length" : et
|
|
665
665
|
), Reflect.ownKeys(t);
|
|
666
666
|
}
|
|
667
667
|
}
|
|
@@ -684,7 +684,7 @@ function oo(e, t, s) {
|
|
|
684
684
|
return !t && te(
|
|
685
685
|
i,
|
|
686
686
|
"iterate",
|
|
687
|
-
c ? Ds :
|
|
687
|
+
c ? Ds : et
|
|
688
688
|
), {
|
|
689
689
|
// iterator protocol
|
|
690
690
|
next() {
|
|
@@ -720,7 +720,7 @@ function lo(e, t) {
|
|
|
720
720
|
},
|
|
721
721
|
get size() {
|
|
722
722
|
const r = this.__v_raw;
|
|
723
|
-
return !e && te(j(r), "iterate",
|
|
723
|
+
return !e && te(j(r), "iterate", et), r.size;
|
|
724
724
|
},
|
|
725
725
|
has(r) {
|
|
726
726
|
const i = this.__v_raw, o = j(i), l = j(r);
|
|
@@ -728,7 +728,7 @@ function lo(e, t) {
|
|
|
728
728
|
},
|
|
729
729
|
forEach(r, i) {
|
|
730
730
|
const o = this, l = o.__v_raw, c = j(l), h = t ? Ls : e ? Qt : X;
|
|
731
|
-
return !e && te(c, "iterate",
|
|
731
|
+
return !e && te(c, "iterate", et), l.forEach((u, d) => r.call(i, h(u), h(d), o));
|
|
732
732
|
}
|
|
733
733
|
};
|
|
734
734
|
return ee(
|
|
@@ -951,8 +951,8 @@ function Co(e, t, s = !1) {
|
|
|
951
951
|
return F(e) ? n = e : (n = e.get, r = e.set), new xo(n, r, s);
|
|
952
952
|
}
|
|
953
953
|
const zt = {}, es = /* @__PURE__ */ new WeakMap();
|
|
954
|
-
let
|
|
955
|
-
function So(e, t = !1, s =
|
|
954
|
+
let Xe;
|
|
955
|
+
function So(e, t = !1, s = Xe) {
|
|
956
956
|
if (s) {
|
|
957
957
|
let n = es.get(s);
|
|
958
958
|
n || es.set(s, n = []), n.push(e);
|
|
@@ -977,12 +977,12 @@ function wo(e, t, s = H) {
|
|
|
977
977
|
De();
|
|
978
978
|
}
|
|
979
979
|
}
|
|
980
|
-
const T =
|
|
981
|
-
|
|
980
|
+
const T = Xe;
|
|
981
|
+
Xe = u;
|
|
982
982
|
try {
|
|
983
983
|
return c ? c(e, 3, [v]) : e(v);
|
|
984
984
|
} finally {
|
|
985
|
-
|
|
985
|
+
Xe = T;
|
|
986
986
|
}
|
|
987
987
|
} : d = $e, t && r) {
|
|
988
988
|
const T = d, R = r === !0 ? 1 / 0 : r;
|
|
@@ -1004,8 +1004,8 @@ function wo(e, t, s = H) {
|
|
|
1004
1004
|
const R = u.run();
|
|
1005
1005
|
if (r || C || ($ ? R.some((B, Y) => ae(B, N[Y])) : ae(R, N))) {
|
|
1006
1006
|
p && p();
|
|
1007
|
-
const B =
|
|
1008
|
-
|
|
1007
|
+
const B = Xe;
|
|
1008
|
+
Xe = u;
|
|
1009
1009
|
try {
|
|
1010
1010
|
const Y = [
|
|
1011
1011
|
R,
|
|
@@ -1018,7 +1018,7 @@ function wo(e, t, s = H) {
|
|
|
1018
1018
|
t(...Y)
|
|
1019
1019
|
);
|
|
1020
1020
|
} finally {
|
|
1021
|
-
|
|
1021
|
+
Xe = B;
|
|
1022
1022
|
}
|
|
1023
1023
|
}
|
|
1024
1024
|
} else
|
|
@@ -1207,7 +1207,7 @@ function Ao(e, t = Te, s) {
|
|
|
1207
1207
|
};
|
|
1208
1208
|
return n._n = !0, n._c = !0, n._d = !0, n;
|
|
1209
1209
|
}
|
|
1210
|
-
function
|
|
1210
|
+
function Ye(e, t, s, n) {
|
|
1211
1211
|
const r = e.dirs, i = t && t.dirs;
|
|
1212
1212
|
for (let o = 0; o < r.length; o++) {
|
|
1213
1213
|
const l = r[o];
|
|
@@ -1534,9 +1534,9 @@ function Ko(e) {
|
|
|
1534
1534
|
serverPrefetch: qe,
|
|
1535
1535
|
// public API
|
|
1536
1536
|
expose: Pe,
|
|
1537
|
-
inheritAttrs:
|
|
1537
|
+
inheritAttrs: st,
|
|
1538
1538
|
// assets
|
|
1539
|
-
components:
|
|
1539
|
+
components: nt,
|
|
1540
1540
|
directives: Vt,
|
|
1541
1541
|
filters: ys
|
|
1542
1542
|
} = t;
|
|
@@ -1586,7 +1586,7 @@ function Ko(e) {
|
|
|
1586
1586
|
});
|
|
1587
1587
|
});
|
|
1588
1588
|
} else e.exposed || (e.exposed = {});
|
|
1589
|
-
R && e.render === $e && (e.render = R),
|
|
1589
|
+
R && e.render === $e && (e.render = R), st != null && (e.inheritAttrs = st), nt && (e.components = nt), Vt && (e.directives = Vt), qe && Dr(e);
|
|
1590
1590
|
}
|
|
1591
1591
|
function Wo(e, t, s = $e) {
|
|
1592
1592
|
M(e) && (e = Bs(e));
|
|
@@ -2079,7 +2079,7 @@ function rl(e, t) {
|
|
|
2079
2079
|
a == null && N(f, m, b, w);
|
|
2080
2080
|
break;
|
|
2081
2081
|
case me:
|
|
2082
|
-
|
|
2082
|
+
nt(
|
|
2083
2083
|
a,
|
|
2084
2084
|
f,
|
|
2085
2085
|
m,
|
|
@@ -2198,15 +2198,15 @@ function rl(e, t) {
|
|
|
2198
2198
|
Is(a, _),
|
|
2199
2199
|
w,
|
|
2200
2200
|
S
|
|
2201
|
-
), O &&
|
|
2201
|
+
), O && Ye(a, null, b, "created"), Y(x, a, a.scopeId, w, b), I) {
|
|
2202
2202
|
for (const W in I)
|
|
2203
2203
|
W !== "value" && !Et(W) && i(x, W, null, I[W], _, b);
|
|
2204
2204
|
"value" in I && i(x, "value", null, I.value, _), (y = I.onVnodeBeforeMount) && Se(y, b, a);
|
|
2205
2205
|
}
|
|
2206
|
-
O &&
|
|
2206
|
+
O && Ye(a, null, b, "beforeMount");
|
|
2207
2207
|
const L = il(g, A);
|
|
2208
2208
|
L && A.beforeEnter(x), n(x, f, m), ((y = I && I.onVnodeMounted) || L || O) && fe(() => {
|
|
2209
|
-
y && Se(y, b, a), L && A.enter(x), O &&
|
|
2209
|
+
y && Se(y, b, a), L && A.enter(x), O && Ye(a, null, b, "mounted");
|
|
2210
2210
|
}, g);
|
|
2211
2211
|
}, Y = (a, f, m, b, g) => {
|
|
2212
2212
|
if (m && v(a, m), b)
|
|
@@ -2246,7 +2246,7 @@ function rl(e, t) {
|
|
|
2246
2246
|
x |= a.patchFlag & 16;
|
|
2247
2247
|
const E = a.props || H, A = f.props || H;
|
|
2248
2248
|
let O;
|
|
2249
|
-
if (m &&
|
|
2249
|
+
if (m && Ze(m, !1), (O = A.onVnodeBeforeUpdate) && Se(O, m, f, a), I && Ye(f, a, m, "beforeUpdate"), m && Ze(m, !0), (E.innerHTML && A.innerHTML == null || E.textContent && A.textContent == null) && u(S, ""), y ? Pe(
|
|
2250
2250
|
a.dynamicChildren,
|
|
2251
2251
|
y,
|
|
2252
2252
|
S,
|
|
@@ -2266,7 +2266,7 @@ function rl(e, t) {
|
|
|
2266
2266
|
!1
|
|
2267
2267
|
), x > 0) {
|
|
2268
2268
|
if (x & 16)
|
|
2269
|
-
|
|
2269
|
+
st(S, E, A, m, g);
|
|
2270
2270
|
else if (x & 2 && E.class !== A.class && i(S, "class", null, A.class, g), x & 4 && i(S, "style", E.style, A.style, g), x & 8) {
|
|
2271
2271
|
const L = f.dynamicProps;
|
|
2272
2272
|
for (let W = 0; W < L.length; W++) {
|
|
@@ -2275,9 +2275,9 @@ function rl(e, t) {
|
|
|
2275
2275
|
}
|
|
2276
2276
|
}
|
|
2277
2277
|
x & 1 && a.children !== f.children && u(S, f.children);
|
|
2278
|
-
} else !w && y == null &&
|
|
2278
|
+
} else !w && y == null && st(S, E, A, m, g);
|
|
2279
2279
|
((O = A.onVnodeUpdated) || I) && fe(() => {
|
|
2280
|
-
O && Se(O, m, f, a), I &&
|
|
2280
|
+
O && Se(O, m, f, a), I && Ye(f, a, m, "updated");
|
|
2281
2281
|
}, b);
|
|
2282
2282
|
}, Pe = (a, f, m, b, g, _, w) => {
|
|
2283
2283
|
for (let S = 0; S < f.length; S++) {
|
|
@@ -2307,7 +2307,7 @@ function rl(e, t) {
|
|
|
2307
2307
|
!0
|
|
2308
2308
|
);
|
|
2309
2309
|
}
|
|
2310
|
-
},
|
|
2310
|
+
}, st = (a, f, m, b, g) => {
|
|
2311
2311
|
if (f !== m) {
|
|
2312
2312
|
if (f !== H)
|
|
2313
2313
|
for (const _ in f)
|
|
@@ -2326,7 +2326,7 @@ function rl(e, t) {
|
|
|
2326
2326
|
}
|
|
2327
2327
|
"value" in m && i(a, "value", f.value, m.value, g);
|
|
2328
2328
|
}
|
|
2329
|
-
},
|
|
2329
|
+
}, nt = (a, f, m, b, g, _, w, S, x) => {
|
|
2330
2330
|
const y = f.el = a ? a.el : l(""), I = f.anchor = a ? a.anchor : l("");
|
|
2331
2331
|
let { patchFlag: E, dynamicChildren: A, slotScopeIds: O } = f;
|
|
2332
2332
|
O && (S = S ? S.concat(O) : O), a == null ? (n(y, m, b), n(I, m, b), ve(
|
|
@@ -2433,7 +2433,7 @@ function rl(e, t) {
|
|
|
2433
2433
|
}
|
|
2434
2434
|
}
|
|
2435
2435
|
let k = E, oe;
|
|
2436
|
-
|
|
2436
|
+
Ze(a, !1), E ? (E.el = W.el, J(a, E, w)) : E = W, A && Ss(A), (oe = E.props && E.props.onVnodeBeforeUpdate) && Se(oe, L, E, W), Ze(a, !0);
|
|
2437
2437
|
const le = Hn(a), ye = a.subTree;
|
|
2438
2438
|
a.subTree = le, $(
|
|
2439
2439
|
ye,
|
|
@@ -2452,7 +2452,7 @@ function rl(e, t) {
|
|
|
2452
2452
|
} else {
|
|
2453
2453
|
let E;
|
|
2454
2454
|
const { el: A, props: O } = f, { bm: L, m: W, parent: k, root: oe, type: le } = a, ye = It(f);
|
|
2455
|
-
|
|
2455
|
+
Ze(a, !1), L && Ss(L), !ye && (E = O && O.onVnodeBeforeMount) && Se(E, k, f), Ze(a, !0);
|
|
2456
2456
|
{
|
|
2457
2457
|
oe.ce && // @ts-expect-error _def is private
|
|
2458
2458
|
oe.ce._def.shadowRoot !== !1 && oe.ce._injectChildStyle(le);
|
|
@@ -2481,7 +2481,7 @@ function rl(e, t) {
|
|
|
2481
2481
|
const x = a.effect = new dr(S);
|
|
2482
2482
|
a.scope.off();
|
|
2483
2483
|
const y = a.update = x.run.bind(x), I = a.job = x.runIfDirty.bind(x);
|
|
2484
|
-
I.i = a, I.id = a.uid, x.scheduler = () => ln(I),
|
|
2484
|
+
I.i = a, I.id = a.uid, x.scheduler = () => ln(I), Ze(a, !0), y();
|
|
2485
2485
|
}, J = (a, f, m) => {
|
|
2486
2486
|
f.component = a;
|
|
2487
2487
|
const b = a.vnode.props;
|
|
@@ -2757,7 +2757,7 @@ function rl(e, t) {
|
|
|
2757
2757
|
a.suspense.unmount(m, b);
|
|
2758
2758
|
return;
|
|
2759
2759
|
}
|
|
2760
|
-
L &&
|
|
2760
|
+
L && Ye(a, null, f, "beforeUnmount"), I & 64 ? a.type.remove(
|
|
2761
2761
|
a,
|
|
2762
2762
|
f,
|
|
2763
2763
|
m,
|
|
@@ -2778,7 +2778,7 @@ function rl(e, t) {
|
|
|
2778
2778
|
) : (_ === me && E & 384 || !g && I & 16) && _t(x, f, m), b && yn(a);
|
|
2779
2779
|
}
|
|
2780
2780
|
(W && (k = w && w.onVnodeUnmounted) || L) && fe(() => {
|
|
2781
|
-
k && Se(k, f, a), L &&
|
|
2781
|
+
k && Se(k, f, a), L && Ye(a, null, f, "unmounted");
|
|
2782
2782
|
}, m);
|
|
2783
2783
|
}, yn = (a) => {
|
|
2784
2784
|
const { type: f, el: m, anchor: b, transition: g } = a;
|
|
@@ -2851,7 +2851,7 @@ function rl(e, t) {
|
|
|
2851
2851
|
function Is({ type: e, props: t }, s) {
|
|
2852
2852
|
return s === "svg" && e === "foreignObject" || s === "mathml" && e === "annotation-xml" && t && t.encoding && t.encoding.includes("html") ? void 0 : s;
|
|
2853
2853
|
}
|
|
2854
|
-
function
|
|
2854
|
+
function Ze({ effect: e, job: t }, s) {
|
|
2855
2855
|
s ? (e.flags |= 32, t.flags |= 4) : (e.flags &= -33, t.flags &= -5);
|
|
2856
2856
|
}
|
|
2857
2857
|
function il(e, t) {
|
|
@@ -3889,7 +3889,7 @@ const pi = {
|
|
|
3889
3889
|
} catch {
|
|
3890
3890
|
}
|
|
3891
3891
|
}
|
|
3892
|
-
}, Bt = (e) => e.map(String).join("."), oc = (e) => e.replace(/[^a-zA-Z0-9_-]/g, "_"), ke = (e) => `schema_${oc(Bt(e) || "root")}`,
|
|
3892
|
+
}, Bt = (e) => e.map(String).join("."), oc = (e) => e.replace(/[^a-zA-Z0-9_-]/g, "_"), ke = (e) => `schema_${oc(Bt(e) || "root")}`, tt = (e) => Bt(e);
|
|
3893
3893
|
function gn(e, t) {
|
|
3894
3894
|
if (t == null) return t;
|
|
3895
3895
|
switch (e) {
|
|
@@ -4045,7 +4045,7 @@ class gi extends Ie {
|
|
|
4045
4045
|
}
|
|
4046
4046
|
this.$root.innerHTML = `<style>${pe}</style>`;
|
|
4047
4047
|
const t = _e(this._schema), s = this.makeFieldContainer("string", t.description), n = document.createElement("input");
|
|
4048
|
-
this.$input = n, n.className = "input", n.type = "text", n.name =
|
|
4048
|
+
this.$input = n, n.className = "input", n.type = "text", n.name = tt(this._path), n.id = ke(this._path), t?.pattern?.source && (n.pattern = t.pattern.source), t?.max != null && (n.maxLength = t.max), n.value = this._value ?? "", n.oninput = () => this.emitChange(gn("string", n.value));
|
|
4049
4049
|
const r = s.querySelector("label.label");
|
|
4050
4050
|
r && (r.htmlFor = n.id), s.appendChild(n), this.$root.appendChild(s);
|
|
4051
4051
|
}
|
|
@@ -4060,7 +4060,7 @@ class _i extends Ie {
|
|
|
4060
4060
|
}
|
|
4061
4061
|
this.$root.innerHTML = `<style>${pe}</style>`;
|
|
4062
4062
|
const t = this._schema?.type ?? "number", s = _e(this._schema), n = this.makeFieldContainer("number", s.description), r = document.createElement("input");
|
|
4063
|
-
this.$input = r, r.className = "input", r.name =
|
|
4063
|
+
this.$input = r, r.className = "input", r.name = tt(this._path), r.id = ke(this._path), s?.min != null && (r.min = String(s.min)), s?.max != null && (r.max = String(s.max)), s?.step != null && (r.step = String(s.step)), t === "percent" && !r.step && (r.step = "0.01"), r.value = this._value ?? "", r.oninput = () => this.emitChange(gn(t, r.value));
|
|
4064
4064
|
const i = n.querySelector("label.label");
|
|
4065
4065
|
i && (i.htmlFor = r.id), s.role === "slider" ? r.type = "range" : r.type = "number", n.appendChild(r), this.$root.appendChild(n);
|
|
4066
4066
|
}
|
|
@@ -4072,7 +4072,7 @@ class vi extends Ie {
|
|
|
4072
4072
|
const t = _e(this._schema), s = this.makeFieldContainer("boolean", t.description), n = document.createElement("label");
|
|
4073
4073
|
n.className = "checkbox";
|
|
4074
4074
|
const r = document.createElement("input");
|
|
4075
|
-
r.type = "checkbox", r.checked = !!this._value, r.name =
|
|
4075
|
+
r.type = "checkbox", r.checked = !!this._value, r.name = tt(this._path), r.id = ke(this._path);
|
|
4076
4076
|
const i = document.createElement("span");
|
|
4077
4077
|
i.textContent = this._label ?? "", r.onchange = () => this.emitChange(r.checked);
|
|
4078
4078
|
const o = s.querySelector("label.label");
|
|
@@ -4109,7 +4109,7 @@ class bi extends Ie {
|
|
|
4109
4109
|
const t = _e(this._schema), s = this.makeFieldContainer("date", t.description), n = document.createElement("input");
|
|
4110
4110
|
this.$input = n, n.className = "input";
|
|
4111
4111
|
const r = t.role || "date";
|
|
4112
|
-
if (r === "datetime" ? n.type = "datetime-local" : r === "time" ? n.type = "time" : n.type = "date", n.name =
|
|
4112
|
+
if (r === "datetime" ? n.type = "datetime-local" : r === "time" ? n.type = "time" : n.type = "date", n.name = tt(this._path), n.id = ke(this._path), this._value instanceof Date)
|
|
4113
4113
|
r === "date" ? n.value = wt(this._value) : r === "time" ? n.value = qs(this._value) : r === "datetime" && (n.value = Jt(this._value));
|
|
4114
4114
|
else if (typeof this._value == "string" && r !== "time") {
|
|
4115
4115
|
const o = new Date(this._value);
|
|
@@ -4191,7 +4191,7 @@ class xi extends Ie {
|
|
|
4191
4191
|
const t = _e(this._schema), s = this.makeFieldContainer("union", t.description), n = this._schema.list || [];
|
|
4192
4192
|
if (lc(n)) {
|
|
4193
4193
|
const r = document.createElement("select");
|
|
4194
|
-
r.className = "input", r.name =
|
|
4194
|
+
r.className = "input", r.name = tt(this._path), r.id = ke(this._path), n.forEach((o) => {
|
|
4195
4195
|
const l = document.createElement("option");
|
|
4196
4196
|
l.value = String(o.value), l.textContent = String(o.value), this._value === o.value && (l.selected = !0), r.appendChild(l);
|
|
4197
4197
|
}), r.onchange = () => this.emitChange(gn("string", r.value));
|
|
@@ -4201,7 +4201,7 @@ class xi extends Ie {
|
|
|
4201
4201
|
const r = document.createElement("div");
|
|
4202
4202
|
r.className = "toolbar";
|
|
4203
4203
|
const i = document.createElement("select");
|
|
4204
|
-
i.className = "input", i.name =
|
|
4204
|
+
i.className = "input", i.name = tt(this._path) + ".__type", i.id = ke(this._path) + "__type";
|
|
4205
4205
|
let o = 0;
|
|
4206
4206
|
n.forEach((u, d) => {
|
|
4207
4207
|
const p = document.createElement("option");
|
|
@@ -4359,7 +4359,7 @@ class bs extends Ie {
|
|
|
4359
4359
|
const Y = () => {
|
|
4360
4360
|
if (B) return;
|
|
4361
4361
|
B = !0, clearTimeout(ve);
|
|
4362
|
-
const qe = i().filter((
|
|
4362
|
+
const qe = i().filter((st, nt) => nt !== p);
|
|
4363
4363
|
this._itemIds.splice(p, 1);
|
|
4364
4364
|
const Pe = this.capturePositions(n);
|
|
4365
4365
|
this._value = qe, o(Pe), this.emitChange(qe);
|
|
@@ -4413,7 +4413,7 @@ class wi extends Ie {
|
|
|
4413
4413
|
const $ = [...this._path, C], U = document.createElement("div");
|
|
4414
4414
|
U.className = "kv schema-collection-row", U.dataset.uid = o(C), U.setAttribute("data-path", Bt($));
|
|
4415
4415
|
const P = document.createElement("input");
|
|
4416
|
-
P.className = "input", P.value = C, P.name =
|
|
4416
|
+
P.className = "input", P.value = C, P.name = tt($) + ".__key", P.id = ke($) + "__key";
|
|
4417
4417
|
const N = gt(r, $, i[C], `${this._label ?? ""}[${C}]`), D = document.createElement("button");
|
|
4418
4418
|
D.type = "button", D.className = "btn danger", D.textContent = this._i18n.dictRemove ?? "×", D.onclick = () => {
|
|
4419
4419
|
const T = l();
|
|
@@ -4605,9 +4605,9 @@ const uc = /* @__PURE__ */ Nr({
|
|
|
4605
4605
|
}, u.$attrs), null, 16));
|
|
4606
4606
|
}
|
|
4607
4607
|
});
|
|
4608
|
-
function
|
|
4608
|
+
function Qe(e, t = /* @__PURE__ */ new WeakMap()) {
|
|
4609
4609
|
if (Q(e))
|
|
4610
|
-
return
|
|
4610
|
+
return Qe(e.value, t);
|
|
4611
4611
|
if (e === null || typeof e != "object")
|
|
4612
4612
|
return e;
|
|
4613
4613
|
if (t.has(e))
|
|
@@ -4619,28 +4619,28 @@ function Xe(e, t = /* @__PURE__ */ new WeakMap()) {
|
|
|
4619
4619
|
if (e instanceof Map) {
|
|
4620
4620
|
const r = /* @__PURE__ */ new Map();
|
|
4621
4621
|
return t.set(e, r), Array.from(e.entries()).forEach(([i, o]) => {
|
|
4622
|
-
r.set(i,
|
|
4622
|
+
r.set(i, Qe(o, t));
|
|
4623
4623
|
}), r;
|
|
4624
4624
|
}
|
|
4625
4625
|
if (e instanceof Set) {
|
|
4626
4626
|
const r = /* @__PURE__ */ new Set();
|
|
4627
4627
|
return t.set(e, r), Array.from(e).forEach((i) => {
|
|
4628
|
-
r.add(
|
|
4628
|
+
r.add(Qe(i, t));
|
|
4629
4629
|
}), r;
|
|
4630
4630
|
}
|
|
4631
4631
|
if (Array.isArray(e)) {
|
|
4632
4632
|
const r = [];
|
|
4633
4633
|
t.set(e, r);
|
|
4634
4634
|
for (const i of e)
|
|
4635
|
-
r.push(
|
|
4635
|
+
r.push(Qe(i, t));
|
|
4636
4636
|
return r;
|
|
4637
4637
|
}
|
|
4638
4638
|
const s = j(e), n = {};
|
|
4639
4639
|
t.set(e, n);
|
|
4640
4640
|
for (const r of Object.keys(s))
|
|
4641
|
-
n[r] =
|
|
4641
|
+
n[r] = Qe(s[r], t);
|
|
4642
4642
|
for (const r of Object.getOwnPropertySymbols(s))
|
|
4643
|
-
n[r] =
|
|
4643
|
+
n[r] = Qe(s[r], t);
|
|
4644
4644
|
return n;
|
|
4645
4645
|
}
|
|
4646
4646
|
const fc = { class: "preferences-ui-app" }, hc = { class: "tabs" }, dc = ["onClick", "data-value"], pc = { style: { "max-height": "20em", overflow: "auto" } }, mc = /* @__PURE__ */ Nr({
|
|
@@ -4649,7 +4649,7 @@ const fc = { class: "preferences-ui-app" }, hc = { class: "tabs" }, dc = ["onCli
|
|
|
4649
4649
|
const s = rc(), n = An([]), r = An(""), i = Gt([]), o = hi(() => i.value.map((h) => h.schema)), l = Gt({}), c = Gt({});
|
|
4650
4650
|
return t({
|
|
4651
4651
|
getValue() {
|
|
4652
|
-
return
|
|
4652
|
+
return Qe(c);
|
|
4653
4653
|
}
|
|
4654
4654
|
}), ht(
|
|
4655
4655
|
r,
|
|
@@ -4708,7 +4708,7 @@ class zs extends (Pi = Ni) {
|
|
|
4708
4708
|
super(t, {}, "preferences-ui"), this.ctx = t, t.set("preferencesUI", this), t.inject(["toolbox"], (s) => {
|
|
4709
4709
|
s.toolbox.addButton({
|
|
4710
4710
|
id: "preferences",
|
|
4711
|
-
icon: /* @__PURE__ */
|
|
4711
|
+
icon: /* @__PURE__ */ Ge(
|
|
4712
4712
|
"svg",
|
|
4713
4713
|
{
|
|
4714
4714
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -4718,8 +4718,8 @@ class zs extends (Pi = Ni) {
|
|
|
4718
4718
|
fill: "currentColor",
|
|
4719
4719
|
class: "icon icon-tabler icons-tabler-filled icon-tabler-settings",
|
|
4720
4720
|
children: [
|
|
4721
|
-
/* @__PURE__ */
|
|
4722
|
-
/* @__PURE__ */
|
|
4721
|
+
/* @__PURE__ */ Ge("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }),
|
|
4722
|
+
/* @__PURE__ */ Ge("path", { d: "M14.647 4.081a.724 .724 0 0 0 1.08 .448c2.439 -1.485 5.23 1.305 3.745 3.744a.724 .724 0 0 0 .447 1.08c2.775 .673 2.775 4.62 0 5.294a.724 .724 0 0 0 -.448 1.08c1.485 2.439 -1.305 5.23 -3.744 3.745a.724 .724 0 0 0 -1.08 .447c-.673 2.775 -4.62 2.775 -5.294 0a.724 .724 0 0 0 -1.08 -.448c-2.439 1.485 -5.23 -1.305 -3.745 -3.744a.724 .724 0 0 0 -.447 -1.08c-2.775 -.673 -2.775 -4.62 0 -5.294a.724 .724 0 0 0 .448 -1.08c-1.485 -2.439 1.305 -5.23 3.744 -3.745a.722 .722 0 0 0 1.08 -.447c.673 -2.775 4.62 -2.775 5.294 0zm-2.647 4.919a3 3 0 1 0 0 6a3 3 0 0 0 0 -6z" })
|
|
4723
4723
|
]
|
|
4724
4724
|
}
|
|
4725
4725
|
),
|
|
@@ -4738,11 +4738,11 @@ class zs extends (Pi = Ni) {
|
|
|
4738
4738
|
sizeClass: "small",
|
|
4739
4739
|
outSideClose: !1,
|
|
4740
4740
|
center: !0,
|
|
4741
|
-
title: "InPageEdit
|
|
4742
|
-
content: /* @__PURE__ */
|
|
4741
|
+
title: "InPageEdit Preferences",
|
|
4742
|
+
content: /* @__PURE__ */ Ge(Ri, { children: /* @__PURE__ */ Ge(Fi, {}) })
|
|
4743
4743
|
});
|
|
4744
4744
|
t.get$window().classList.add("dialog");
|
|
4745
|
-
const s = /* @__PURE__ */
|
|
4745
|
+
const s = /* @__PURE__ */ Ge("div", { id: "ipe-preferences-app", style: { minHeight: "65vh" } });
|
|
4746
4746
|
t.setContent(s);
|
|
4747
4747
|
const n = this.createFormApp(), r = n.mount(s);
|
|
4748
4748
|
t.setButtons([
|
|
@@ -4766,7 +4766,10 @@ class zs extends (Pi = Ni) {
|
|
|
4766
4766
|
} catch (o) {
|
|
4767
4767
|
this.logger.error("failed to save preferences", o);
|
|
4768
4768
|
}
|
|
4769
|
-
t.close()
|
|
4769
|
+
t.close(), this.ctx.modal.notify("success", {
|
|
4770
|
+
title: "Preferences Saved",
|
|
4771
|
+
content: /* @__PURE__ */ Ge("p", { children: "Some settings may take effect after reloading the page." })
|
|
4772
|
+
});
|
|
4770
4773
|
}
|
|
4771
4774
|
}
|
|
4772
4775
|
]), t.on(t.Event.Close, () => {
|
|
@@ -4784,4 +4787,4 @@ Tc(vn, 1, zs);
|
|
|
4784
4787
|
export {
|
|
4785
4788
|
zs as PluginPreferencesUI
|
|
4786
4789
|
};
|
|
4787
|
-
//# sourceMappingURL=index-
|
|
4790
|
+
//# sourceMappingURL=index-CrWxZ0yl.js.map
|