From 559e0f95d4bbb7637879bbd54ace77f47c7343dd Mon Sep 17 00:00:00 2001 From: Thorsten Marx Date: Mon, 8 Dec 2025 15:47:35 +0100 Subject: [PATCH 01/11] update to deploy developer module --- .../ExampleUiScriptActionSourceExtension.java | 6 +- .../cms/modules/ui/http/JSActionHandler.java | 2 - .../manager/actions/reload-preview.js | 2 +- .../src/main/resources/manager/index.html | 16 +- .../manager/js/manager-inject-init.js | 122 +++++++++++++ .../resources/manager/js/manager-inject.js | 128 ++++---------- .../src/main/resources/manager/js/manager.js | 12 +- .../resources/manager/js/modules/alerts.js | 4 +- .../manager/js/modules/filebrowser.actions.js | 12 +- .../manager/js/modules/filebrowser.js | 22 +-- .../js/modules/filebrowser.template.js | 2 +- .../manager/js/modules/filebrowser.upload.js | 10 +- .../manager/js/modules/form/field.checkbox.js | 2 +- .../manager/js/modules/form/field.code.js | 4 +- .../manager/js/modules/form/field.color.js | 4 +- .../manager/js/modules/form/field.date.js | 4 +- .../manager/js/modules/form/field.datetime.js | 4 +- .../manager/js/modules/form/field.divider.js | 2 +- .../manager/js/modules/form/field.easymde.js | 4 +- .../manager/js/modules/form/field.list.js | 16 +- .../manager/js/modules/form/field.mail.js | 4 +- .../manager/js/modules/form/field.markdown.js | 10 +- .../manager/js/modules/form/field.media.js | 8 +- .../manager/js/modules/form/field.number.js | 4 +- .../manager/js/modules/form/field.radio.js | 4 +- .../manager/js/modules/form/field.range.js | 4 +- .../js/modules/form/field.reference.js | 6 +- .../manager/js/modules/form/field.select.js | 4 +- .../manager/js/modules/form/field.text.js | 4 +- .../manager/js/modules/form/field.textarea.js | 4 +- .../manager/js/modules/form/forms.js | 38 ++--- .../manager/js/modules/locale-utils.js | 2 +- .../manager/js/modules/localization-loader.js | 6 +- .../manager/js/modules/localization.js | 4 +- .../manager/js/modules/manager-ui.js | 4 +- .../manager/manager.message.handlers.js | 6 +- .../js/modules/manager/media.inject.js | 4 +- .../js/modules/manager/toolbar.inject.js | 4 +- .../resources/manager/js/modules/modal.js | 2 +- .../manager/js/modules/preview.utils.js | 2 +- .../manager/js/modules/rpc/rpc-content.js | 2 +- .../manager/js/modules/rpc/rpc-files.js | 2 +- .../manager/js/modules/rpc/rpc-i18n.js | 2 +- .../manager/js/modules/rpc/rpc-manager.js | 2 +- .../manager/js/modules/rpc/rpc-media.js | 2 +- .../manager/js/modules/rpc/rpc-page.js | 2 +- .../manager/js/modules/rpc/rpc-translation.js | 2 +- .../resources/manager/js/modules/rpc/rpc.js | 2 +- .../resources/manager/js/modules/toast.js | 2 +- .../resources/manager/js/modules/ui-state.js | 2 +- .../main/resources/manager/js/ui-actions.js | 4 +- .../main/ts/dist/actions/reload-preview.js | 2 +- .../main/ts/dist/js/manager-inject-init.js | 122 +++++++++++++ .../src/main/ts/dist/js/manager-inject.js | 128 ++++---------- .../ui-module/src/main/ts/dist/js/manager.js | 12 +- .../src/main/ts/dist/js/modules/alerts.js | 4 +- .../ts/dist/js/modules/filebrowser.actions.js | 12 +- .../main/ts/dist/js/modules/filebrowser.js | 22 +-- .../dist/js/modules/filebrowser.template.js | 2 +- .../ts/dist/js/modules/filebrowser.upload.js | 10 +- .../ts/dist/js/modules/form/field.checkbox.js | 2 +- .../ts/dist/js/modules/form/field.code.js | 4 +- .../ts/dist/js/modules/form/field.color.js | 4 +- .../ts/dist/js/modules/form/field.date.js | 4 +- .../ts/dist/js/modules/form/field.datetime.js | 4 +- .../ts/dist/js/modules/form/field.divider.js | 2 +- .../ts/dist/js/modules/form/field.easymde.js | 4 +- .../ts/dist/js/modules/form/field.list.js | 16 +- .../ts/dist/js/modules/form/field.mail.js | 4 +- .../ts/dist/js/modules/form/field.markdown.js | 10 +- .../ts/dist/js/modules/form/field.media.js | 8 +- .../ts/dist/js/modules/form/field.number.js | 4 +- .../ts/dist/js/modules/form/field.radio.js | 4 +- .../ts/dist/js/modules/form/field.range.js | 4 +- .../dist/js/modules/form/field.reference.js | 6 +- .../ts/dist/js/modules/form/field.select.js | 4 +- .../ts/dist/js/modules/form/field.text.js | 4 +- .../ts/dist/js/modules/form/field.textarea.js | 4 +- .../src/main/ts/dist/js/modules/form/forms.js | 38 ++--- .../main/ts/dist/js/modules/locale-utils.js | 2 +- .../ts/dist/js/modules/localization-loader.js | 6 +- .../main/ts/dist/js/modules/localization.js | 4 +- .../src/main/ts/dist/js/modules/manager-ui.js | 4 +- .../manager/manager.message.handlers.js | 6 +- .../dist/js/modules/manager/media.inject.js | 4 +- .../dist/js/modules/manager/toolbar.inject.js | 4 +- .../src/main/ts/dist/js/modules/modal.js | 2 +- .../main/ts/dist/js/modules/preview.utils.js | 2 +- .../ts/dist/js/modules/rpc/rpc-content.js | 2 +- .../main/ts/dist/js/modules/rpc/rpc-files.js | 2 +- .../main/ts/dist/js/modules/rpc/rpc-i18n.js | 2 +- .../ts/dist/js/modules/rpc/rpc-manager.js | 2 +- .../main/ts/dist/js/modules/rpc/rpc-media.js | 2 +- .../main/ts/dist/js/modules/rpc/rpc-page.js | 2 +- .../ts/dist/js/modules/rpc/rpc-translation.js | 2 +- .../src/main/ts/dist/js/modules/rpc/rpc.js | 2 +- .../src/main/ts/dist/js/modules/toast.js | 2 +- .../src/main/ts/dist/js/modules/ui-state.js | 2 +- .../src/main/ts/dist/js/ui-actions.js | 4 +- .../src/main/ts/src/actions/reload-preview.ts | 4 +- .../src/main/ts/src/js/manager-inject-init.js | 148 ++++++++++++++++ .../src/main/ts/src/js/manager-inject.js | 160 ++++-------------- .../ui-module/src/main/ts/src/js/manager.js | 12 +- .../src/main/ts/src/js/modules/alerts.js | 4 +- .../ts/src/js/modules/filebrowser.actions.js | 12 +- .../src/main/ts/src/js/modules/filebrowser.js | 22 +-- .../ts/src/js/modules/filebrowser.template.js | 2 +- .../ts/src/js/modules/filebrowser.upload.js | 10 +- .../ts/src/js/modules/form/field.checkbox.ts | 4 +- .../main/ts/src/js/modules/form/field.code.js | 4 +- .../ts/src/js/modules/form/field.color.ts | 6 +- .../main/ts/src/js/modules/form/field.date.ts | 6 +- .../ts/src/js/modules/form/field.datetime.ts | 6 +- .../ts/src/js/modules/form/field.divider.ts | 4 +- .../ts/src/js/modules/form/field.easymde.ts | 6 +- .../main/ts/src/js/modules/form/field.list.ts | 16 +- .../main/ts/src/js/modules/form/field.mail.ts | 6 +- .../ts/src/js/modules/form/field.markdown.ts | 12 +- .../ts/src/js/modules/form/field.media.ts | 10 +- .../ts/src/js/modules/form/field.number.ts | 6 +- .../ts/src/js/modules/form/field.radio.ts | 6 +- .../ts/src/js/modules/form/field.range.ts | 6 +- .../ts/src/js/modules/form/field.reference.ts | 8 +- .../ts/src/js/modules/form/field.select.ts | 6 +- .../main/ts/src/js/modules/form/field.text.ts | 6 +- .../ts/src/js/modules/form/field.textarea.ts | 6 +- .../src/main/ts/src/js/modules/form/forms.ts | 38 ++--- .../main/ts/src/js/modules/locale-utils.js | 2 +- .../ts/src/js/modules/localization-loader.js | 6 +- .../main/ts/src/js/modules/localization.js | 4 +- .../src/main/ts/src/js/modules/manager-ui.js | 4 +- .../manager/manager.message.handlers.ts | 6 +- .../ts/src/js/modules/manager/media.inject.ts | 4 +- .../src/js/modules/manager/toolbar.inject.ts | 4 +- .../src/main/ts/src/js/modules/modal.js | 2 +- .../main/ts/src/js/modules/preview.utils.js | 2 +- .../main/ts/src/js/modules/rpc/rpc-content.ts | 2 +- .../main/ts/src/js/modules/rpc/rpc-files.ts | 2 +- .../main/ts/src/js/modules/rpc/rpc-i18n.ts | 2 +- .../main/ts/src/js/modules/rpc/rpc-manager.ts | 2 +- .../main/ts/src/js/modules/rpc/rpc-media.ts | 2 +- .../main/ts/src/js/modules/rpc/rpc-page.ts | 2 +- .../ts/src/js/modules/rpc/rpc-translation.ts | 2 +- .../src/main/ts/src/js/modules/rpc/rpc.ts | 2 +- .../src/main/ts/src/js/modules/toast.js | 2 +- .../src/main/ts/src/js/modules/ui-state.js | 2 +- .../src/main/ts/src/js/ui-actions.js | 4 +- modules/ui-module/src/main/ts/tsconfig.json | 6 + .../libs/example-module-8.0.0.jar | Bin 18668 -> 18692 bytes .../themes/demo/templates/libs/fragments.html | 3 +- 150 files changed, 904 insertions(+), 727 deletions(-) create mode 100644 modules/ui-module/src/main/resources/manager/js/manager-inject-init.js create mode 100644 modules/ui-module/src/main/ts/dist/js/manager-inject-init.js create mode 100644 modules/ui-module/src/main/ts/src/js/manager-inject-init.js diff --git a/modules/example-module/src/main/java/com/condation/cms/modules/example/ui/ExampleUiScriptActionSourceExtension.java b/modules/example-module/src/main/java/com/condation/cms/modules/example/ui/ExampleUiScriptActionSourceExtension.java index f47c8c772..d57c99bba 100644 --- a/modules/example-module/src/main/java/com/condation/cms/modules/example/ui/ExampleUiScriptActionSourceExtension.java +++ b/modules/example-module/src/main/java/com/condation/cms/modules/example/ui/ExampleUiScriptActionSourceExtension.java @@ -43,7 +43,11 @@ public class ExampleUiScriptActionSourceExtension extends AbstractExtensionPoint @Override public Map getActionSources() { - return Map.of("example/source", "// this is an example script source"); + return Map.of("example/source", """ + export async function runAction(parameters) { + console.log("This is an example action"); + } + """); } @MenuEntry( diff --git a/modules/ui-module/src/main/java/com/condation/cms/modules/ui/http/JSActionHandler.java b/modules/ui-module/src/main/java/com/condation/cms/modules/ui/http/JSActionHandler.java index df07fefa8..df061ca8e 100644 --- a/modules/ui-module/src/main/java/com/condation/cms/modules/ui/http/JSActionHandler.java +++ b/modules/ui-module/src/main/java/com/condation/cms/modules/ui/http/JSActionHandler.java @@ -24,9 +24,7 @@ import com.condation.cms.api.feature.features.ModuleManagerFeature; import com.condation.cms.api.module.SiteModuleContext; import com.condation.cms.api.ui.extensions.UIScriptActionSourceExtension; -import com.condation.cms.api.utils.HTTPUtil; import com.google.common.base.Strings; -import java.nio.charset.StandardCharsets; import java.nio.file.FileSystem; import java.nio.file.Files; import java.util.Optional; diff --git a/modules/ui-module/src/main/resources/manager/actions/reload-preview.js b/modules/ui-module/src/main/resources/manager/actions/reload-preview.js index bc8cce531..2d94fd751 100644 --- a/modules/ui-module/src/main/resources/manager/actions/reload-preview.js +++ b/modules/ui-module/src/main/resources/manager/actions/reload-preview.js @@ -19,7 +19,7 @@ * . * #L% */ -import { reloadPreview } from "../js/modules/preview.utils"; +import { reloadPreview } from "@cms/modules/preview.utils.js"; export async function runAction(params) { reloadPreview(); } diff --git a/modules/ui-module/src/main/resources/manager/index.html b/modules/ui-module/src/main/resources/manager/index.html index bc7d0bfad..ecbd0a03f 100644 --- a/modules/ui-module/src/main/resources/manager/index.html +++ b/modules/ui-module/src/main/resources/manager/index.html @@ -69,9 +69,6 @@ - - - + + + + diff --git a/modules/ui-module/src/main/resources/manager/js/manager-inject-init.js b/modules/ui-module/src/main/resources/manager/js/manager-inject-init.js new file mode 100644 index 000000000..843e824e6 --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/js/manager-inject-init.js @@ -0,0 +1,122 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +import frameMessenger from '@cms/modules/frameMessenger.js'; +import { initContentMediaToolbar, initMediaToolbar, initMediaUploadOverlay } from '@cms/modules/manager/media.inject.js'; +import { EDIT_ATTRIBUTES_ICON, EDIT_PAGE_ICON, SECTION_ADD_ICON, SECTION_DELETE_ICON, SECTION_PUBLISHED_ICON, SECTION_SORT_ICON, SECTION_UNPUBLISHED_ICON } from '@cms/modules/manager/toolbar-icons'; +import { initToolbar } from '@cms/modules/manager/toolbar.inject.js'; +const isIframe = () => { + return typeof window !== 'undefined' && window.self !== window.top; +}; +export function initIframe() { + if (!isIframe()) { + return; + } + frameMessenger.send(window.parent, { + type: 'loaded', + payload: {} + }); + const toolbarContainers = document.querySelectorAll('[data-cms-toolbar]'); + toolbarContainers.forEach(initToolbar); + const mediaToolbarContainers = document.querySelectorAll('img[data-cms-media-toolbar]'); + mediaToolbarContainers.forEach(initMediaToolbar); + const contentMediaContainers = document.querySelectorAll('img[data-cms-ui-selector=content-image]'); + contentMediaContainers.forEach(initContentMediaToolbar); + //const mediaUploadContainers = document.querySelectorAll('img[data-cms-media-actions~=upload]'); + //mediaUploadContainers.forEach(initMediaUploadOverlay); + document.addEventListener('keydown', (event) => { + if (event.key.toLowerCase() === 'k' && (event.metaKey || event.ctrlKey)) { + event.preventDefault(); + frameMessenger.send(window.parent, { + type: 'shortkeys', + payload: {} + }); + } + }); + frameMessenger.on('getContentNodeResponse', async (payload) => { + for (const [sectionName, items] of Object.entries(payload.contentNode.sections)) { + for (const item of items) { + const sectionContainer = document.querySelector(`[data-cms-section-uri="${item.uri}"]`); + if (!sectionContainer) { + continue; + } + if (item.data.published) { + sectionContainer.setAttribute('data-cms-action', 'unpublish'); + sectionContainer.setAttribute("title", "Unpublish"); + if (isSectionPublishedExpired(item)) { + sectionContainer.innerHTML = SECTION_UNPUBLISHED_ICON; + sectionContainer.classList.remove('cms-unpublished'); + sectionContainer.classList.remove('cms-published'); + sectionContainer.classList.add('cms-published-expired'); + } + else { + sectionContainer.innerHTML = SECTION_PUBLISHED_ICON; + sectionContainer.classList.remove('cms-unpublished'); + sectionContainer.classList.remove('cms-published-expired'); + sectionContainer.classList.add('cms-published'); + } + } + else { + sectionContainer.innerHTML = SECTION_UNPUBLISHED_ICON; + sectionContainer.setAttribute('data-cms-action', 'publish'); + sectionContainer.setAttribute("title", "Publish"); + sectionContainer.classList.remove('cms-published'); + sectionContainer.classList.remove('cms-published-expired'); + sectionContainer.classList.add('cms-unpublished'); + } + } + } + }); + frameMessenger.send(window.parent, { + type: 'getContentNode', + payload: {} + }); + document.addEventListener('click', function (event) { + if (event.target.matches('[data-cms-action]')) { + const button = event.target; + // Wenn bereits disabled, nichts tun + if (button.disabled) { + event.preventDefault(); + return; + } + // Button deaktivieren + button.disabled = true; + // Nach 2 Sekunden wieder aktivieren + setTimeout(() => { + button.disabled = false; + }, 2000); + } + }); +} +; +export function isSectionPublishedExpired(section) { + const publishDateStr = section.data.publish_date; + const unpublishDateStr = section.data.unpublish_date; + const now = new Date(); + const publishDate = publishDateStr ? new Date(publishDateStr) : null; + const unpublishDate = unpublishDateStr ? new Date(unpublishDateStr) : null; + // section is published if: + // - publishDate empty or in the past + // - und unpublishDate empty or in the future + const isPublished = (!publishDate || publishDate <= now) && + (!unpublishDate || unpublishDate > now); + return !isPublished; +} diff --git a/modules/ui-module/src/main/resources/manager/js/manager-inject.js b/modules/ui-module/src/main/resources/manager/js/manager-inject.js index 5c4f573e1..2be90ce2a 100644 --- a/modules/ui-module/src/main/resources/manager/js/manager-inject.js +++ b/modules/ui-module/src/main/resources/manager/js/manager-inject.js @@ -19,103 +19,33 @@ * . * #L% */ -import frameMessenger from './modules/frameMessenger.js'; -import { initContentMediaToolbar, initMediaToolbar, initMediaUploadOverlay } from './modules/manager/media.inject.js'; -import { EDIT_ATTRIBUTES_ICON, EDIT_PAGE_ICON, SECTION_ADD_ICON, SECTION_DELETE_ICON, SECTION_PUBLISHED_ICON, SECTION_SORT_ICON, SECTION_UNPUBLISHED_ICON } from './modules/manager/toolbar-icons'; -import { initToolbar } from './modules/manager/toolbar.inject.js'; -const isIframe = () => { - return typeof window !== 'undefined' && window.self !== window.top; -}; -document.addEventListener("DOMContentLoaded", function () { - if (!isIframe()) { - return; - } - frameMessenger.send(window.parent, { - type: 'loaded', - payload: {} - }); - const toolbarContainers = document.querySelectorAll('[data-cms-toolbar]'); - toolbarContainers.forEach(initToolbar); - const mediaToolbarContainers = document.querySelectorAll('img[data-cms-media-toolbar]'); - mediaToolbarContainers.forEach(initMediaToolbar); - const contentMediaContainers = document.querySelectorAll('img[data-cms-ui-selector=content-image]'); - contentMediaContainers.forEach(initContentMediaToolbar); - //const mediaUploadContainers = document.querySelectorAll('img[data-cms-media-actions~=upload]'); - //mediaUploadContainers.forEach(initMediaUploadOverlay); - document.addEventListener('keydown', (event) => { - if (event.key.toLowerCase() === 'k' && (event.metaKey || event.ctrlKey)) { - event.preventDefault(); - frameMessenger.send(window.parent, { - type: 'shortkeys', - payload: {} - }); +(async function () { + // Basis-URLs aus Parent ableiten + const parentManager = window.parent?.manager || {}; + const baseUrl = parentManager.baseUrl || '/manager'; + const contextPath = parentManager.contextPath || '/'; + const importMap = { + imports: { + "@cms/js/": `${baseUrl}/js/`, + "@cms/libs/": `${baseUrl}/js/libs/`, + "@cms/manager/": `${baseUrl}/js/manager/`, + "@cms/modules/": `${baseUrl}/js/modules/` } - }); - frameMessenger.on('getContentNodeResponse', async (payload) => { - for (const [sectionName, items] of Object.entries(payload.contentNode.sections)) { - for (const item of items) { - const sectionContainer = document.querySelector(`[data-cms-section-uri="${item.uri}"]`); - if (!sectionContainer) { - continue; - } - if (item.data.published) { - sectionContainer.setAttribute('data-cms-action', 'unpublish'); - sectionContainer.setAttribute("title", "Unpublish"); - if (isSectionPublishedExpired(item)) { - sectionContainer.innerHTML = SECTION_UNPUBLISHED_ICON; - sectionContainer.classList.remove('cms-unpublished'); - sectionContainer.classList.remove('cms-published'); - sectionContainer.classList.add('cms-published-expired'); - } - else { - sectionContainer.innerHTML = SECTION_PUBLISHED_ICON; - sectionContainer.classList.remove('cms-unpublished'); - sectionContainer.classList.remove('cms-published-expired'); - sectionContainer.classList.add('cms-published'); - } - } - else { - sectionContainer.innerHTML = SECTION_UNPUBLISHED_ICON; - sectionContainer.setAttribute('data-cms-action', 'publish'); - sectionContainer.setAttribute("title", "Publish"); - sectionContainer.classList.remove('cms-published'); - sectionContainer.classList.remove('cms-published-expired'); - sectionContainer.classList.add('cms-unpublished'); - } - } - } - }); - frameMessenger.send(window.parent, { - type: 'getContentNode', - payload: {} - }); - document.addEventListener('click', function (event) { - if (event.target.matches('[data-cms-action]')) { - const button = event.target; - // Wenn bereits disabled, nichts tun - if (button.disabled) { - event.preventDefault(); - return; - } - // Button deaktivieren - button.disabled = true; - // Nach 2 Sekunden wieder aktivieren - setTimeout(() => { - button.disabled = false; - }, 2000); - } - }); -}); -export function isSectionPublishedExpired(section) { - const publishDateStr = section.data.publish_date; - const unpublishDateStr = section.data.unpublish_date; - const now = new Date(); - const publishDate = publishDateStr ? new Date(publishDateStr) : null; - const unpublishDate = unpublishDateStr ? new Date(unpublishDateStr) : null; - // section is published if: - // - publishDate empty or in the past - // - und unpublishDate empty or in the future - const isPublished = (!publishDate || publishDate <= now) && - (!unpublishDate || unpublishDate > now); - return !isPublished; -} + }; + // 2. Import Map setzen + const script = document.createElement('script'); + script.type = 'importmap'; + script.textContent = JSON.stringify(importMap); + script.onload = () => { + console.log('✅ Import Map ready!'); // Debug + resolve(); + }; + document.head.appendChild(script); + // 3. window.manager kopieren + window.manager = parentManager; + // 4. Plugins laden + console.log('🔥 Loading manager-inject-init...'); + const { initIframe } = await import('@cms/js/manager-inject-init.js'); + console.log('✅ initModule loaded!', initIframe); + initIframe(); +})(); diff --git a/modules/ui-module/src/main/resources/manager/js/manager.js b/modules/ui-module/src/main/resources/manager/js/manager.js index 03c9dcac0..54ca56146 100644 --- a/modules/ui-module/src/main/resources/manager/js/manager.js +++ b/modules/ui-module/src/main/resources/manager/js/manager.js @@ -19,12 +19,12 @@ * . * #L% */ -import frameMessenger from './modules/frameMessenger.js'; -import { loadPreview } from './modules/preview.utils.js'; -import { UIStateManager } from './modules/ui-state.js'; -import { updateStateButton } from './modules/manager-ui.js'; -import { EventBus } from './modules/event-bus.js'; -import { initMessageHandlers } from './modules/manager/manager.message.handlers.js'; +import frameMessenger from '@cms/modules/frameMessenger.js'; +import { loadPreview } from '@cms/modules/preview.utils.js'; +import { UIStateManager } from '@cms/modules/ui-state.js'; +import { updateStateButton } from '@cms/modules/manager-ui.js'; +import { EventBus } from '@cms/modules/event-bus.js'; +import { initMessageHandlers } from '@cms/modules/manager/manager.message.handlers.js'; frameMessenger.on('load', (payload) => { EventBus.emit("preview:loaded", {}); }); diff --git a/modules/ui-module/src/main/resources/manager/js/modules/alerts.js b/modules/ui-module/src/main/resources/manager/js/modules/alerts.js index 4da68fc03..1bb876133 100644 --- a/modules/ui-module/src/main/resources/manager/js/modules/alerts.js +++ b/modules/ui-module/src/main/resources/manager/js/modules/alerts.js @@ -19,8 +19,8 @@ * . * #L% */ -import { openModal } from './modal.js'; -import { i18n } from './localization.js'; +import { openModal } from '@cms/modules/modal.js'; +import { i18n } from '@cms/modules/localization.js'; const alertSelect = (options) => { return new Promise((resolve) => { const modalBody = ` diff --git a/modules/ui-module/src/main/resources/manager/js/modules/filebrowser.actions.js b/modules/ui-module/src/main/resources/manager/js/modules/filebrowser.actions.js index cd11fc611..1d4fd9b23 100644 --- a/modules/ui-module/src/main/resources/manager/js/modules/filebrowser.actions.js +++ b/modules/ui-module/src/main/resources/manager/js/modules/filebrowser.actions.js @@ -19,12 +19,12 @@ * . * #L% */ -import { createFolder, createFile, renameFile } from './rpc/rpc-files.js'; -import { createPage } from './rpc/rpc-page.js'; -import { i18n } from './localization.js'; -import { alertSelect, alertConfirm, alertPrompt } from './alerts.js'; -import { showToast } from './toast.js'; -import { getPageTemplates } from './rpc/rpc-manager.js'; +import { createFolder, createFile, renameFile } from '@cms/modules/rpc/rpc-files.js'; +import { createPage } from '@cms/modules/rpc/rpc-page.js'; +import { i18n } from '@cms/modules/localization.js'; +import { alertSelect, alertConfirm, alertPrompt } from '@cms/modules/alerts.js'; +import { showToast } from '@cms/modules/toast.js'; +import { getPageTemplates } from '@cms/modules/rpc/rpc-manager.js'; export async function renameFileAction({ state, getTargetFolder, filename }) { const newName = await alertPrompt({ title: i18n.t("filebrowser.rename.title", "Rename file"), diff --git a/modules/ui-module/src/main/resources/manager/js/modules/filebrowser.js b/modules/ui-module/src/main/resources/manager/js/modules/filebrowser.js index f7e37ce77..82789df2a 100644 --- a/modules/ui-module/src/main/resources/manager/js/modules/filebrowser.js +++ b/modules/ui-module/src/main/resources/manager/js/modules/filebrowser.js @@ -19,17 +19,17 @@ * . * #L% */ -import { listFiles, deleteFile, deleteFolder, } from './rpc/rpc-files.js'; -import { deletePage } from './rpc/rpc-page.js'; -import { openModal } from './modal.js'; -import { loadPreview } from './preview.utils.js'; -import { i18n } from './localization.js'; -import { renameFileAction, deleteElementAction, createFolderAction, createFileAction, createPageActionOfContentType } from './filebrowser.actions.js'; -import { initDragAndDropUpload, handleFileUpload } from './filebrowser.upload.js'; -import { EventBus } from './event-bus.js'; -import { filebrowserTemplate } from './filebrowser.template.js'; -import { getPageTemplates } from './rpc/rpc-manager.js'; -import { showToast } from './toast.js'; +import { listFiles, deleteFile, deleteFolder, } from '@cms/modules/rpc/rpc-files.js'; +import { deletePage } from '@cms/modules/rpc/rpc-page.js'; +import { openModal } from '@cms/modules/modal.js'; +import { loadPreview } from '@cms/modules/preview.utils.js'; +import { i18n } from '@cms/modules/localization.js'; +import { renameFileAction, deleteElementAction, createFolderAction, createFileAction, createPageActionOfContentType } from '@cms/modules/filebrowser.actions.js'; +import { initDragAndDropUpload, handleFileUpload } from '@cms/modules/filebrowser.upload.js'; +import { EventBus } from '@cms/modules/event-bus.js'; +import { filebrowserTemplate } from '@cms/modules/filebrowser.template.js'; +import { getPageTemplates } from '@cms/modules/rpc/rpc-manager.js'; +import { showToast } from '@cms/modules/toast.js'; const defaultOptions = { validate: () => true, uri: "", diff --git a/modules/ui-module/src/main/resources/manager/js/modules/filebrowser.template.js b/modules/ui-module/src/main/resources/manager/js/modules/filebrowser.template.js index 53161ef32..33a744356 100644 --- a/modules/ui-module/src/main/resources/manager/js/modules/filebrowser.template.js +++ b/modules/ui-module/src/main/resources/manager/js/modules/filebrowser.template.js @@ -19,7 +19,7 @@ * . * #L% */ -import Handlebars from '../libs/handlebars.min.js'; +import Handlebars from '@cms/libs/handlebars.min.js'; Handlebars.registerHelper("patchPathWithContext", patchPathWithContext); Handlebars.registerHelper('concat', function (...args) { args.pop(); diff --git a/modules/ui-module/src/main/resources/manager/js/modules/filebrowser.upload.js b/modules/ui-module/src/main/resources/manager/js/modules/filebrowser.upload.js index 46441496a..1855df569 100644 --- a/modules/ui-module/src/main/resources/manager/js/modules/filebrowser.upload.js +++ b/modules/ui-module/src/main/resources/manager/js/modules/filebrowser.upload.js @@ -19,11 +19,11 @@ * . * #L% */ -import { showToast } from './toast.js'; -import { i18n } from './localization.js'; -import { state } from './filebrowser.js'; -import { uploadFileWithProgress } from './upload.js'; -import { EventBus } from './event-bus.js'; +import { showToast } from '@cms/modules/toast.js'; +import { i18n } from '@cms/modules/localization.js'; +import { state } from '@cms/modules/filebrowser.js'; +import { uploadFileWithProgress } from '@cms/modules/upload.js'; +import { EventBus } from '@cms/modules/event-bus.js'; const allowedMimeTypes = [ "image/png", "image/jpeg", diff --git a/modules/ui-module/src/main/resources/manager/js/modules/form/field.checkbox.js b/modules/ui-module/src/main/resources/manager/js/modules/form/field.checkbox.js index 973cdec51..f923ec7b4 100644 --- a/modules/ui-module/src/main/resources/manager/js/modules/form/field.checkbox.js +++ b/modules/ui-module/src/main/resources/manager/js/modules/form/field.checkbox.js @@ -19,7 +19,7 @@ * . * #L% */ -import { createID } from "./utils.js"; +import { createID } from "@cms/modules/form/utils.js"; const createCheckboxField = (options, value = []) => { const id = createID(); const key = options.key || ""; diff --git a/modules/ui-module/src/main/resources/manager/js/modules/form/field.code.js b/modules/ui-module/src/main/resources/manager/js/modules/form/field.code.js index c935dcbf3..cb24d0a0a 100644 --- a/modules/ui-module/src/main/resources/manager/js/modules/form/field.code.js +++ b/modules/ui-module/src/main/resources/manager/js/modules/form/field.code.js @@ -19,8 +19,8 @@ * . * #L% */ -import { createID } from "./utils.js"; -import { i18n } from "../localization.js"; +import { createID } from "@cms/modules/form/utils.js"; +import { i18n } from "@cms/modules/localization.js"; let monacoEditors = []; const createCodeField = (options, value = '') => { const id = createID(); diff --git a/modules/ui-module/src/main/resources/manager/js/modules/form/field.color.js b/modules/ui-module/src/main/resources/manager/js/modules/form/field.color.js index 63a490a3c..bcf10a8e9 100644 --- a/modules/ui-module/src/main/resources/manager/js/modules/form/field.color.js +++ b/modules/ui-module/src/main/resources/manager/js/modules/form/field.color.js @@ -19,8 +19,8 @@ * . * #L% */ -import { createID } from "./utils.js"; -import { i18n } from "../localization.js"; +import { createID } from "@cms/modules/form/utils.js"; +import { i18n } from "@cms/modules/localization.js"; const createColorField = (options, value = '#000000') => { const id = createID(); const key = "field." + options.name; diff --git a/modules/ui-module/src/main/resources/manager/js/modules/form/field.date.js b/modules/ui-module/src/main/resources/manager/js/modules/form/field.date.js index 8e27b1e6e..7a2399099 100644 --- a/modules/ui-module/src/main/resources/manager/js/modules/form/field.date.js +++ b/modules/ui-module/src/main/resources/manager/js/modules/form/field.date.js @@ -19,8 +19,8 @@ * . * #L% */ -import { createID, getUTCDateFromInput, utcToLocalDateInputValue } from "./utils.js"; -import { i18n } from "../localization.js"; +import { createID, getUTCDateFromInput, utcToLocalDateInputValue } from "@cms/modules/form/utils.js"; +import { i18n } from "@cms/modules/localization.js"; const createDateField = (options, value = '') => { const placeholder = options.placeholder || ""; const id = createID(); diff --git a/modules/ui-module/src/main/resources/manager/js/modules/form/field.datetime.js b/modules/ui-module/src/main/resources/manager/js/modules/form/field.datetime.js index e24bd63f6..e47a388d6 100644 --- a/modules/ui-module/src/main/resources/manager/js/modules/form/field.datetime.js +++ b/modules/ui-module/src/main/resources/manager/js/modules/form/field.datetime.js @@ -19,8 +19,8 @@ * . * #L% */ -import { createID, getUTCDateTimeFromInput, utcToLocalDateTimeInputValue } from "./utils.js"; -import { i18n } from "../localization.js"; +import { createID, getUTCDateTimeFromInput, utcToLocalDateTimeInputValue } from "@cms/modules/form/utils.js"; +import { i18n } from "@cms/modules/localization.js"; const createDateTimeField = (options, value = '') => { const placeholder = options.placeholder || ""; const id = createID(); diff --git a/modules/ui-module/src/main/resources/manager/js/modules/form/field.divider.js b/modules/ui-module/src/main/resources/manager/js/modules/form/field.divider.js index 7291d073a..b6c3e3cc0 100644 --- a/modules/ui-module/src/main/resources/manager/js/modules/form/field.divider.js +++ b/modules/ui-module/src/main/resources/manager/js/modules/form/field.divider.js @@ -19,7 +19,7 @@ * . * #L% */ -import { i18n } from "../localization.js"; +import { i18n } from "@cms/modules/localization.js"; const createDivider = (options, value) => { const key = "field." + options.name; const title = i18n.t(key, options.title || ""); diff --git a/modules/ui-module/src/main/resources/manager/js/modules/form/field.easymde.js b/modules/ui-module/src/main/resources/manager/js/modules/form/field.easymde.js index 5e6e83eb6..25709b638 100644 --- a/modules/ui-module/src/main/resources/manager/js/modules/form/field.easymde.js +++ b/modules/ui-module/src/main/resources/manager/js/modules/form/field.easymde.js @@ -19,8 +19,8 @@ * . * #L% */ -import { createID } from "./utils.js"; -import { i18n } from "../localization.js"; +import { createID } from "@cms/modules/form/utils.js"; +import { i18n } from "@cms/modules/localization.js"; let markdownEditors = []; const createMarkdownField = (options, value = '') => { const id = createID(); diff --git a/modules/ui-module/src/main/resources/manager/js/modules/form/field.list.js b/modules/ui-module/src/main/resources/manager/js/modules/form/field.list.js index c3f7eef67..821bbb62b 100644 --- a/modules/ui-module/src/main/resources/manager/js/modules/form/field.list.js +++ b/modules/ui-module/src/main/resources/manager/js/modules/form/field.list.js @@ -19,14 +19,14 @@ * . * #L% */ -import { createID } from "./utils.js"; -import { i18n } from "../localization.js"; -import { createForm } from "./forms.js"; -import { openModal } from "../modal.js"; -import { buildValuesFromFields } from "../node.js"; -import { getListItemTypes, getPageTemplates } from "../rpc/rpc-manager.js"; -import { getContent, getContentNode } from "../rpc/rpc-content.js"; -import { getPreviewUrl } from "../preview.utils.js"; +import { createID } from "@cms/modules/form/utils.js"; +import { i18n } from "@cms/modules/localization.js"; +import { createForm } from "@cms/modules/form/forms.js"; +import { openModal } from "@cms/modules/modal.js"; +import { buildValuesFromFields } from "@cms/modules/node.js"; +import { getListItemTypes, getPageTemplates } from "@cms/modules/rpc/rpc-manager.js"; +import { getContent, getContentNode } from "@cms/modules/rpc/rpc-content.js"; +import { getPreviewUrl } from "@cms/modules/preview.utils.js"; const createListField = (options, value = []) => { const id = createID(); const key = "field." + options.name; diff --git a/modules/ui-module/src/main/resources/manager/js/modules/form/field.mail.js b/modules/ui-module/src/main/resources/manager/js/modules/form/field.mail.js index c7a4a536d..5620504aa 100644 --- a/modules/ui-module/src/main/resources/manager/js/modules/form/field.mail.js +++ b/modules/ui-module/src/main/resources/manager/js/modules/form/field.mail.js @@ -19,8 +19,8 @@ * . * #L% */ -import { createID } from "./utils.js"; -import { i18n } from "../localization.js"; +import { createID } from "@cms/modules/form/utils.js"; +import { i18n } from "@cms/modules/localization.js"; const createEmailField = (options, value = '') => { const placeholder = options.placeholder || ""; const id = createID(); diff --git a/modules/ui-module/src/main/resources/manager/js/modules/form/field.markdown.js b/modules/ui-module/src/main/resources/manager/js/modules/form/field.markdown.js index eb3753c0f..c4a5d58e1 100644 --- a/modules/ui-module/src/main/resources/manager/js/modules/form/field.markdown.js +++ b/modules/ui-module/src/main/resources/manager/js/modules/form/field.markdown.js @@ -19,11 +19,11 @@ * . * #L% */ -import { createID } from "./utils.js"; -import { i18n } from "../localization.js"; -import { getMediaFormats, getTagNames } from "../rpc/rpc-manager.js"; -import { openFileBrowser } from "../filebrowser.js"; -import { alertSelect } from "../alerts.js"; +import { createID } from "@cms/modules/form/utils.js"; +import { i18n } from "@cms/modules/localization.js"; +import { getMediaFormats, getTagNames } from "@cms/modules/rpc/rpc-manager.js"; +import { openFileBrowser } from "@cms/modules/filebrowser.js"; +import { alertSelect } from "@cms/modules/alerts.js"; let cherryEditors = []; const createMarkdownField = (options, value = '') => { const id = createID(); diff --git a/modules/ui-module/src/main/resources/manager/js/modules/form/field.media.js b/modules/ui-module/src/main/resources/manager/js/modules/form/field.media.js index 315ca3980..dba4cd1d9 100644 --- a/modules/ui-module/src/main/resources/manager/js/modules/form/field.media.js +++ b/modules/ui-module/src/main/resources/manager/js/modules/form/field.media.js @@ -19,10 +19,10 @@ * . * #L% */ -import { createID } from "./utils.js"; -import { i18n } from "../localization.js"; -import { uploadFileWithProgress } from "../upload.js"; -import { openFileBrowser } from "../filebrowser.js"; +import { createID } from "@cms/modules/form/utils.js"; +import { i18n } from "@cms/modules/localization.js"; +import { uploadFileWithProgress } from "@cms/modules/upload.js"; +import { openFileBrowser } from "@cms/modules/filebrowser.js"; const createMediaField = (options, value = '') => { const id = createID(); const key = "field." + options.name; diff --git a/modules/ui-module/src/main/resources/manager/js/modules/form/field.number.js b/modules/ui-module/src/main/resources/manager/js/modules/form/field.number.js index bf2d507bb..18534874c 100644 --- a/modules/ui-module/src/main/resources/manager/js/modules/form/field.number.js +++ b/modules/ui-module/src/main/resources/manager/js/modules/form/field.number.js @@ -19,8 +19,8 @@ * . * #L% */ -import { createID } from "./utils.js"; -import { i18n } from "../localization.js"; +import { i18n } from "@cms/modules/localization.js"; +import { createID } from "@cms/modules/form/utils.js"; const createNumberField = (options, value = '') => { const placeholder = options.placeholder || ""; const id = createID(); diff --git a/modules/ui-module/src/main/resources/manager/js/modules/form/field.radio.js b/modules/ui-module/src/main/resources/manager/js/modules/form/field.radio.js index cce7d8510..911faad66 100644 --- a/modules/ui-module/src/main/resources/manager/js/modules/form/field.radio.js +++ b/modules/ui-module/src/main/resources/manager/js/modules/form/field.radio.js @@ -19,8 +19,8 @@ * . * #L% */ -import { createID } from "./utils.js"; -import { i18n } from "../localization.js"; +import { createID } from "@cms/modules/form/utils.js"; +import { i18n } from "@cms/modules/localization.js"; const createRadioField = (options, value = '') => { const id = createID(); const key = "field." + options.name; diff --git a/modules/ui-module/src/main/resources/manager/js/modules/form/field.range.js b/modules/ui-module/src/main/resources/manager/js/modules/form/field.range.js index b62160f12..11310fdd6 100644 --- a/modules/ui-module/src/main/resources/manager/js/modules/form/field.range.js +++ b/modules/ui-module/src/main/resources/manager/js/modules/form/field.range.js @@ -19,8 +19,8 @@ * . * #L% */ -import { createID } from "./utils.js"; -import { i18n } from "../localization.js"; +import { createID } from "@cms/modules/form/utils.js"; +import { i18n } from "@cms/modules/localization.js"; const createRangeField = (options, value = '') => { const id = createID(); const key = "field." + options.name; diff --git a/modules/ui-module/src/main/resources/manager/js/modules/form/field.reference.js b/modules/ui-module/src/main/resources/manager/js/modules/form/field.reference.js index b45ef0eec..7873e3afd 100644 --- a/modules/ui-module/src/main/resources/manager/js/modules/form/field.reference.js +++ b/modules/ui-module/src/main/resources/manager/js/modules/form/field.reference.js @@ -19,9 +19,9 @@ * . * #L% */ -import { createID } from "./utils.js"; -import { i18n } from "../localization.js"; -import { openFileBrowser } from "../filebrowser.js"; +import { createID } from "@cms/modules/form/utils.js"; +import { i18n } from "@cms/modules/localization.js"; +import { openFileBrowser } from "@cms/modules/filebrowser.js"; const createReferenceField = (options, value = '') => { const id = createID(); const key = "field." + options.name; diff --git a/modules/ui-module/src/main/resources/manager/js/modules/form/field.select.js b/modules/ui-module/src/main/resources/manager/js/modules/form/field.select.js index e1ff731f8..8c1d29711 100644 --- a/modules/ui-module/src/main/resources/manager/js/modules/form/field.select.js +++ b/modules/ui-module/src/main/resources/manager/js/modules/form/field.select.js @@ -19,8 +19,8 @@ * . * #L% */ -import { createID } from "./utils.js"; -import { i18n } from "../localization.js"; +import { createID } from "@cms/modules/form/utils.js"; +import { i18n } from "@cms/modules/localization.js"; const createSelectField = (options, value = '') => { const id = createID(); const key = "field." + options.name; diff --git a/modules/ui-module/src/main/resources/manager/js/modules/form/field.text.js b/modules/ui-module/src/main/resources/manager/js/modules/form/field.text.js index 1bf0d0ae8..67095eb95 100644 --- a/modules/ui-module/src/main/resources/manager/js/modules/form/field.text.js +++ b/modules/ui-module/src/main/resources/manager/js/modules/form/field.text.js @@ -19,8 +19,8 @@ * . * #L% */ -import { createID } from "./utils.js"; -import { i18n } from "../localization.js"; +import { createID } from "@cms/modules/form/utils.js"; +import { i18n } from "@cms/modules/localization.js"; const createTextField = (options, value = '') => { const placeholder = options.placeholder || ""; const id = createID(); diff --git a/modules/ui-module/src/main/resources/manager/js/modules/form/field.textarea.js b/modules/ui-module/src/main/resources/manager/js/modules/form/field.textarea.js index faf913aed..49320a8d2 100644 --- a/modules/ui-module/src/main/resources/manager/js/modules/form/field.textarea.js +++ b/modules/ui-module/src/main/resources/manager/js/modules/form/field.textarea.js @@ -19,8 +19,8 @@ * . * #L% */ -import { createID } from "./utils.js"; -import { i18n } from "../localization.js"; +import { createID } from "@cms/modules/form/utils.js"; +import { i18n } from "@cms/modules/localization.js"; const createTextAreaField = (options, value = '') => { const rows = options.rows || 5; const id = createID(); diff --git a/modules/ui-module/src/main/resources/manager/js/modules/form/forms.js b/modules/ui-module/src/main/resources/manager/js/modules/form/forms.js index 9217b20f3..9c0a286ca 100644 --- a/modules/ui-module/src/main/resources/manager/js/modules/form/forms.js +++ b/modules/ui-module/src/main/resources/manager/js/modules/form/forms.js @@ -19,25 +19,25 @@ * . * #L% */ -import { createID } from "./utils.js"; -import { TextField } from "./field.text.js"; -import { MailField } from "./field.mail.js"; -import { CodeField } from "./field.code.js"; -import { SelectField } from "./field.select.js"; -import { MarkdownField } from "./field.markdown.js"; -import { EasyMDEField } from "./field.easymde.js"; -import { NumberField } from "./field.number.js"; -import { DateField } from "./field.date.js"; -import { ColorField } from "./field.color.js"; -import { DateTimeField } from "./field.datetime.js"; -import { RangeField } from "./field.range.js"; -import { RadioField } from "./field.radio.js"; -import { CheckboxField } from "./field.checkbox.js"; -import { Divider } from "./field.divider.js"; -import { MediaField } from "./field.media.js"; -import { ListField } from "./field.list.js"; -import { TextAreaField } from "./field.textarea.js"; -import { ReferenceField } from "./field.reference.js"; +import { createID } from "@cms/modules/form/utils.js"; +import { TextField } from "@cms/modules/form/field.text.js"; +import { MailField } from "@cms/modules/form/field.mail.js"; +import { CodeField } from "@cms/modules/form/field.code.js"; +import { SelectField } from "@cms/modules/form/field.select.js"; +import { MarkdownField } from "@cms/modules/form/field.markdown.js"; +import { EasyMDEField } from "@cms/modules/form/field.easymde.js"; +import { NumberField } from "@cms/modules/form/field.number.js"; +import { DateField } from "@cms/modules/form/field.date.js"; +import { ColorField } from "@cms/modules/form/field.color.js"; +import { DateTimeField } from "@cms/modules/form/field.datetime.js"; +import { RangeField } from "@cms/modules/form/field.range.js"; +import { RadioField } from "@cms/modules/form/field.radio.js"; +import { CheckboxField } from "@cms/modules/form/field.checkbox.js"; +import { Divider } from "@cms/modules/form/field.divider.js"; +import { MediaField } from "@cms/modules/form/field.media.js"; +import { ListField } from "@cms/modules/form/field.list.js"; +import { TextAreaField } from "@cms/modules/form/field.textarea.js"; +import { ReferenceField } from "@cms/modules/form/field.reference.js"; const createForm = (options) => { const fields = options.fields || []; const values = options.values || {}; diff --git a/modules/ui-module/src/main/resources/manager/js/modules/locale-utils.js b/modules/ui-module/src/main/resources/manager/js/modules/locale-utils.js index ffd93267b..968d40287 100644 --- a/modules/ui-module/src/main/resources/manager/js/modules/locale-utils.js +++ b/modules/ui-module/src/main/resources/manager/js/modules/locale-utils.js @@ -19,7 +19,7 @@ * . * #L% */ -import { UIStateManager } from './ui-state.js'; +import { UIStateManager } from '@cms/modules/ui-state.js'; const DEFAULT_LOCALE = 'en'; export function getLocale() { return UIStateManager.getLocale(DEFAULT_LOCALE); diff --git a/modules/ui-module/src/main/resources/manager/js/modules/localization-loader.js b/modules/ui-module/src/main/resources/manager/js/modules/localization-loader.js index c2cafa1d2..a94730f9b 100644 --- a/modules/ui-module/src/main/resources/manager/js/modules/localization-loader.js +++ b/modules/ui-module/src/main/resources/manager/js/modules/localization-loader.js @@ -19,9 +19,9 @@ * . * #L% */ -import { ACTION_LOCALIZATIONS } from './localization-actions.js'; -import { MODULE_LOCALIZATIONS } from './localization-modules.js'; -import { loadLocalizations } from './rpc/rpc-i18n.js'; +import { ACTION_LOCALIZATIONS } from '@cms/modules/localization-actions.js'; +import { MODULE_LOCALIZATIONS } from '@cms/modules/localization-modules.js'; +import { loadLocalizations } from '@cms/modules/rpc/rpc-i18n.js'; const DEFAULT_LOCALIZATIONS = { en: { "ui.filebrowser.filename": "Filename", diff --git a/modules/ui-module/src/main/resources/manager/js/modules/localization.js b/modules/ui-module/src/main/resources/manager/js/modules/localization.js index 18e6454ab..e6247f38f 100644 --- a/modules/ui-module/src/main/resources/manager/js/modules/localization.js +++ b/modules/ui-module/src/main/resources/manager/js/modules/localization.js @@ -19,8 +19,8 @@ * . * #L% */ -import { getLocale, setLocale } from './locale-utils.js'; -import { loadLocalizationsWithDefaults } from './localization-loader.js'; +import { getLocale, setLocale } from '@cms/modules/locale-utils.js'; +import { loadLocalizationsWithDefaults } from '@cms/modules/localization-loader.js'; const DEFAULT_LOCALE = 'en'; const i18n = { _locale: getLocale(), diff --git a/modules/ui-module/src/main/resources/manager/js/modules/manager-ui.js b/modules/ui-module/src/main/resources/manager/js/modules/manager-ui.js index e443f4ee5..b0b8846d3 100644 --- a/modules/ui-module/src/main/resources/manager/js/modules/manager-ui.js +++ b/modules/ui-module/src/main/resources/manager/js/modules/manager-ui.js @@ -19,8 +19,8 @@ * . * #L% */ -import { getContentNode, setMeta, getContent } from './rpc/rpc-content.js'; -import { getPreviewUrl } from './preview.utils.js'; +import { getContentNode, setMeta, getContent } from '@cms/modules/rpc/rpc-content.js'; +import { getPreviewUrl } from '@cms/modules/preview.utils.js'; export function updateStateButton() { var previewUrl = getPreviewUrl(); ; diff --git a/modules/ui-module/src/main/resources/manager/js/modules/manager/manager.message.handlers.js b/modules/ui-module/src/main/resources/manager/js/modules/manager/manager.message.handlers.js index a6419b32d..0b1320db7 100644 --- a/modules/ui-module/src/main/resources/manager/js/modules/manager/manager.message.handlers.js +++ b/modules/ui-module/src/main/resources/manager/js/modules/manager/manager.message.handlers.js @@ -19,9 +19,9 @@ * . * #L% */ -import frameMessenger from '../frameMessenger'; -import { getPreviewFrame, getPreviewUrl } from '../preview.utils'; -import { getContentNode } from '../rpc/rpc-content'; +import frameMessenger from '@cms/modules/frameMessenger.js'; +import { getPreviewFrame, getPreviewUrl } from '@cms/modules/preview.utils.js'; +import { getContentNode } from '@cms/modules/rpc/rpc-content.js'; const executeImageForm = (payload) => { const cmd = { "module": window.manager.baseUrl + "/actions/media/edit-media-form", diff --git a/modules/ui-module/src/main/resources/manager/js/modules/manager/media.inject.js b/modules/ui-module/src/main/resources/manager/js/modules/manager/media.inject.js index c3c29d61c..603228fc1 100644 --- a/modules/ui-module/src/main/resources/manager/js/modules/manager/media.inject.js +++ b/modules/ui-module/src/main/resources/manager/js/modules/manager/media.inject.js @@ -19,8 +19,8 @@ * . * #L% */ -import { EDIT_ATTRIBUTES_ICON, IMAGE_ICON, MEDIA_CROP_ICON } from "./toolbar-icons"; -import frameMessenger from '../frameMessenger.js'; +import { EDIT_ATTRIBUTES_ICON, IMAGE_ICON, MEDIA_CROP_ICON } from "@cms/modules/manager/toolbar-icons"; +import frameMessenger from '@cms/modules/frameMessenger.js'; const isSameDomainImage = (imgElement) => { if (!(imgElement instanceof HTMLImageElement)) { return false; // ist kein diff --git a/modules/ui-module/src/main/resources/manager/js/modules/manager/toolbar.inject.js b/modules/ui-module/src/main/resources/manager/js/modules/manager/toolbar.inject.js index 7e1873519..3f1013ca7 100644 --- a/modules/ui-module/src/main/resources/manager/js/modules/manager/toolbar.inject.js +++ b/modules/ui-module/src/main/resources/manager/js/modules/manager/toolbar.inject.js @@ -19,8 +19,8 @@ * . * #L% */ -import frameMessenger from "../frameMessenger"; -import { EDIT_ATTRIBUTES_ICON, EDIT_PAGE_ICON, SECTION_ADD_ICON, SECTION_DELETE_ICON, SECTION_SORT_ICON, SECTION_UNPUBLISHED_ICON } from "./toolbar-icons"; +import frameMessenger from "@cms/modules/frameMessenger.js"; +import { EDIT_ATTRIBUTES_ICON, EDIT_PAGE_ICON, SECTION_ADD_ICON, SECTION_DELETE_ICON, SECTION_SORT_ICON, SECTION_UNPUBLISHED_ICON } from "@cms/modules/manager/toolbar-icons"; const addSection = (event) => { var toolbar = event.target.closest('[data-cms-toolbar]'); var toolbarDefinition = JSON.parse(toolbar.dataset.cmsToolbar); diff --git a/modules/ui-module/src/main/resources/manager/js/modules/modal.js b/modules/ui-module/src/main/resources/manager/js/modules/modal.js index 80c1c2686..64161c72a 100644 --- a/modules/ui-module/src/main/resources/manager/js/modules/modal.js +++ b/modules/ui-module/src/main/resources/manager/js/modules/modal.js @@ -19,7 +19,7 @@ * . * #L% */ -import { i18n } from "./localization.js"; +import { i18n } from "@cms/modules/localization.js"; const defaultOptions = { validate: () => true }; diff --git a/modules/ui-module/src/main/resources/manager/js/modules/preview.utils.js b/modules/ui-module/src/main/resources/manager/js/modules/preview.utils.js index 4cf2ccb6b..1f288a0e9 100644 --- a/modules/ui-module/src/main/resources/manager/js/modules/preview.utils.js +++ b/modules/ui-module/src/main/resources/manager/js/modules/preview.utils.js @@ -19,7 +19,7 @@ * . * #L% */ -import { EventBus } from "./event-bus.js"; +import { EventBus } from "@cms/modules/event-bus.js"; //PreviewHistory.init(); // close overlay on preview loaded EventBus.on("preview:loaded", (data) => { diff --git a/modules/ui-module/src/main/resources/manager/js/modules/rpc/rpc-content.js b/modules/ui-module/src/main/resources/manager/js/modules/rpc/rpc-content.js index 152618206..0cef6646d 100644 --- a/modules/ui-module/src/main/resources/manager/js/modules/rpc/rpc-content.js +++ b/modules/ui-module/src/main/resources/manager/js/modules/rpc/rpc-content.js @@ -19,7 +19,7 @@ * . * #L% */ -import { executeRemoteCall } from './rpc.js'; +import { executeRemoteCall } from '@cms/modules/rpc/rpc.js'; const getContentNode = async (options) => { var data = { method: "content.node", diff --git a/modules/ui-module/src/main/resources/manager/js/modules/rpc/rpc-files.js b/modules/ui-module/src/main/resources/manager/js/modules/rpc/rpc-files.js index 24b9108d4..df7753934 100644 --- a/modules/ui-module/src/main/resources/manager/js/modules/rpc/rpc-files.js +++ b/modules/ui-module/src/main/resources/manager/js/modules/rpc/rpc-files.js @@ -19,7 +19,7 @@ * . * #L% */ -import { executeRemoteCall } from './rpc.js'; +import { executeRemoteCall } from '@cms/modules/rpc/rpc.js'; const listFiles = async (options) => { var data = { method: "files.list", diff --git a/modules/ui-module/src/main/resources/manager/js/modules/rpc/rpc-i18n.js b/modules/ui-module/src/main/resources/manager/js/modules/rpc/rpc-i18n.js index a0f37abf5..9525d4c7d 100644 --- a/modules/ui-module/src/main/resources/manager/js/modules/rpc/rpc-i18n.js +++ b/modules/ui-module/src/main/resources/manager/js/modules/rpc/rpc-i18n.js @@ -19,7 +19,7 @@ * . * #L% */ -import { executeRemoteCall } from './rpc.js'; +import { executeRemoteCall } from '@cms/modules/rpc/rpc.js'; const loadLocalizations = async (options) => { var data = { method: "i18n.load" diff --git a/modules/ui-module/src/main/resources/manager/js/modules/rpc/rpc-manager.js b/modules/ui-module/src/main/resources/manager/js/modules/rpc/rpc-manager.js index a923c6169..ed5ef8cf1 100644 --- a/modules/ui-module/src/main/resources/manager/js/modules/rpc/rpc-manager.js +++ b/modules/ui-module/src/main/resources/manager/js/modules/rpc/rpc-manager.js @@ -19,7 +19,7 @@ * . * #L% */ -import { executeRemoteCall } from './rpc.js'; +import { executeRemoteCall } from '@cms/modules/rpc/rpc.js'; const getSectionTemplates = async (options) => { var data = { method: "manager.contentTypes.sections", diff --git a/modules/ui-module/src/main/resources/manager/js/modules/rpc/rpc-media.js b/modules/ui-module/src/main/resources/manager/js/modules/rpc/rpc-media.js index a7a6bb83e..576982e45 100644 --- a/modules/ui-module/src/main/resources/manager/js/modules/rpc/rpc-media.js +++ b/modules/ui-module/src/main/resources/manager/js/modules/rpc/rpc-media.js @@ -19,7 +19,7 @@ * . * #L% */ -import { executeRemoteCall } from './rpc.js'; +import { executeRemoteCall } from '@cms/modules/rpc/rpc.js'; const getMediaMetaData = async (options) => { var data = { method: "media.meta.get", diff --git a/modules/ui-module/src/main/resources/manager/js/modules/rpc/rpc-page.js b/modules/ui-module/src/main/resources/manager/js/modules/rpc/rpc-page.js index 071279810..d324b87a5 100644 --- a/modules/ui-module/src/main/resources/manager/js/modules/rpc/rpc-page.js +++ b/modules/ui-module/src/main/resources/manager/js/modules/rpc/rpc-page.js @@ -19,7 +19,7 @@ * . * #L% */ -import { executeRemoteCall } from './rpc.js'; +import { executeRemoteCall } from '@cms/modules/rpc/rpc.js'; const createPage = async (options) => { var data = { method: "page.create", diff --git a/modules/ui-module/src/main/resources/manager/js/modules/rpc/rpc-translation.js b/modules/ui-module/src/main/resources/manager/js/modules/rpc/rpc-translation.js index 1a8b52c24..719b68406 100644 --- a/modules/ui-module/src/main/resources/manager/js/modules/rpc/rpc-translation.js +++ b/modules/ui-module/src/main/resources/manager/js/modules/rpc/rpc-translation.js @@ -19,7 +19,7 @@ * . * #L% */ -import { executeRemoteCall } from './rpc.js'; +import { executeRemoteCall } from '@cms/modules/rpc/rpc.js'; const getTranslations = async (options) => { var data = { method: "translations.get", diff --git a/modules/ui-module/src/main/resources/manager/js/modules/rpc/rpc.js b/modules/ui-module/src/main/resources/manager/js/modules/rpc/rpc.js index 39e3f93bb..6400dca1f 100644 --- a/modules/ui-module/src/main/resources/manager/js/modules/rpc/rpc.js +++ b/modules/ui-module/src/main/resources/manager/js/modules/rpc/rpc.js @@ -19,7 +19,7 @@ * . * #L% */ -import { i18n } from "../localization.js"; +import { i18n } from "@cms/modules/localization.js"; const executeRemoteCall = async (options) => { return executeRemoteMethodCall(options.method, options.parameters); }; diff --git a/modules/ui-module/src/main/resources/manager/js/modules/toast.js b/modules/ui-module/src/main/resources/manager/js/modules/toast.js index 41162220d..421728aea 100644 --- a/modules/ui-module/src/main/resources/manager/js/modules/toast.js +++ b/modules/ui-module/src/main/resources/manager/js/modules/toast.js @@ -19,7 +19,7 @@ * . * #L% */ -import { i18n } from './localization.js'; +import { i18n } from '@cms/modules/localization.js'; const showToast = (options) => { const toastId = 'toast_' + Date.now(); // Fallbacks diff --git a/modules/ui-module/src/main/resources/manager/js/modules/ui-state.js b/modules/ui-module/src/main/resources/manager/js/modules/ui-state.js index a004b4f0c..45c49dd1d 100644 --- a/modules/ui-module/src/main/resources/manager/js/modules/ui-state.js +++ b/modules/ui-module/src/main/resources/manager/js/modules/ui-state.js @@ -20,7 +20,7 @@ * #L% */ // state-manager.js -import { EventBus } from "./event-bus.js"; +import { EventBus } from "@cms/modules/event-bus.js"; const TAB_ID_KEY = "cms-tab-id"; const AUTH_KEY = "cms-auth-token"; export const UIStateManager = { diff --git a/modules/ui-module/src/main/resources/manager/js/ui-actions.js b/modules/ui-module/src/main/resources/manager/js/ui-actions.js index 0727292ed..4e819f324 100644 --- a/modules/ui-module/src/main/resources/manager/js/ui-actions.js +++ b/modules/ui-module/src/main/resources/manager/js/ui-actions.js @@ -19,8 +19,8 @@ * . * #L% */ -import { EventBus } from './modules/event-bus.js'; -import { i18n, localizeUi } from './modules/localization.js'; +import { EventBus } from '@cms/modules/event-bus.js'; +import { i18n, localizeUi } from '@cms/modules/localization.js'; window.addEventListener("DOMContentLoaded", async () => { /* await i18n.init() diff --git a/modules/ui-module/src/main/ts/dist/actions/reload-preview.js b/modules/ui-module/src/main/ts/dist/actions/reload-preview.js index bc8cce531..2d94fd751 100644 --- a/modules/ui-module/src/main/ts/dist/actions/reload-preview.js +++ b/modules/ui-module/src/main/ts/dist/actions/reload-preview.js @@ -19,7 +19,7 @@ * . * #L% */ -import { reloadPreview } from "../js/modules/preview.utils"; +import { reloadPreview } from "@cms/modules/preview.utils.js"; export async function runAction(params) { reloadPreview(); } diff --git a/modules/ui-module/src/main/ts/dist/js/manager-inject-init.js b/modules/ui-module/src/main/ts/dist/js/manager-inject-init.js new file mode 100644 index 000000000..843e824e6 --- /dev/null +++ b/modules/ui-module/src/main/ts/dist/js/manager-inject-init.js @@ -0,0 +1,122 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +import frameMessenger from '@cms/modules/frameMessenger.js'; +import { initContentMediaToolbar, initMediaToolbar, initMediaUploadOverlay } from '@cms/modules/manager/media.inject.js'; +import { EDIT_ATTRIBUTES_ICON, EDIT_PAGE_ICON, SECTION_ADD_ICON, SECTION_DELETE_ICON, SECTION_PUBLISHED_ICON, SECTION_SORT_ICON, SECTION_UNPUBLISHED_ICON } from '@cms/modules/manager/toolbar-icons'; +import { initToolbar } from '@cms/modules/manager/toolbar.inject.js'; +const isIframe = () => { + return typeof window !== 'undefined' && window.self !== window.top; +}; +export function initIframe() { + if (!isIframe()) { + return; + } + frameMessenger.send(window.parent, { + type: 'loaded', + payload: {} + }); + const toolbarContainers = document.querySelectorAll('[data-cms-toolbar]'); + toolbarContainers.forEach(initToolbar); + const mediaToolbarContainers = document.querySelectorAll('img[data-cms-media-toolbar]'); + mediaToolbarContainers.forEach(initMediaToolbar); + const contentMediaContainers = document.querySelectorAll('img[data-cms-ui-selector=content-image]'); + contentMediaContainers.forEach(initContentMediaToolbar); + //const mediaUploadContainers = document.querySelectorAll('img[data-cms-media-actions~=upload]'); + //mediaUploadContainers.forEach(initMediaUploadOverlay); + document.addEventListener('keydown', (event) => { + if (event.key.toLowerCase() === 'k' && (event.metaKey || event.ctrlKey)) { + event.preventDefault(); + frameMessenger.send(window.parent, { + type: 'shortkeys', + payload: {} + }); + } + }); + frameMessenger.on('getContentNodeResponse', async (payload) => { + for (const [sectionName, items] of Object.entries(payload.contentNode.sections)) { + for (const item of items) { + const sectionContainer = document.querySelector(`[data-cms-section-uri="${item.uri}"]`); + if (!sectionContainer) { + continue; + } + if (item.data.published) { + sectionContainer.setAttribute('data-cms-action', 'unpublish'); + sectionContainer.setAttribute("title", "Unpublish"); + if (isSectionPublishedExpired(item)) { + sectionContainer.innerHTML = SECTION_UNPUBLISHED_ICON; + sectionContainer.classList.remove('cms-unpublished'); + sectionContainer.classList.remove('cms-published'); + sectionContainer.classList.add('cms-published-expired'); + } + else { + sectionContainer.innerHTML = SECTION_PUBLISHED_ICON; + sectionContainer.classList.remove('cms-unpublished'); + sectionContainer.classList.remove('cms-published-expired'); + sectionContainer.classList.add('cms-published'); + } + } + else { + sectionContainer.innerHTML = SECTION_UNPUBLISHED_ICON; + sectionContainer.setAttribute('data-cms-action', 'publish'); + sectionContainer.setAttribute("title", "Publish"); + sectionContainer.classList.remove('cms-published'); + sectionContainer.classList.remove('cms-published-expired'); + sectionContainer.classList.add('cms-unpublished'); + } + } + } + }); + frameMessenger.send(window.parent, { + type: 'getContentNode', + payload: {} + }); + document.addEventListener('click', function (event) { + if (event.target.matches('[data-cms-action]')) { + const button = event.target; + // Wenn bereits disabled, nichts tun + if (button.disabled) { + event.preventDefault(); + return; + } + // Button deaktivieren + button.disabled = true; + // Nach 2 Sekunden wieder aktivieren + setTimeout(() => { + button.disabled = false; + }, 2000); + } + }); +} +; +export function isSectionPublishedExpired(section) { + const publishDateStr = section.data.publish_date; + const unpublishDateStr = section.data.unpublish_date; + const now = new Date(); + const publishDate = publishDateStr ? new Date(publishDateStr) : null; + const unpublishDate = unpublishDateStr ? new Date(unpublishDateStr) : null; + // section is published if: + // - publishDate empty or in the past + // - und unpublishDate empty or in the future + const isPublished = (!publishDate || publishDate <= now) && + (!unpublishDate || unpublishDate > now); + return !isPublished; +} diff --git a/modules/ui-module/src/main/ts/dist/js/manager-inject.js b/modules/ui-module/src/main/ts/dist/js/manager-inject.js index 5c4f573e1..2be90ce2a 100644 --- a/modules/ui-module/src/main/ts/dist/js/manager-inject.js +++ b/modules/ui-module/src/main/ts/dist/js/manager-inject.js @@ -19,103 +19,33 @@ * . * #L% */ -import frameMessenger from './modules/frameMessenger.js'; -import { initContentMediaToolbar, initMediaToolbar, initMediaUploadOverlay } from './modules/manager/media.inject.js'; -import { EDIT_ATTRIBUTES_ICON, EDIT_PAGE_ICON, SECTION_ADD_ICON, SECTION_DELETE_ICON, SECTION_PUBLISHED_ICON, SECTION_SORT_ICON, SECTION_UNPUBLISHED_ICON } from './modules/manager/toolbar-icons'; -import { initToolbar } from './modules/manager/toolbar.inject.js'; -const isIframe = () => { - return typeof window !== 'undefined' && window.self !== window.top; -}; -document.addEventListener("DOMContentLoaded", function () { - if (!isIframe()) { - return; - } - frameMessenger.send(window.parent, { - type: 'loaded', - payload: {} - }); - const toolbarContainers = document.querySelectorAll('[data-cms-toolbar]'); - toolbarContainers.forEach(initToolbar); - const mediaToolbarContainers = document.querySelectorAll('img[data-cms-media-toolbar]'); - mediaToolbarContainers.forEach(initMediaToolbar); - const contentMediaContainers = document.querySelectorAll('img[data-cms-ui-selector=content-image]'); - contentMediaContainers.forEach(initContentMediaToolbar); - //const mediaUploadContainers = document.querySelectorAll('img[data-cms-media-actions~=upload]'); - //mediaUploadContainers.forEach(initMediaUploadOverlay); - document.addEventListener('keydown', (event) => { - if (event.key.toLowerCase() === 'k' && (event.metaKey || event.ctrlKey)) { - event.preventDefault(); - frameMessenger.send(window.parent, { - type: 'shortkeys', - payload: {} - }); +(async function () { + // Basis-URLs aus Parent ableiten + const parentManager = window.parent?.manager || {}; + const baseUrl = parentManager.baseUrl || '/manager'; + const contextPath = parentManager.contextPath || '/'; + const importMap = { + imports: { + "@cms/js/": `${baseUrl}/js/`, + "@cms/libs/": `${baseUrl}/js/libs/`, + "@cms/manager/": `${baseUrl}/js/manager/`, + "@cms/modules/": `${baseUrl}/js/modules/` } - }); - frameMessenger.on('getContentNodeResponse', async (payload) => { - for (const [sectionName, items] of Object.entries(payload.contentNode.sections)) { - for (const item of items) { - const sectionContainer = document.querySelector(`[data-cms-section-uri="${item.uri}"]`); - if (!sectionContainer) { - continue; - } - if (item.data.published) { - sectionContainer.setAttribute('data-cms-action', 'unpublish'); - sectionContainer.setAttribute("title", "Unpublish"); - if (isSectionPublishedExpired(item)) { - sectionContainer.innerHTML = SECTION_UNPUBLISHED_ICON; - sectionContainer.classList.remove('cms-unpublished'); - sectionContainer.classList.remove('cms-published'); - sectionContainer.classList.add('cms-published-expired'); - } - else { - sectionContainer.innerHTML = SECTION_PUBLISHED_ICON; - sectionContainer.classList.remove('cms-unpublished'); - sectionContainer.classList.remove('cms-published-expired'); - sectionContainer.classList.add('cms-published'); - } - } - else { - sectionContainer.innerHTML = SECTION_UNPUBLISHED_ICON; - sectionContainer.setAttribute('data-cms-action', 'publish'); - sectionContainer.setAttribute("title", "Publish"); - sectionContainer.classList.remove('cms-published'); - sectionContainer.classList.remove('cms-published-expired'); - sectionContainer.classList.add('cms-unpublished'); - } - } - } - }); - frameMessenger.send(window.parent, { - type: 'getContentNode', - payload: {} - }); - document.addEventListener('click', function (event) { - if (event.target.matches('[data-cms-action]')) { - const button = event.target; - // Wenn bereits disabled, nichts tun - if (button.disabled) { - event.preventDefault(); - return; - } - // Button deaktivieren - button.disabled = true; - // Nach 2 Sekunden wieder aktivieren - setTimeout(() => { - button.disabled = false; - }, 2000); - } - }); -}); -export function isSectionPublishedExpired(section) { - const publishDateStr = section.data.publish_date; - const unpublishDateStr = section.data.unpublish_date; - const now = new Date(); - const publishDate = publishDateStr ? new Date(publishDateStr) : null; - const unpublishDate = unpublishDateStr ? new Date(unpublishDateStr) : null; - // section is published if: - // - publishDate empty or in the past - // - und unpublishDate empty or in the future - const isPublished = (!publishDate || publishDate <= now) && - (!unpublishDate || unpublishDate > now); - return !isPublished; -} + }; + // 2. Import Map setzen + const script = document.createElement('script'); + script.type = 'importmap'; + script.textContent = JSON.stringify(importMap); + script.onload = () => { + console.log('✅ Import Map ready!'); // Debug + resolve(); + }; + document.head.appendChild(script); + // 3. window.manager kopieren + window.manager = parentManager; + // 4. Plugins laden + console.log('🔥 Loading manager-inject-init...'); + const { initIframe } = await import('@cms/js/manager-inject-init.js'); + console.log('✅ initModule loaded!', initIframe); + initIframe(); +})(); diff --git a/modules/ui-module/src/main/ts/dist/js/manager.js b/modules/ui-module/src/main/ts/dist/js/manager.js index 03c9dcac0..54ca56146 100644 --- a/modules/ui-module/src/main/ts/dist/js/manager.js +++ b/modules/ui-module/src/main/ts/dist/js/manager.js @@ -19,12 +19,12 @@ * . * #L% */ -import frameMessenger from './modules/frameMessenger.js'; -import { loadPreview } from './modules/preview.utils.js'; -import { UIStateManager } from './modules/ui-state.js'; -import { updateStateButton } from './modules/manager-ui.js'; -import { EventBus } from './modules/event-bus.js'; -import { initMessageHandlers } from './modules/manager/manager.message.handlers.js'; +import frameMessenger from '@cms/modules/frameMessenger.js'; +import { loadPreview } from '@cms/modules/preview.utils.js'; +import { UIStateManager } from '@cms/modules/ui-state.js'; +import { updateStateButton } from '@cms/modules/manager-ui.js'; +import { EventBus } from '@cms/modules/event-bus.js'; +import { initMessageHandlers } from '@cms/modules/manager/manager.message.handlers.js'; frameMessenger.on('load', (payload) => { EventBus.emit("preview:loaded", {}); }); diff --git a/modules/ui-module/src/main/ts/dist/js/modules/alerts.js b/modules/ui-module/src/main/ts/dist/js/modules/alerts.js index 4da68fc03..1bb876133 100644 --- a/modules/ui-module/src/main/ts/dist/js/modules/alerts.js +++ b/modules/ui-module/src/main/ts/dist/js/modules/alerts.js @@ -19,8 +19,8 @@ * . * #L% */ -import { openModal } from './modal.js'; -import { i18n } from './localization.js'; +import { openModal } from '@cms/modules/modal.js'; +import { i18n } from '@cms/modules/localization.js'; const alertSelect = (options) => { return new Promise((resolve) => { const modalBody = ` diff --git a/modules/ui-module/src/main/ts/dist/js/modules/filebrowser.actions.js b/modules/ui-module/src/main/ts/dist/js/modules/filebrowser.actions.js index cd11fc611..1d4fd9b23 100644 --- a/modules/ui-module/src/main/ts/dist/js/modules/filebrowser.actions.js +++ b/modules/ui-module/src/main/ts/dist/js/modules/filebrowser.actions.js @@ -19,12 +19,12 @@ * . * #L% */ -import { createFolder, createFile, renameFile } from './rpc/rpc-files.js'; -import { createPage } from './rpc/rpc-page.js'; -import { i18n } from './localization.js'; -import { alertSelect, alertConfirm, alertPrompt } from './alerts.js'; -import { showToast } from './toast.js'; -import { getPageTemplates } from './rpc/rpc-manager.js'; +import { createFolder, createFile, renameFile } from '@cms/modules/rpc/rpc-files.js'; +import { createPage } from '@cms/modules/rpc/rpc-page.js'; +import { i18n } from '@cms/modules/localization.js'; +import { alertSelect, alertConfirm, alertPrompt } from '@cms/modules/alerts.js'; +import { showToast } from '@cms/modules/toast.js'; +import { getPageTemplates } from '@cms/modules/rpc/rpc-manager.js'; export async function renameFileAction({ state, getTargetFolder, filename }) { const newName = await alertPrompt({ title: i18n.t("filebrowser.rename.title", "Rename file"), diff --git a/modules/ui-module/src/main/ts/dist/js/modules/filebrowser.js b/modules/ui-module/src/main/ts/dist/js/modules/filebrowser.js index f7e37ce77..82789df2a 100644 --- a/modules/ui-module/src/main/ts/dist/js/modules/filebrowser.js +++ b/modules/ui-module/src/main/ts/dist/js/modules/filebrowser.js @@ -19,17 +19,17 @@ * . * #L% */ -import { listFiles, deleteFile, deleteFolder, } from './rpc/rpc-files.js'; -import { deletePage } from './rpc/rpc-page.js'; -import { openModal } from './modal.js'; -import { loadPreview } from './preview.utils.js'; -import { i18n } from './localization.js'; -import { renameFileAction, deleteElementAction, createFolderAction, createFileAction, createPageActionOfContentType } from './filebrowser.actions.js'; -import { initDragAndDropUpload, handleFileUpload } from './filebrowser.upload.js'; -import { EventBus } from './event-bus.js'; -import { filebrowserTemplate } from './filebrowser.template.js'; -import { getPageTemplates } from './rpc/rpc-manager.js'; -import { showToast } from './toast.js'; +import { listFiles, deleteFile, deleteFolder, } from '@cms/modules/rpc/rpc-files.js'; +import { deletePage } from '@cms/modules/rpc/rpc-page.js'; +import { openModal } from '@cms/modules/modal.js'; +import { loadPreview } from '@cms/modules/preview.utils.js'; +import { i18n } from '@cms/modules/localization.js'; +import { renameFileAction, deleteElementAction, createFolderAction, createFileAction, createPageActionOfContentType } from '@cms/modules/filebrowser.actions.js'; +import { initDragAndDropUpload, handleFileUpload } from '@cms/modules/filebrowser.upload.js'; +import { EventBus } from '@cms/modules/event-bus.js'; +import { filebrowserTemplate } from '@cms/modules/filebrowser.template.js'; +import { getPageTemplates } from '@cms/modules/rpc/rpc-manager.js'; +import { showToast } from '@cms/modules/toast.js'; const defaultOptions = { validate: () => true, uri: "", diff --git a/modules/ui-module/src/main/ts/dist/js/modules/filebrowser.template.js b/modules/ui-module/src/main/ts/dist/js/modules/filebrowser.template.js index 53161ef32..33a744356 100644 --- a/modules/ui-module/src/main/ts/dist/js/modules/filebrowser.template.js +++ b/modules/ui-module/src/main/ts/dist/js/modules/filebrowser.template.js @@ -19,7 +19,7 @@ * . * #L% */ -import Handlebars from '../libs/handlebars.min.js'; +import Handlebars from '@cms/libs/handlebars.min.js'; Handlebars.registerHelper("patchPathWithContext", patchPathWithContext); Handlebars.registerHelper('concat', function (...args) { args.pop(); diff --git a/modules/ui-module/src/main/ts/dist/js/modules/filebrowser.upload.js b/modules/ui-module/src/main/ts/dist/js/modules/filebrowser.upload.js index 46441496a..1855df569 100644 --- a/modules/ui-module/src/main/ts/dist/js/modules/filebrowser.upload.js +++ b/modules/ui-module/src/main/ts/dist/js/modules/filebrowser.upload.js @@ -19,11 +19,11 @@ * . * #L% */ -import { showToast } from './toast.js'; -import { i18n } from './localization.js'; -import { state } from './filebrowser.js'; -import { uploadFileWithProgress } from './upload.js'; -import { EventBus } from './event-bus.js'; +import { showToast } from '@cms/modules/toast.js'; +import { i18n } from '@cms/modules/localization.js'; +import { state } from '@cms/modules/filebrowser.js'; +import { uploadFileWithProgress } from '@cms/modules/upload.js'; +import { EventBus } from '@cms/modules/event-bus.js'; const allowedMimeTypes = [ "image/png", "image/jpeg", diff --git a/modules/ui-module/src/main/ts/dist/js/modules/form/field.checkbox.js b/modules/ui-module/src/main/ts/dist/js/modules/form/field.checkbox.js index bc3dc91e4..e6997083d 100644 --- a/modules/ui-module/src/main/ts/dist/js/modules/form/field.checkbox.js +++ b/modules/ui-module/src/main/ts/dist/js/modules/form/field.checkbox.js @@ -1,4 +1,4 @@ -import { createID } from "./utils.js"; +import { createID } from "@cms/modules/form/utils.js"; const createCheckboxField = (options, value = []) => { const id = createID(); const key = options.key || ""; diff --git a/modules/ui-module/src/main/ts/dist/js/modules/form/field.code.js b/modules/ui-module/src/main/ts/dist/js/modules/form/field.code.js index c935dcbf3..cb24d0a0a 100644 --- a/modules/ui-module/src/main/ts/dist/js/modules/form/field.code.js +++ b/modules/ui-module/src/main/ts/dist/js/modules/form/field.code.js @@ -19,8 +19,8 @@ * . * #L% */ -import { createID } from "./utils.js"; -import { i18n } from "../localization.js"; +import { createID } from "@cms/modules/form/utils.js"; +import { i18n } from "@cms/modules/localization.js"; let monacoEditors = []; const createCodeField = (options, value = '') => { const id = createID(); diff --git a/modules/ui-module/src/main/ts/dist/js/modules/form/field.color.js b/modules/ui-module/src/main/ts/dist/js/modules/form/field.color.js index 63a490a3c..bcf10a8e9 100644 --- a/modules/ui-module/src/main/ts/dist/js/modules/form/field.color.js +++ b/modules/ui-module/src/main/ts/dist/js/modules/form/field.color.js @@ -19,8 +19,8 @@ * . * #L% */ -import { createID } from "./utils.js"; -import { i18n } from "../localization.js"; +import { createID } from "@cms/modules/form/utils.js"; +import { i18n } from "@cms/modules/localization.js"; const createColorField = (options, value = '#000000') => { const id = createID(); const key = "field." + options.name; diff --git a/modules/ui-module/src/main/ts/dist/js/modules/form/field.date.js b/modules/ui-module/src/main/ts/dist/js/modules/form/field.date.js index 8e27b1e6e..7a2399099 100644 --- a/modules/ui-module/src/main/ts/dist/js/modules/form/field.date.js +++ b/modules/ui-module/src/main/ts/dist/js/modules/form/field.date.js @@ -19,8 +19,8 @@ * . * #L% */ -import { createID, getUTCDateFromInput, utcToLocalDateInputValue } from "./utils.js"; -import { i18n } from "../localization.js"; +import { createID, getUTCDateFromInput, utcToLocalDateInputValue } from "@cms/modules/form/utils.js"; +import { i18n } from "@cms/modules/localization.js"; const createDateField = (options, value = '') => { const placeholder = options.placeholder || ""; const id = createID(); diff --git a/modules/ui-module/src/main/ts/dist/js/modules/form/field.datetime.js b/modules/ui-module/src/main/ts/dist/js/modules/form/field.datetime.js index e24bd63f6..e47a388d6 100644 --- a/modules/ui-module/src/main/ts/dist/js/modules/form/field.datetime.js +++ b/modules/ui-module/src/main/ts/dist/js/modules/form/field.datetime.js @@ -19,8 +19,8 @@ * . * #L% */ -import { createID, getUTCDateTimeFromInput, utcToLocalDateTimeInputValue } from "./utils.js"; -import { i18n } from "../localization.js"; +import { createID, getUTCDateTimeFromInput, utcToLocalDateTimeInputValue } from "@cms/modules/form/utils.js"; +import { i18n } from "@cms/modules/localization.js"; const createDateTimeField = (options, value = '') => { const placeholder = options.placeholder || ""; const id = createID(); diff --git a/modules/ui-module/src/main/ts/dist/js/modules/form/field.divider.js b/modules/ui-module/src/main/ts/dist/js/modules/form/field.divider.js index 7291d073a..b6c3e3cc0 100644 --- a/modules/ui-module/src/main/ts/dist/js/modules/form/field.divider.js +++ b/modules/ui-module/src/main/ts/dist/js/modules/form/field.divider.js @@ -19,7 +19,7 @@ * . * #L% */ -import { i18n } from "../localization.js"; +import { i18n } from "@cms/modules/localization.js"; const createDivider = (options, value) => { const key = "field." + options.name; const title = i18n.t(key, options.title || ""); diff --git a/modules/ui-module/src/main/ts/dist/js/modules/form/field.easymde.js b/modules/ui-module/src/main/ts/dist/js/modules/form/field.easymde.js index 5e6e83eb6..25709b638 100644 --- a/modules/ui-module/src/main/ts/dist/js/modules/form/field.easymde.js +++ b/modules/ui-module/src/main/ts/dist/js/modules/form/field.easymde.js @@ -19,8 +19,8 @@ * . * #L% */ -import { createID } from "./utils.js"; -import { i18n } from "../localization.js"; +import { createID } from "@cms/modules/form/utils.js"; +import { i18n } from "@cms/modules/localization.js"; let markdownEditors = []; const createMarkdownField = (options, value = '') => { const id = createID(); diff --git a/modules/ui-module/src/main/ts/dist/js/modules/form/field.list.js b/modules/ui-module/src/main/ts/dist/js/modules/form/field.list.js index c3f7eef67..821bbb62b 100644 --- a/modules/ui-module/src/main/ts/dist/js/modules/form/field.list.js +++ b/modules/ui-module/src/main/ts/dist/js/modules/form/field.list.js @@ -19,14 +19,14 @@ * . * #L% */ -import { createID } from "./utils.js"; -import { i18n } from "../localization.js"; -import { createForm } from "./forms.js"; -import { openModal } from "../modal.js"; -import { buildValuesFromFields } from "../node.js"; -import { getListItemTypes, getPageTemplates } from "../rpc/rpc-manager.js"; -import { getContent, getContentNode } from "../rpc/rpc-content.js"; -import { getPreviewUrl } from "../preview.utils.js"; +import { createID } from "@cms/modules/form/utils.js"; +import { i18n } from "@cms/modules/localization.js"; +import { createForm } from "@cms/modules/form/forms.js"; +import { openModal } from "@cms/modules/modal.js"; +import { buildValuesFromFields } from "@cms/modules/node.js"; +import { getListItemTypes, getPageTemplates } from "@cms/modules/rpc/rpc-manager.js"; +import { getContent, getContentNode } from "@cms/modules/rpc/rpc-content.js"; +import { getPreviewUrl } from "@cms/modules/preview.utils.js"; const createListField = (options, value = []) => { const id = createID(); const key = "field." + options.name; diff --git a/modules/ui-module/src/main/ts/dist/js/modules/form/field.mail.js b/modules/ui-module/src/main/ts/dist/js/modules/form/field.mail.js index c7a4a536d..5620504aa 100644 --- a/modules/ui-module/src/main/ts/dist/js/modules/form/field.mail.js +++ b/modules/ui-module/src/main/ts/dist/js/modules/form/field.mail.js @@ -19,8 +19,8 @@ * . * #L% */ -import { createID } from "./utils.js"; -import { i18n } from "../localization.js"; +import { createID } from "@cms/modules/form/utils.js"; +import { i18n } from "@cms/modules/localization.js"; const createEmailField = (options, value = '') => { const placeholder = options.placeholder || ""; const id = createID(); diff --git a/modules/ui-module/src/main/ts/dist/js/modules/form/field.markdown.js b/modules/ui-module/src/main/ts/dist/js/modules/form/field.markdown.js index eb3753c0f..c4a5d58e1 100644 --- a/modules/ui-module/src/main/ts/dist/js/modules/form/field.markdown.js +++ b/modules/ui-module/src/main/ts/dist/js/modules/form/field.markdown.js @@ -19,11 +19,11 @@ * . * #L% */ -import { createID } from "./utils.js"; -import { i18n } from "../localization.js"; -import { getMediaFormats, getTagNames } from "../rpc/rpc-manager.js"; -import { openFileBrowser } from "../filebrowser.js"; -import { alertSelect } from "../alerts.js"; +import { createID } from "@cms/modules/form/utils.js"; +import { i18n } from "@cms/modules/localization.js"; +import { getMediaFormats, getTagNames } from "@cms/modules/rpc/rpc-manager.js"; +import { openFileBrowser } from "@cms/modules/filebrowser.js"; +import { alertSelect } from "@cms/modules/alerts.js"; let cherryEditors = []; const createMarkdownField = (options, value = '') => { const id = createID(); diff --git a/modules/ui-module/src/main/ts/dist/js/modules/form/field.media.js b/modules/ui-module/src/main/ts/dist/js/modules/form/field.media.js index 315ca3980..dba4cd1d9 100644 --- a/modules/ui-module/src/main/ts/dist/js/modules/form/field.media.js +++ b/modules/ui-module/src/main/ts/dist/js/modules/form/field.media.js @@ -19,10 +19,10 @@ * . * #L% */ -import { createID } from "./utils.js"; -import { i18n } from "../localization.js"; -import { uploadFileWithProgress } from "../upload.js"; -import { openFileBrowser } from "../filebrowser.js"; +import { createID } from "@cms/modules/form/utils.js"; +import { i18n } from "@cms/modules/localization.js"; +import { uploadFileWithProgress } from "@cms/modules/upload.js"; +import { openFileBrowser } from "@cms/modules/filebrowser.js"; const createMediaField = (options, value = '') => { const id = createID(); const key = "field." + options.name; diff --git a/modules/ui-module/src/main/ts/dist/js/modules/form/field.number.js b/modules/ui-module/src/main/ts/dist/js/modules/form/field.number.js index bf2d507bb..18534874c 100644 --- a/modules/ui-module/src/main/ts/dist/js/modules/form/field.number.js +++ b/modules/ui-module/src/main/ts/dist/js/modules/form/field.number.js @@ -19,8 +19,8 @@ * . * #L% */ -import { createID } from "./utils.js"; -import { i18n } from "../localization.js"; +import { i18n } from "@cms/modules/localization.js"; +import { createID } from "@cms/modules/form/utils.js"; const createNumberField = (options, value = '') => { const placeholder = options.placeholder || ""; const id = createID(); diff --git a/modules/ui-module/src/main/ts/dist/js/modules/form/field.radio.js b/modules/ui-module/src/main/ts/dist/js/modules/form/field.radio.js index cce7d8510..911faad66 100644 --- a/modules/ui-module/src/main/ts/dist/js/modules/form/field.radio.js +++ b/modules/ui-module/src/main/ts/dist/js/modules/form/field.radio.js @@ -19,8 +19,8 @@ * . * #L% */ -import { createID } from "./utils.js"; -import { i18n } from "../localization.js"; +import { createID } from "@cms/modules/form/utils.js"; +import { i18n } from "@cms/modules/localization.js"; const createRadioField = (options, value = '') => { const id = createID(); const key = "field." + options.name; diff --git a/modules/ui-module/src/main/ts/dist/js/modules/form/field.range.js b/modules/ui-module/src/main/ts/dist/js/modules/form/field.range.js index b62160f12..11310fdd6 100644 --- a/modules/ui-module/src/main/ts/dist/js/modules/form/field.range.js +++ b/modules/ui-module/src/main/ts/dist/js/modules/form/field.range.js @@ -19,8 +19,8 @@ * . * #L% */ -import { createID } from "./utils.js"; -import { i18n } from "../localization.js"; +import { createID } from "@cms/modules/form/utils.js"; +import { i18n } from "@cms/modules/localization.js"; const createRangeField = (options, value = '') => { const id = createID(); const key = "field." + options.name; diff --git a/modules/ui-module/src/main/ts/dist/js/modules/form/field.reference.js b/modules/ui-module/src/main/ts/dist/js/modules/form/field.reference.js index b45ef0eec..7873e3afd 100644 --- a/modules/ui-module/src/main/ts/dist/js/modules/form/field.reference.js +++ b/modules/ui-module/src/main/ts/dist/js/modules/form/field.reference.js @@ -19,9 +19,9 @@ * . * #L% */ -import { createID } from "./utils.js"; -import { i18n } from "../localization.js"; -import { openFileBrowser } from "../filebrowser.js"; +import { createID } from "@cms/modules/form/utils.js"; +import { i18n } from "@cms/modules/localization.js"; +import { openFileBrowser } from "@cms/modules/filebrowser.js"; const createReferenceField = (options, value = '') => { const id = createID(); const key = "field." + options.name; diff --git a/modules/ui-module/src/main/ts/dist/js/modules/form/field.select.js b/modules/ui-module/src/main/ts/dist/js/modules/form/field.select.js index e1ff731f8..8c1d29711 100644 --- a/modules/ui-module/src/main/ts/dist/js/modules/form/field.select.js +++ b/modules/ui-module/src/main/ts/dist/js/modules/form/field.select.js @@ -19,8 +19,8 @@ * . * #L% */ -import { createID } from "./utils.js"; -import { i18n } from "../localization.js"; +import { createID } from "@cms/modules/form/utils.js"; +import { i18n } from "@cms/modules/localization.js"; const createSelectField = (options, value = '') => { const id = createID(); const key = "field." + options.name; diff --git a/modules/ui-module/src/main/ts/dist/js/modules/form/field.text.js b/modules/ui-module/src/main/ts/dist/js/modules/form/field.text.js index 1bf0d0ae8..67095eb95 100644 --- a/modules/ui-module/src/main/ts/dist/js/modules/form/field.text.js +++ b/modules/ui-module/src/main/ts/dist/js/modules/form/field.text.js @@ -19,8 +19,8 @@ * . * #L% */ -import { createID } from "./utils.js"; -import { i18n } from "../localization.js"; +import { createID } from "@cms/modules/form/utils.js"; +import { i18n } from "@cms/modules/localization.js"; const createTextField = (options, value = '') => { const placeholder = options.placeholder || ""; const id = createID(); diff --git a/modules/ui-module/src/main/ts/dist/js/modules/form/field.textarea.js b/modules/ui-module/src/main/ts/dist/js/modules/form/field.textarea.js index faf913aed..49320a8d2 100644 --- a/modules/ui-module/src/main/ts/dist/js/modules/form/field.textarea.js +++ b/modules/ui-module/src/main/ts/dist/js/modules/form/field.textarea.js @@ -19,8 +19,8 @@ * . * #L% */ -import { createID } from "./utils.js"; -import { i18n } from "../localization.js"; +import { createID } from "@cms/modules/form/utils.js"; +import { i18n } from "@cms/modules/localization.js"; const createTextAreaField = (options, value = '') => { const rows = options.rows || 5; const id = createID(); diff --git a/modules/ui-module/src/main/ts/dist/js/modules/form/forms.js b/modules/ui-module/src/main/ts/dist/js/modules/form/forms.js index 9217b20f3..9c0a286ca 100644 --- a/modules/ui-module/src/main/ts/dist/js/modules/form/forms.js +++ b/modules/ui-module/src/main/ts/dist/js/modules/form/forms.js @@ -19,25 +19,25 @@ * . * #L% */ -import { createID } from "./utils.js"; -import { TextField } from "./field.text.js"; -import { MailField } from "./field.mail.js"; -import { CodeField } from "./field.code.js"; -import { SelectField } from "./field.select.js"; -import { MarkdownField } from "./field.markdown.js"; -import { EasyMDEField } from "./field.easymde.js"; -import { NumberField } from "./field.number.js"; -import { DateField } from "./field.date.js"; -import { ColorField } from "./field.color.js"; -import { DateTimeField } from "./field.datetime.js"; -import { RangeField } from "./field.range.js"; -import { RadioField } from "./field.radio.js"; -import { CheckboxField } from "./field.checkbox.js"; -import { Divider } from "./field.divider.js"; -import { MediaField } from "./field.media.js"; -import { ListField } from "./field.list.js"; -import { TextAreaField } from "./field.textarea.js"; -import { ReferenceField } from "./field.reference.js"; +import { createID } from "@cms/modules/form/utils.js"; +import { TextField } from "@cms/modules/form/field.text.js"; +import { MailField } from "@cms/modules/form/field.mail.js"; +import { CodeField } from "@cms/modules/form/field.code.js"; +import { SelectField } from "@cms/modules/form/field.select.js"; +import { MarkdownField } from "@cms/modules/form/field.markdown.js"; +import { EasyMDEField } from "@cms/modules/form/field.easymde.js"; +import { NumberField } from "@cms/modules/form/field.number.js"; +import { DateField } from "@cms/modules/form/field.date.js"; +import { ColorField } from "@cms/modules/form/field.color.js"; +import { DateTimeField } from "@cms/modules/form/field.datetime.js"; +import { RangeField } from "@cms/modules/form/field.range.js"; +import { RadioField } from "@cms/modules/form/field.radio.js"; +import { CheckboxField } from "@cms/modules/form/field.checkbox.js"; +import { Divider } from "@cms/modules/form/field.divider.js"; +import { MediaField } from "@cms/modules/form/field.media.js"; +import { ListField } from "@cms/modules/form/field.list.js"; +import { TextAreaField } from "@cms/modules/form/field.textarea.js"; +import { ReferenceField } from "@cms/modules/form/field.reference.js"; const createForm = (options) => { const fields = options.fields || []; const values = options.values || {}; diff --git a/modules/ui-module/src/main/ts/dist/js/modules/locale-utils.js b/modules/ui-module/src/main/ts/dist/js/modules/locale-utils.js index ffd93267b..968d40287 100644 --- a/modules/ui-module/src/main/ts/dist/js/modules/locale-utils.js +++ b/modules/ui-module/src/main/ts/dist/js/modules/locale-utils.js @@ -19,7 +19,7 @@ * . * #L% */ -import { UIStateManager } from './ui-state.js'; +import { UIStateManager } from '@cms/modules/ui-state.js'; const DEFAULT_LOCALE = 'en'; export function getLocale() { return UIStateManager.getLocale(DEFAULT_LOCALE); diff --git a/modules/ui-module/src/main/ts/dist/js/modules/localization-loader.js b/modules/ui-module/src/main/ts/dist/js/modules/localization-loader.js index c2cafa1d2..a94730f9b 100644 --- a/modules/ui-module/src/main/ts/dist/js/modules/localization-loader.js +++ b/modules/ui-module/src/main/ts/dist/js/modules/localization-loader.js @@ -19,9 +19,9 @@ * . * #L% */ -import { ACTION_LOCALIZATIONS } from './localization-actions.js'; -import { MODULE_LOCALIZATIONS } from './localization-modules.js'; -import { loadLocalizations } from './rpc/rpc-i18n.js'; +import { ACTION_LOCALIZATIONS } from '@cms/modules/localization-actions.js'; +import { MODULE_LOCALIZATIONS } from '@cms/modules/localization-modules.js'; +import { loadLocalizations } from '@cms/modules/rpc/rpc-i18n.js'; const DEFAULT_LOCALIZATIONS = { en: { "ui.filebrowser.filename": "Filename", diff --git a/modules/ui-module/src/main/ts/dist/js/modules/localization.js b/modules/ui-module/src/main/ts/dist/js/modules/localization.js index 18e6454ab..e6247f38f 100644 --- a/modules/ui-module/src/main/ts/dist/js/modules/localization.js +++ b/modules/ui-module/src/main/ts/dist/js/modules/localization.js @@ -19,8 +19,8 @@ * . * #L% */ -import { getLocale, setLocale } from './locale-utils.js'; -import { loadLocalizationsWithDefaults } from './localization-loader.js'; +import { getLocale, setLocale } from '@cms/modules/locale-utils.js'; +import { loadLocalizationsWithDefaults } from '@cms/modules/localization-loader.js'; const DEFAULT_LOCALE = 'en'; const i18n = { _locale: getLocale(), diff --git a/modules/ui-module/src/main/ts/dist/js/modules/manager-ui.js b/modules/ui-module/src/main/ts/dist/js/modules/manager-ui.js index e443f4ee5..b0b8846d3 100644 --- a/modules/ui-module/src/main/ts/dist/js/modules/manager-ui.js +++ b/modules/ui-module/src/main/ts/dist/js/modules/manager-ui.js @@ -19,8 +19,8 @@ * . * #L% */ -import { getContentNode, setMeta, getContent } from './rpc/rpc-content.js'; -import { getPreviewUrl } from './preview.utils.js'; +import { getContentNode, setMeta, getContent } from '@cms/modules/rpc/rpc-content.js'; +import { getPreviewUrl } from '@cms/modules/preview.utils.js'; export function updateStateButton() { var previewUrl = getPreviewUrl(); ; diff --git a/modules/ui-module/src/main/ts/dist/js/modules/manager/manager.message.handlers.js b/modules/ui-module/src/main/ts/dist/js/modules/manager/manager.message.handlers.js index d10e03e5e..ddeeb1e69 100644 --- a/modules/ui-module/src/main/ts/dist/js/modules/manager/manager.message.handlers.js +++ b/modules/ui-module/src/main/ts/dist/js/modules/manager/manager.message.handlers.js @@ -1,6 +1,6 @@ -import frameMessenger from '../frameMessenger'; -import { getPreviewFrame, getPreviewUrl } from '../preview.utils'; -import { getContentNode } from '../rpc/rpc-content'; +import frameMessenger from '@cms/modules/frameMessenger.js'; +import { getPreviewFrame, getPreviewUrl } from '@cms/modules/preview.utils.js'; +import { getContentNode } from '@cms/modules/rpc/rpc-content.js'; const executeImageForm = (payload) => { const cmd = { "module": window.manager.baseUrl + "/actions/media/edit-media-form", diff --git a/modules/ui-module/src/main/ts/dist/js/modules/manager/media.inject.js b/modules/ui-module/src/main/ts/dist/js/modules/manager/media.inject.js index 3b4fc6a1f..84e774a59 100644 --- a/modules/ui-module/src/main/ts/dist/js/modules/manager/media.inject.js +++ b/modules/ui-module/src/main/ts/dist/js/modules/manager/media.inject.js @@ -1,5 +1,5 @@ -import { EDIT_ATTRIBUTES_ICON, IMAGE_ICON, MEDIA_CROP_ICON } from "./toolbar-icons"; -import frameMessenger from '../frameMessenger.js'; +import { EDIT_ATTRIBUTES_ICON, IMAGE_ICON, MEDIA_CROP_ICON } from "@cms/modules/manager/toolbar-icons"; +import frameMessenger from '@cms/modules/frameMessenger.js'; const isSameDomainImage = (imgElement) => { if (!(imgElement instanceof HTMLImageElement)) { return false; // ist kein diff --git a/modules/ui-module/src/main/ts/dist/js/modules/manager/toolbar.inject.js b/modules/ui-module/src/main/ts/dist/js/modules/manager/toolbar.inject.js index 419ee9128..1add24372 100644 --- a/modules/ui-module/src/main/ts/dist/js/modules/manager/toolbar.inject.js +++ b/modules/ui-module/src/main/ts/dist/js/modules/manager/toolbar.inject.js @@ -1,5 +1,5 @@ -import frameMessenger from "../frameMessenger"; -import { EDIT_ATTRIBUTES_ICON, EDIT_PAGE_ICON, SECTION_ADD_ICON, SECTION_DELETE_ICON, SECTION_SORT_ICON, SECTION_UNPUBLISHED_ICON } from "./toolbar-icons"; +import frameMessenger from "@cms/modules/frameMessenger.js"; +import { EDIT_ATTRIBUTES_ICON, EDIT_PAGE_ICON, SECTION_ADD_ICON, SECTION_DELETE_ICON, SECTION_SORT_ICON, SECTION_UNPUBLISHED_ICON } from "@cms/modules/manager/toolbar-icons"; const addSection = (event) => { var toolbar = event.target.closest('[data-cms-toolbar]'); var toolbarDefinition = JSON.parse(toolbar.dataset.cmsToolbar); diff --git a/modules/ui-module/src/main/ts/dist/js/modules/modal.js b/modules/ui-module/src/main/ts/dist/js/modules/modal.js index 80c1c2686..64161c72a 100644 --- a/modules/ui-module/src/main/ts/dist/js/modules/modal.js +++ b/modules/ui-module/src/main/ts/dist/js/modules/modal.js @@ -19,7 +19,7 @@ * . * #L% */ -import { i18n } from "./localization.js"; +import { i18n } from "@cms/modules/localization.js"; const defaultOptions = { validate: () => true }; diff --git a/modules/ui-module/src/main/ts/dist/js/modules/preview.utils.js b/modules/ui-module/src/main/ts/dist/js/modules/preview.utils.js index 4cf2ccb6b..1f288a0e9 100644 --- a/modules/ui-module/src/main/ts/dist/js/modules/preview.utils.js +++ b/modules/ui-module/src/main/ts/dist/js/modules/preview.utils.js @@ -19,7 +19,7 @@ * . * #L% */ -import { EventBus } from "./event-bus.js"; +import { EventBus } from "@cms/modules/event-bus.js"; //PreviewHistory.init(); // close overlay on preview loaded EventBus.on("preview:loaded", (data) => { diff --git a/modules/ui-module/src/main/ts/dist/js/modules/rpc/rpc-content.js b/modules/ui-module/src/main/ts/dist/js/modules/rpc/rpc-content.js index 152618206..0cef6646d 100644 --- a/modules/ui-module/src/main/ts/dist/js/modules/rpc/rpc-content.js +++ b/modules/ui-module/src/main/ts/dist/js/modules/rpc/rpc-content.js @@ -19,7 +19,7 @@ * . * #L% */ -import { executeRemoteCall } from './rpc.js'; +import { executeRemoteCall } from '@cms/modules/rpc/rpc.js'; const getContentNode = async (options) => { var data = { method: "content.node", diff --git a/modules/ui-module/src/main/ts/dist/js/modules/rpc/rpc-files.js b/modules/ui-module/src/main/ts/dist/js/modules/rpc/rpc-files.js index 24b9108d4..df7753934 100644 --- a/modules/ui-module/src/main/ts/dist/js/modules/rpc/rpc-files.js +++ b/modules/ui-module/src/main/ts/dist/js/modules/rpc/rpc-files.js @@ -19,7 +19,7 @@ * . * #L% */ -import { executeRemoteCall } from './rpc.js'; +import { executeRemoteCall } from '@cms/modules/rpc/rpc.js'; const listFiles = async (options) => { var data = { method: "files.list", diff --git a/modules/ui-module/src/main/ts/dist/js/modules/rpc/rpc-i18n.js b/modules/ui-module/src/main/ts/dist/js/modules/rpc/rpc-i18n.js index a0f37abf5..9525d4c7d 100644 --- a/modules/ui-module/src/main/ts/dist/js/modules/rpc/rpc-i18n.js +++ b/modules/ui-module/src/main/ts/dist/js/modules/rpc/rpc-i18n.js @@ -19,7 +19,7 @@ * . * #L% */ -import { executeRemoteCall } from './rpc.js'; +import { executeRemoteCall } from '@cms/modules/rpc/rpc.js'; const loadLocalizations = async (options) => { var data = { method: "i18n.load" diff --git a/modules/ui-module/src/main/ts/dist/js/modules/rpc/rpc-manager.js b/modules/ui-module/src/main/ts/dist/js/modules/rpc/rpc-manager.js index a923c6169..ed5ef8cf1 100644 --- a/modules/ui-module/src/main/ts/dist/js/modules/rpc/rpc-manager.js +++ b/modules/ui-module/src/main/ts/dist/js/modules/rpc/rpc-manager.js @@ -19,7 +19,7 @@ * . * #L% */ -import { executeRemoteCall } from './rpc.js'; +import { executeRemoteCall } from '@cms/modules/rpc/rpc.js'; const getSectionTemplates = async (options) => { var data = { method: "manager.contentTypes.sections", diff --git a/modules/ui-module/src/main/ts/dist/js/modules/rpc/rpc-media.js b/modules/ui-module/src/main/ts/dist/js/modules/rpc/rpc-media.js index a7a6bb83e..576982e45 100644 --- a/modules/ui-module/src/main/ts/dist/js/modules/rpc/rpc-media.js +++ b/modules/ui-module/src/main/ts/dist/js/modules/rpc/rpc-media.js @@ -19,7 +19,7 @@ * . * #L% */ -import { executeRemoteCall } from './rpc.js'; +import { executeRemoteCall } from '@cms/modules/rpc/rpc.js'; const getMediaMetaData = async (options) => { var data = { method: "media.meta.get", diff --git a/modules/ui-module/src/main/ts/dist/js/modules/rpc/rpc-page.js b/modules/ui-module/src/main/ts/dist/js/modules/rpc/rpc-page.js index 071279810..d324b87a5 100644 --- a/modules/ui-module/src/main/ts/dist/js/modules/rpc/rpc-page.js +++ b/modules/ui-module/src/main/ts/dist/js/modules/rpc/rpc-page.js @@ -19,7 +19,7 @@ * . * #L% */ -import { executeRemoteCall } from './rpc.js'; +import { executeRemoteCall } from '@cms/modules/rpc/rpc.js'; const createPage = async (options) => { var data = { method: "page.create", diff --git a/modules/ui-module/src/main/ts/dist/js/modules/rpc/rpc-translation.js b/modules/ui-module/src/main/ts/dist/js/modules/rpc/rpc-translation.js index 1a8b52c24..719b68406 100644 --- a/modules/ui-module/src/main/ts/dist/js/modules/rpc/rpc-translation.js +++ b/modules/ui-module/src/main/ts/dist/js/modules/rpc/rpc-translation.js @@ -19,7 +19,7 @@ * . * #L% */ -import { executeRemoteCall } from './rpc.js'; +import { executeRemoteCall } from '@cms/modules/rpc/rpc.js'; const getTranslations = async (options) => { var data = { method: "translations.get", diff --git a/modules/ui-module/src/main/ts/dist/js/modules/rpc/rpc.js b/modules/ui-module/src/main/ts/dist/js/modules/rpc/rpc.js index 39e3f93bb..6400dca1f 100644 --- a/modules/ui-module/src/main/ts/dist/js/modules/rpc/rpc.js +++ b/modules/ui-module/src/main/ts/dist/js/modules/rpc/rpc.js @@ -19,7 +19,7 @@ * . * #L% */ -import { i18n } from "../localization.js"; +import { i18n } from "@cms/modules/localization.js"; const executeRemoteCall = async (options) => { return executeRemoteMethodCall(options.method, options.parameters); }; diff --git a/modules/ui-module/src/main/ts/dist/js/modules/toast.js b/modules/ui-module/src/main/ts/dist/js/modules/toast.js index 41162220d..421728aea 100644 --- a/modules/ui-module/src/main/ts/dist/js/modules/toast.js +++ b/modules/ui-module/src/main/ts/dist/js/modules/toast.js @@ -19,7 +19,7 @@ * . * #L% */ -import { i18n } from './localization.js'; +import { i18n } from '@cms/modules/localization.js'; const showToast = (options) => { const toastId = 'toast_' + Date.now(); // Fallbacks diff --git a/modules/ui-module/src/main/ts/dist/js/modules/ui-state.js b/modules/ui-module/src/main/ts/dist/js/modules/ui-state.js index a004b4f0c..45c49dd1d 100644 --- a/modules/ui-module/src/main/ts/dist/js/modules/ui-state.js +++ b/modules/ui-module/src/main/ts/dist/js/modules/ui-state.js @@ -20,7 +20,7 @@ * #L% */ // state-manager.js -import { EventBus } from "./event-bus.js"; +import { EventBus } from "@cms/modules/event-bus.js"; const TAB_ID_KEY = "cms-tab-id"; const AUTH_KEY = "cms-auth-token"; export const UIStateManager = { diff --git a/modules/ui-module/src/main/ts/dist/js/ui-actions.js b/modules/ui-module/src/main/ts/dist/js/ui-actions.js index 0727292ed..4e819f324 100644 --- a/modules/ui-module/src/main/ts/dist/js/ui-actions.js +++ b/modules/ui-module/src/main/ts/dist/js/ui-actions.js @@ -19,8 +19,8 @@ * . * #L% */ -import { EventBus } from './modules/event-bus.js'; -import { i18n, localizeUi } from './modules/localization.js'; +import { EventBus } from '@cms/modules/event-bus.js'; +import { i18n, localizeUi } from '@cms/modules/localization.js'; window.addEventListener("DOMContentLoaded", async () => { /* await i18n.init() diff --git a/modules/ui-module/src/main/ts/src/actions/reload-preview.ts b/modules/ui-module/src/main/ts/src/actions/reload-preview.ts index d7b8714aa..57cd3915a 100644 --- a/modules/ui-module/src/main/ts/src/actions/reload-preview.ts +++ b/modules/ui-module/src/main/ts/src/actions/reload-preview.ts @@ -20,9 +20,7 @@ * #L% */ -import { reloadPreview } from "../js/modules/preview.utils"; - - +import { reloadPreview } from "@cms/modules/preview.utils.js"; export async function runAction(params) { reloadPreview(); diff --git a/modules/ui-module/src/main/ts/src/js/manager-inject-init.js b/modules/ui-module/src/main/ts/src/js/manager-inject-init.js new file mode 100644 index 000000000..1733edd86 --- /dev/null +++ b/modules/ui-module/src/main/ts/src/js/manager-inject-init.js @@ -0,0 +1,148 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ + +import frameMessenger from '@cms/modules/frameMessenger.js'; + +import { initContentMediaToolbar, initMediaToolbar, initMediaUploadOverlay } from '@cms/modules/manager/media.inject.js'; +import { EDIT_ATTRIBUTES_ICON, EDIT_PAGE_ICON, SECTION_ADD_ICON, SECTION_DELETE_ICON, SECTION_PUBLISHED_ICON, SECTION_SORT_ICON, SECTION_UNPUBLISHED_ICON } from '@cms/modules/manager/toolbar-icons'; +import { initToolbar } from '@cms/modules/manager/toolbar.inject.js'; + +const isIframe = () => { + return typeof window !== 'undefined' && window.self !== window.top; +} + +export function initIframe() { + + if (!isIframe()) { + return; + } + + frameMessenger.send(window.parent, { + type: 'loaded', + payload: {} + }); + + const toolbarContainers = document.querySelectorAll('[data-cms-toolbar]'); + toolbarContainers.forEach(initToolbar); + + const mediaToolbarContainers = document.querySelectorAll('img[data-cms-media-toolbar]'); + mediaToolbarContainers.forEach(initMediaToolbar); + + const contentMediaContainers = document.querySelectorAll('img[data-cms-ui-selector=content-image]'); + contentMediaContainers.forEach(initContentMediaToolbar); + + //const mediaUploadContainers = document.querySelectorAll('img[data-cms-media-actions~=upload]'); + //mediaUploadContainers.forEach(initMediaUploadOverlay); + + document.addEventListener('keydown', (event) => { + if (event.key.toLowerCase() === 'k' && (event.metaKey || event.ctrlKey)) { + event.preventDefault(); + + frameMessenger.send(window.parent, { + type: 'shortkeys', + payload: {} + }); + } + }) + + frameMessenger.on('getContentNodeResponse', async (payload) => { + for (const [sectionName, items] of Object.entries(payload.contentNode.sections)) { + + for (const item of items) { + const sectionContainer = document.querySelector(`[data-cms-section-uri="${item.uri}"]`); + if (!sectionContainer) { + continue; + } + if (item.data.published) { + sectionContainer.setAttribute('data-cms-action', 'unpublish'); + sectionContainer.setAttribute("title", "Unpublish"); + if (isSectionPublishedExpired(item)) { + + sectionContainer.innerHTML = SECTION_UNPUBLISHED_ICON; + + sectionContainer.classList.remove('cms-unpublished'); + sectionContainer.classList.remove('cms-published'); + sectionContainer.classList.add('cms-published-expired'); + } else { + + sectionContainer.innerHTML = SECTION_PUBLISHED_ICON; + + sectionContainer.classList.remove('cms-unpublished'); + sectionContainer.classList.remove('cms-published-expired'); + sectionContainer.classList.add('cms-published'); + } + } else { + sectionContainer.innerHTML = SECTION_UNPUBLISHED_ICON; + sectionContainer.setAttribute('data-cms-action', 'publish'); + sectionContainer.setAttribute("title", "Publish"); + sectionContainer.classList.remove('cms-published'); + sectionContainer.classList.remove('cms-published-expired'); + sectionContainer.classList.add('cms-unpublished'); + } + } + } + }); + + frameMessenger.send(window.parent, { + type: 'getContentNode', + payload: {} + }); + + document.addEventListener('click', function (event) { + if (event.target.matches('[data-cms-action]')) { + const button = event.target; + + // Wenn bereits disabled, nichts tun + if (button.disabled) { + event.preventDefault(); + return; + } + + // Button deaktivieren + button.disabled = true; + + // Nach 2 Sekunden wieder aktivieren + setTimeout(() => { + button.disabled = false; + }, 2000); + } + }); +}; + +export function isSectionPublishedExpired(section) { + const publishDateStr = section.data.publish_date; + const unpublishDateStr = section.data.unpublish_date; + + const now = new Date(); + + const publishDate = publishDateStr ? new Date(publishDateStr) : null; + const unpublishDate = unpublishDateStr ? new Date(unpublishDateStr) : null; + + // section is published if: + // - publishDate empty or in the past + // - und unpublishDate empty or in the future + const isPublished = + (!publishDate || publishDate <= now) && + (!unpublishDate || unpublishDate > now); + + return !isPublished; +} \ No newline at end of file diff --git a/modules/ui-module/src/main/ts/src/js/manager-inject.js b/modules/ui-module/src/main/ts/src/js/manager-inject.js index f1aea7aaa..6ec4b58c1 100644 --- a/modules/ui-module/src/main/ts/src/js/manager-inject.js +++ b/modules/ui-module/src/main/ts/src/js/manager-inject.js @@ -20,129 +20,37 @@ * #L% */ -import frameMessenger from './modules/frameMessenger.js'; - -import { initContentMediaToolbar, initMediaToolbar, initMediaUploadOverlay } from './modules/manager/media.inject.js'; -import { EDIT_ATTRIBUTES_ICON, EDIT_PAGE_ICON, SECTION_ADD_ICON, SECTION_DELETE_ICON, SECTION_PUBLISHED_ICON, SECTION_SORT_ICON, SECTION_UNPUBLISHED_ICON } from './modules/manager/toolbar-icons'; -import { initToolbar } from './modules/manager/toolbar.inject.js'; - -const isIframe = () => { - return typeof window !== 'undefined' && window.self !== window.top; -} - -document.addEventListener("DOMContentLoaded", function () { - - if (!isIframe()) { - return; - } - - frameMessenger.send(window.parent, { - type: 'loaded', - payload: {} - }); - - const toolbarContainers = document.querySelectorAll('[data-cms-toolbar]'); - toolbarContainers.forEach(initToolbar); - - const mediaToolbarContainers = document.querySelectorAll('img[data-cms-media-toolbar]'); - mediaToolbarContainers.forEach(initMediaToolbar); - - const contentMediaContainers = document.querySelectorAll('img[data-cms-ui-selector=content-image]'); - contentMediaContainers.forEach(initContentMediaToolbar); - - //const mediaUploadContainers = document.querySelectorAll('img[data-cms-media-actions~=upload]'); - //mediaUploadContainers.forEach(initMediaUploadOverlay); - - document.addEventListener('keydown', (event) => { - if (event.key.toLowerCase() === 'k' && (event.metaKey || event.ctrlKey)) { - event.preventDefault(); - - frameMessenger.send(window.parent, { - type: 'shortkeys', - payload: {} - }); - } - }) - - frameMessenger.on('getContentNodeResponse', async (payload) => { - for (const [sectionName, items] of Object.entries(payload.contentNode.sections)) { - - for (const item of items) { - const sectionContainer = document.querySelector(`[data-cms-section-uri="${item.uri}"]`); - if (!sectionContainer) { - continue; - } - if (item.data.published) { - sectionContainer.setAttribute('data-cms-action', 'unpublish'); - sectionContainer.setAttribute("title", "Unpublish"); - if (isSectionPublishedExpired(item)) { - - sectionContainer.innerHTML = SECTION_UNPUBLISHED_ICON; - - sectionContainer.classList.remove('cms-unpublished'); - sectionContainer.classList.remove('cms-published'); - sectionContainer.classList.add('cms-published-expired'); - } else { - - sectionContainer.innerHTML = SECTION_PUBLISHED_ICON; - - sectionContainer.classList.remove('cms-unpublished'); - sectionContainer.classList.remove('cms-published-expired'); - sectionContainer.classList.add('cms-published'); - } - } else { - sectionContainer.innerHTML = SECTION_UNPUBLISHED_ICON; - sectionContainer.setAttribute('data-cms-action', 'publish'); - sectionContainer.setAttribute("title", "Publish"); - sectionContainer.classList.remove('cms-published'); - sectionContainer.classList.remove('cms-published-expired'); - sectionContainer.classList.add('cms-unpublished'); - } - } - } - }); - - frameMessenger.send(window.parent, { - type: 'getContentNode', - payload: {} - }); - - document.addEventListener('click', function (event) { - if (event.target.matches('[data-cms-action]')) { - const button = event.target; - - // Wenn bereits disabled, nichts tun - if (button.disabled) { - event.preventDefault(); - return; - } - - // Button deaktivieren - button.disabled = true; - - // Nach 2 Sekunden wieder aktivieren - setTimeout(() => { - button.disabled = false; - }, 2000); - } - }); -}); - -export function isSectionPublishedExpired(section) { - const publishDateStr = section.data.publish_date; - const unpublishDateStr = section.data.unpublish_date; - - const now = new Date(); - - const publishDate = publishDateStr ? new Date(publishDateStr) : null; - const unpublishDate = unpublishDateStr ? new Date(unpublishDateStr) : null; - - // section is published if: - // - publishDate empty or in the past - // - und unpublishDate empty or in the future - const isPublished = - (!publishDate || publishDate <= now) && - (!unpublishDate || unpublishDate > now); - - return !isPublished; -} \ No newline at end of file +(async function() { + // Basis-URLs aus Parent ableiten + const parentManager = window.parent?.manager || {}; + const baseUrl = parentManager.baseUrl || '/manager'; + const contextPath = parentManager.contextPath || '/'; + + const importMap = { + imports: { + "@cms/js/": `${baseUrl}/js/`, + "@cms/libs/": `${baseUrl}/js/libs/`, + "@cms/manager/": `${baseUrl}/js/manager/`, + "@cms/modules/": `${baseUrl}/js/modules/` + } + }; + + // 2. Import Map setzen + const script = document.createElement('script'); + script.type = 'importmap'; + script.textContent = JSON.stringify(importMap); + script.onload = () => { + console.log('✅ Import Map ready!'); // Debug + resolve(); + }; + document.head.appendChild(script); + + // 3. window.manager kopieren + window.manager = parentManager; + + // 4. Plugins laden + console.log('🔥 Loading manager-inject-init...'); + const { initIframe } = await import('@cms/js/manager-inject-init.js'); + console.log('✅ initModule loaded!', initIframe); + initIframe() +})(); \ No newline at end of file diff --git a/modules/ui-module/src/main/ts/src/js/manager.js b/modules/ui-module/src/main/ts/src/js/manager.js index c1f2f7f1d..50339c8d4 100644 --- a/modules/ui-module/src/main/ts/src/js/manager.js +++ b/modules/ui-module/src/main/ts/src/js/manager.js @@ -20,14 +20,14 @@ * #L% */ -import frameMessenger from './modules/frameMessenger.js'; -import { loadPreview } from './modules/preview.utils.js'; +import frameMessenger from '@cms/modules/frameMessenger.js'; +import { loadPreview } from '@cms/modules/preview.utils.js'; -import { UIStateManager } from './modules/ui-state.js'; +import { UIStateManager } from '@cms/modules/ui-state.js'; -import { updateStateButton } from './modules/manager-ui.js'; -import { EventBus } from './modules/event-bus.js'; -import { initMessageHandlers } from './modules/manager/manager.message.handlers.js'; +import { updateStateButton } from '@cms/modules/manager-ui.js'; +import { EventBus } from '@cms/modules/event-bus.js'; +import { initMessageHandlers } from '@cms/modules/manager/manager.message.handlers.js'; frameMessenger.on('load', (payload) => { EventBus.emit("preview:loaded", {}); diff --git a/modules/ui-module/src/main/ts/src/js/modules/alerts.js b/modules/ui-module/src/main/ts/src/js/modules/alerts.js index 9ee3f5b3b..ddc39d6f4 100644 --- a/modules/ui-module/src/main/ts/src/js/modules/alerts.js +++ b/modules/ui-module/src/main/ts/src/js/modules/alerts.js @@ -19,8 +19,8 @@ * . * #L% */ -import { openModal } from './modal.js'; -import { i18n } from './localization.js'; +import { openModal } from '@cms/modules/modal.js'; +import { i18n } from '@cms/modules/localization.js'; const alertSelect = (options) => { return new Promise((resolve) => { diff --git a/modules/ui-module/src/main/ts/src/js/modules/filebrowser.actions.js b/modules/ui-module/src/main/ts/src/js/modules/filebrowser.actions.js index b59343026..e9b0ca45f 100644 --- a/modules/ui-module/src/main/ts/src/js/modules/filebrowser.actions.js +++ b/modules/ui-module/src/main/ts/src/js/modules/filebrowser.actions.js @@ -20,13 +20,13 @@ * #L% */ -import { createFolder, createFile, renameFile } from './rpc/rpc-files.js' -import { createPage } from './rpc/rpc-page.js' +import { createFolder, createFile, renameFile } from '@cms/modules/rpc/rpc-files.js' +import { createPage } from '@cms/modules/rpc/rpc-page.js' -import { i18n } from './localization.js'; -import { alertSelect, alertConfirm, alertPrompt } from './alerts.js' -import { showToast } from './toast.js' -import { getPageTemplates } from './rpc/rpc-manager.js'; +import { i18n } from '@cms/modules/localization.js'; +import { alertSelect, alertConfirm, alertPrompt } from '@cms/modules/alerts.js' +import { showToast } from '@cms/modules/toast.js' +import { getPageTemplates } from '@cms/modules/rpc/rpc-manager.js'; export async function renameFileAction({ state, getTargetFolder, filename }) { const newName = await alertPrompt({ diff --git a/modules/ui-module/src/main/ts/src/js/modules/filebrowser.js b/modules/ui-module/src/main/ts/src/js/modules/filebrowser.js index 32e0352c3..b5160f5e6 100644 --- a/modules/ui-module/src/main/ts/src/js/modules/filebrowser.js +++ b/modules/ui-module/src/main/ts/src/js/modules/filebrowser.js @@ -20,18 +20,18 @@ * #L% */ -import { listFiles, deleteFile, deleteFolder, } from './rpc/rpc-files.js' -import { deletePage } from './rpc/rpc-page.js' -import { openModal } from './modal.js' -import { loadPreview } from './preview.utils.js' -import { i18n } from './localization.js'; +import { listFiles, deleteFile, deleteFolder, } from '@cms/modules/rpc/rpc-files.js' +import { deletePage } from '@cms/modules/rpc/rpc-page.js' +import { openModal } from '@cms/modules/modal.js' +import { loadPreview } from '@cms/modules/preview.utils.js' +import { i18n } from '@cms/modules/localization.js'; -import { renameFileAction, deleteElementAction, createFolderAction, createFileAction, createPageActionOfContentType } from './filebrowser.actions.js' -import { initDragAndDropUpload, handleFileUpload } from './filebrowser.upload.js'; -import { EventBus } from './event-bus.js'; -import { filebrowserTemplate } from './filebrowser.template.js'; -import { getPageTemplates } from './rpc/rpc-manager.js'; -import { showToast } from './toast.js'; +import { renameFileAction, deleteElementAction, createFolderAction, createFileAction, createPageActionOfContentType } from '@cms/modules/filebrowser.actions.js' +import { initDragAndDropUpload, handleFileUpload } from '@cms/modules/filebrowser.upload.js'; +import { EventBus } from '@cms/modules/event-bus.js'; +import { filebrowserTemplate } from '@cms/modules/filebrowser.template.js'; +import { getPageTemplates } from '@cms/modules/rpc/rpc-manager.js'; +import { showToast } from '@cms/modules/toast.js'; const defaultOptions = { validate: () => true, diff --git a/modules/ui-module/src/main/ts/src/js/modules/filebrowser.template.js b/modules/ui-module/src/main/ts/src/js/modules/filebrowser.template.js index 746a64639..1c274cefb 100644 --- a/modules/ui-module/src/main/ts/src/js/modules/filebrowser.template.js +++ b/modules/ui-module/src/main/ts/src/js/modules/filebrowser.template.js @@ -20,7 +20,7 @@ * #L% */ -import Handlebars from '../libs/handlebars.min.js'; +import Handlebars from '@cms/libs/handlebars.min.js'; Handlebars.registerHelper("patchPathWithContext", patchPathWithContext); Handlebars.registerHelper('concat', function (...args) { diff --git a/modules/ui-module/src/main/ts/src/js/modules/filebrowser.upload.js b/modules/ui-module/src/main/ts/src/js/modules/filebrowser.upload.js index b2d5e80ec..654e62d76 100644 --- a/modules/ui-module/src/main/ts/src/js/modules/filebrowser.upload.js +++ b/modules/ui-module/src/main/ts/src/js/modules/filebrowser.upload.js @@ -20,11 +20,11 @@ * #L% */ -import { showToast } from './toast.js' -import { i18n } from './localization.js'; -import { state } from './filebrowser.js'; -import { uploadFileWithProgress} from './upload.js' -import { EventBus } from './event-bus.js'; +import { showToast } from '@cms/modules/toast.js' +import { i18n } from '@cms/modules/localization.js'; +import { state } from '@cms/modules/filebrowser.js'; +import { uploadFileWithProgress} from '@cms/modules/upload.js' +import { EventBus } from '@cms/modules/event-bus.js'; const allowedMimeTypes = [ "image/png", diff --git a/modules/ui-module/src/main/ts/src/js/modules/form/field.checkbox.ts b/modules/ui-module/src/main/ts/src/js/modules/form/field.checkbox.ts index 0341563df..facdad77e 100644 --- a/modules/ui-module/src/main/ts/src/js/modules/form/field.checkbox.ts +++ b/modules/ui-module/src/main/ts/src/js/modules/form/field.checkbox.ts @@ -19,8 +19,8 @@ * . * #L% */ -import { FieldOptions, FormContext, FormField } from "./forms.js"; -import { createID } from "./utils.js"; +import { FieldOptions, FormContext, FormField } from "@cms/modules/form/forms.js"; +import { createID } from "@cms/modules/form/utils.js"; export interface CheckboxOptions extends FieldOptions{ key?: string; diff --git a/modules/ui-module/src/main/ts/src/js/modules/form/field.code.js b/modules/ui-module/src/main/ts/src/js/modules/form/field.code.js index 25cdf69e8..b4670aae0 100644 --- a/modules/ui-module/src/main/ts/src/js/modules/form/field.code.js +++ b/modules/ui-module/src/main/ts/src/js/modules/form/field.code.js @@ -19,9 +19,9 @@ * . * #L% */ -import { createID } from "./utils.js"; +import { createID } from "@cms/modules/form/utils.js"; -import { i18n } from "../localization.js" +import { i18n } from "@cms/modules/localization.js" let monacoEditors = []; diff --git a/modules/ui-module/src/main/ts/src/js/modules/form/field.color.ts b/modules/ui-module/src/main/ts/src/js/modules/form/field.color.ts index 4ce48ad50..6d62706ae 100644 --- a/modules/ui-module/src/main/ts/src/js/modules/form/field.color.ts +++ b/modules/ui-module/src/main/ts/src/js/modules/form/field.color.ts @@ -19,9 +19,9 @@ * . * #L% */ -import { createID } from "./utils.js"; -import { i18n } from "../localization.js" -import { FieldOptions, FormContext, FormField } from "./forms.js"; +import { createID } from "@cms/modules/form/utils.js"; +import { i18n } from "@cms/modules/localization.js" +import { FieldOptions, FormContext, FormField } from "@cms/modules/form/forms.js"; export interface ColorFieldOptions extends FieldOptions { } diff --git a/modules/ui-module/src/main/ts/src/js/modules/form/field.date.ts b/modules/ui-module/src/main/ts/src/js/modules/form/field.date.ts index e34d73a1a..3a45bff2b 100644 --- a/modules/ui-module/src/main/ts/src/js/modules/form/field.date.ts +++ b/modules/ui-module/src/main/ts/src/js/modules/form/field.date.ts @@ -19,9 +19,9 @@ * . * #L% */ -import { createID, getUTCDateFromInput, utcToLocalDateInputValue } from "./utils.js"; -import { i18n } from "../localization.js" -import { FieldOptions, FormContext, FormField } from "./forms.js"; +import { createID, getUTCDateFromInput, utcToLocalDateInputValue } from "@cms/modules/form/utils.js"; +import { i18n } from "@cms/modules/localization.js" +import { FieldOptions, FormContext, FormField } from "@cms/modules/form/forms.js"; export interface DateFieldOptions extends FieldOptions { placeholder?: string; diff --git a/modules/ui-module/src/main/ts/src/js/modules/form/field.datetime.ts b/modules/ui-module/src/main/ts/src/js/modules/form/field.datetime.ts index 2981f1913..b04103daf 100644 --- a/modules/ui-module/src/main/ts/src/js/modules/form/field.datetime.ts +++ b/modules/ui-module/src/main/ts/src/js/modules/form/field.datetime.ts @@ -19,9 +19,9 @@ * . * #L% */ -import { createID, getUTCDateTimeFromInput, utcToLocalDateTimeInputValue } from "./utils.js"; -import { i18n } from "../localization.js" -import { FieldOptions, FormContext, FormField } from "./forms.js"; +import { createID, getUTCDateTimeFromInput, utcToLocalDateTimeInputValue } from "@cms/modules/form/utils.js"; +import { i18n } from "@cms/modules/localization.js" +import { FieldOptions, FormContext, FormField } from "@cms/modules/form/forms.js"; export interface DateTimeFieldOptions extends FieldOptions { placeholder?: string; diff --git a/modules/ui-module/src/main/ts/src/js/modules/form/field.divider.ts b/modules/ui-module/src/main/ts/src/js/modules/form/field.divider.ts index b4a8f76c4..33f2c5d41 100644 --- a/modules/ui-module/src/main/ts/src/js/modules/form/field.divider.ts +++ b/modules/ui-module/src/main/ts/src/js/modules/form/field.divider.ts @@ -20,8 +20,8 @@ * #L% */ -import { i18n } from "../localization.js"; -import { FieldOptions, FormContext, FormField } from "./forms.js"; +import { i18n } from "@cms/modules/localization.js"; +import { FieldOptions, FormContext, FormField } from "@cms/modules/form/forms.js"; export interface DividerOptions extends FieldOptions { } diff --git a/modules/ui-module/src/main/ts/src/js/modules/form/field.easymde.ts b/modules/ui-module/src/main/ts/src/js/modules/form/field.easymde.ts index 93c2c2c2d..9e568f0d5 100644 --- a/modules/ui-module/src/main/ts/src/js/modules/form/field.easymde.ts +++ b/modules/ui-module/src/main/ts/src/js/modules/form/field.easymde.ts @@ -19,9 +19,9 @@ * . * #L% */ -import { createID } from "./utils.js"; -import { i18n } from "../localization.js" -import { FieldOptions, FormContext, FormField } from "./forms.js"; +import { createID } from "@cms/modules/form/utils.js"; +import { i18n } from "@cms/modules/localization.js" +import { FieldOptions, FormContext, FormField } from "@cms/modules/form/forms.js"; let markdownEditors = []; diff --git a/modules/ui-module/src/main/ts/src/js/modules/form/field.list.ts b/modules/ui-module/src/main/ts/src/js/modules/form/field.list.ts index ca1ddd24a..5f1fef524 100644 --- a/modules/ui-module/src/main/ts/src/js/modules/form/field.list.ts +++ b/modules/ui-module/src/main/ts/src/js/modules/form/field.list.ts @@ -19,14 +19,14 @@ * . * #L% */ -import { createID } from "./utils.js"; -import { i18n } from "../localization.js" -import { createForm, FieldOptions, FormContext, FormField } from "./forms.js"; -import { openModal } from "../modal.js"; -import { buildValuesFromFields } from "../node.js"; -import { getListItemTypes, getPageTemplates } from "../rpc/rpc-manager.js"; -import { getContent, getContentNode } from "../rpc/rpc-content.js"; -import { getPreviewUrl } from "../preview.utils.js"; +import { createID } from "@cms/modules/form/utils.js"; +import { i18n } from "@cms/modules/localization.js" +import { createForm, FieldOptions, FormContext, FormField } from "@cms/modules/form/forms.js"; +import { openModal } from "@cms/modules/modal.js"; +import { buildValuesFromFields } from "@cms/modules/node.js"; +import { getListItemTypes, getPageTemplates } from "@cms/modules/rpc/rpc-manager.js"; +import { getContent, getContentNode } from "@cms/modules/rpc/rpc-content.js"; +import { getPreviewUrl } from "@cms/modules/preview.utils.js"; export interface ListFieldOptions extends FieldOptions { options: { diff --git a/modules/ui-module/src/main/ts/src/js/modules/form/field.mail.ts b/modules/ui-module/src/main/ts/src/js/modules/form/field.mail.ts index 20816ad4d..97a8d42e0 100644 --- a/modules/ui-module/src/main/ts/src/js/modules/form/field.mail.ts +++ b/modules/ui-module/src/main/ts/src/js/modules/form/field.mail.ts @@ -19,9 +19,9 @@ * . * #L% */ -import { createID } from "./utils.js"; -import { i18n } from "../localization.js" -import { FieldOptions, FormContext, FormField } from "./forms.js"; +import { createID } from "@cms/modules/form/utils.js"; +import { i18n } from "@cms/modules/localization.js" +import { FieldOptions, FormContext, FormField } from "@cms/modules/form/forms.js"; export interface MailFieldOptions extends FieldOptions { placeholder?: string; diff --git a/modules/ui-module/src/main/ts/src/js/modules/form/field.markdown.ts b/modules/ui-module/src/main/ts/src/js/modules/form/field.markdown.ts index 0c068d0b6..06a23bc98 100644 --- a/modules/ui-module/src/main/ts/src/js/modules/form/field.markdown.ts +++ b/modules/ui-module/src/main/ts/src/js/modules/form/field.markdown.ts @@ -19,12 +19,12 @@ * . * #L% */ -import { createID } from "./utils.js"; -import { i18n } from "../localization.js" -import { getMediaFormats, getTagNames } from "../rpc/rpc-manager.js"; -import { openFileBrowser } from "../filebrowser.js"; -import { alertSelect } from "../alerts.js"; -import { FieldOptions, FormContext, FormField } from "./forms.js"; +import { createID } from "@cms/modules/form/utils.js"; +import { i18n } from "@cms/modules/localization.js" +import { getMediaFormats, getTagNames } from "@cms/modules/rpc/rpc-manager.js"; +import { openFileBrowser } from "@cms/modules/filebrowser.js"; +import { alertSelect } from "@cms/modules/alerts.js"; +import { FieldOptions, FormContext, FormField } from "@cms/modules/form/forms.js"; let cherryEditors = []; diff --git a/modules/ui-module/src/main/ts/src/js/modules/form/field.media.ts b/modules/ui-module/src/main/ts/src/js/modules/form/field.media.ts index cdaffe1da..fb6fef49e 100644 --- a/modules/ui-module/src/main/ts/src/js/modules/form/field.media.ts +++ b/modules/ui-module/src/main/ts/src/js/modules/form/field.media.ts @@ -19,11 +19,11 @@ * . * #L% */ -import { createID } from "./utils.js"; -import { i18n } from "../localization.js" -import { uploadFileWithProgress } from "../upload.js"; -import { openFileBrowser } from "../filebrowser.js"; -import { FieldOptions, FormContext, FormField } from "./forms.js"; +import { createID } from "@cms/modules/form/utils.js"; +import { i18n } from "@cms/modules/localization.js" +import { uploadFileWithProgress } from "@cms/modules/upload.js"; +import { openFileBrowser } from "@cms/modules/filebrowser.js"; +import { FieldOptions, FormContext, FormField } from "@cms/modules/form/forms.js"; export interface MediaFieldOptions extends FieldOptions { } diff --git a/modules/ui-module/src/main/ts/src/js/modules/form/field.number.ts b/modules/ui-module/src/main/ts/src/js/modules/form/field.number.ts index 0eb393f51..c495bbbb7 100644 --- a/modules/ui-module/src/main/ts/src/js/modules/form/field.number.ts +++ b/modules/ui-module/src/main/ts/src/js/modules/form/field.number.ts @@ -19,9 +19,9 @@ * . * #L% */ -import { createID } from "./utils.js"; -import { i18n } from "../localization.js" -import { FieldOptions, FormContext, FormField } from "./forms.js"; +import { i18n } from "@cms/modules/localization.js" +import { createID } from "@cms/modules/form/utils.js"; +import { FieldOptions, FormContext, FormField } from "@cms/modules/form/forms.js"; export interface NumberFieldOptions extends FieldOptions{ options: { diff --git a/modules/ui-module/src/main/ts/src/js/modules/form/field.radio.ts b/modules/ui-module/src/main/ts/src/js/modules/form/field.radio.ts index 65a84dfc5..c8d702767 100644 --- a/modules/ui-module/src/main/ts/src/js/modules/form/field.radio.ts +++ b/modules/ui-module/src/main/ts/src/js/modules/form/field.radio.ts @@ -19,9 +19,9 @@ * . * #L% */ -import { createID } from "./utils.js"; -import { i18n } from "../localization.js" -import { FieldOptions, FormContext, FormField } from "./forms.js"; +import { createID } from "@cms/modules/form/utils.js"; +import { i18n } from "@cms/modules/localization.js" +import { FieldOptions, FormContext, FormField } from "@cms/modules/form/forms.js"; export interface RadioFieldOptions extends FieldOptions{ options?: { diff --git a/modules/ui-module/src/main/ts/src/js/modules/form/field.range.ts b/modules/ui-module/src/main/ts/src/js/modules/form/field.range.ts index 61a22d0d4..4a77c7a13 100644 --- a/modules/ui-module/src/main/ts/src/js/modules/form/field.range.ts +++ b/modules/ui-module/src/main/ts/src/js/modules/form/field.range.ts @@ -19,9 +19,9 @@ * . * #L% */ -import { createID } from "./utils.js"; -import { i18n } from "../localization.js" -import { FieldOptions, FormContext, FormField } from "./forms.js"; +import { createID } from "@cms/modules/form/utils.js"; +import { i18n } from "@cms/modules/localization.js" +import { FieldOptions, FormContext, FormField } from "@cms/modules/form/forms.js"; export interface RangeFieldOptions extends FieldOptions { options?: { diff --git a/modules/ui-module/src/main/ts/src/js/modules/form/field.reference.ts b/modules/ui-module/src/main/ts/src/js/modules/form/field.reference.ts index cb4efdd83..0f3d41076 100644 --- a/modules/ui-module/src/main/ts/src/js/modules/form/field.reference.ts +++ b/modules/ui-module/src/main/ts/src/js/modules/form/field.reference.ts @@ -19,10 +19,10 @@ * . * #L% */ -import { createID } from "./utils.js"; -import { i18n } from "../localization.js" -import { openFileBrowser } from "../filebrowser.js"; -import { FieldOptions, FormContext, FormField } from "./forms.js"; +import { createID } from "@cms/modules/form/utils.js"; +import { i18n } from "@cms/modules/localization.js" +import { openFileBrowser } from "@cms/modules/filebrowser.js"; +import { FieldOptions, FormContext, FormField } from "@cms/modules/form/forms.js"; export interface ReferenceFieldOptions extends FieldOptions { options?: { diff --git a/modules/ui-module/src/main/ts/src/js/modules/form/field.select.ts b/modules/ui-module/src/main/ts/src/js/modules/form/field.select.ts index a7f651eac..b7fb10d5b 100644 --- a/modules/ui-module/src/main/ts/src/js/modules/form/field.select.ts +++ b/modules/ui-module/src/main/ts/src/js/modules/form/field.select.ts @@ -19,9 +19,9 @@ * . * #L% */ -import { createID } from "./utils.js"; -import { i18n } from "../localization.js" -import { FieldOptions, FormContext, FormField } from "./forms.js"; +import { createID } from "@cms/modules/form/utils.js"; +import { i18n } from "@cms/modules/localization.js" +import { FieldOptions, FormContext, FormField } from "@cms/modules/form/forms.js"; export interface SelectFieldOptions extends FieldOptions { options?: { diff --git a/modules/ui-module/src/main/ts/src/js/modules/form/field.text.ts b/modules/ui-module/src/main/ts/src/js/modules/form/field.text.ts index 66f36af7e..d4bee0266 100644 --- a/modules/ui-module/src/main/ts/src/js/modules/form/field.text.ts +++ b/modules/ui-module/src/main/ts/src/js/modules/form/field.text.ts @@ -19,9 +19,9 @@ * . * #L% */ -import { createID } from "./utils.js"; -import { i18n } from "../localization.js" -import { FieldOptions, Form, FormContext, FormField } from "./forms.js"; +import { createID } from "@cms/modules/form/utils.js"; +import { i18n } from "@cms/modules/localization.js" +import { FieldOptions, Form, FormContext, FormField } from "@cms/modules/form/forms.js"; export interface TextFieldOptions extends FieldOptions { placeholder?: string; diff --git a/modules/ui-module/src/main/ts/src/js/modules/form/field.textarea.ts b/modules/ui-module/src/main/ts/src/js/modules/form/field.textarea.ts index 33ccfd6ad..90cfc6bb3 100644 --- a/modules/ui-module/src/main/ts/src/js/modules/form/field.textarea.ts +++ b/modules/ui-module/src/main/ts/src/js/modules/form/field.textarea.ts @@ -19,9 +19,9 @@ * . * #L% */ -import { createID } from "./utils.js"; -import { i18n } from "../localization.js" -import { FieldOptions, Form, FormContext, FormField } from "./forms.js"; +import { createID } from "@cms/modules/form/utils.js"; +import { i18n } from "@cms/modules/localization.js" +import { FieldOptions, Form, FormContext, FormField } from "@cms/modules/form/forms.js"; export interface TextAreaFieldOptions extends FieldOptions { rows?: number; diff --git a/modules/ui-module/src/main/ts/src/js/modules/form/forms.ts b/modules/ui-module/src/main/ts/src/js/modules/form/forms.ts index 4fc601c0b..3a38fe364 100644 --- a/modules/ui-module/src/main/ts/src/js/modules/form/forms.ts +++ b/modules/ui-module/src/main/ts/src/js/modules/form/forms.ts @@ -19,25 +19,25 @@ * . * #L% */ -import { createID } from "./utils.js"; -import { TextField } from "./field.text.js"; -import { MailField } from "./field.mail.js"; -import { CodeField } from "./field.code.js"; -import { SelectField } from "./field.select.js"; -import { MarkdownField } from "./field.markdown.js"; -import { EasyMDEField } from "./field.easymde.js"; -import { NumberField } from "./field.number.js"; -import { DateField } from "./field.date.js"; -import { ColorField } from "./field.color.js"; -import { DateTimeField } from "./field.datetime.js"; -import { RangeField } from "./field.range.js"; -import { RadioField } from "./field.radio.js"; -import { CheckboxField } from "./field.checkbox.js"; -import { Divider } from "./field.divider.js"; -import { MediaField } from "./field.media.js"; -import { ListField } from "./field.list.js"; -import { TextAreaField } from "./field.textarea.js"; -import { ReferenceField } from "./field.reference.js"; +import { createID } from "@cms/modules/form/utils.js"; +import { TextField } from "@cms/modules/form/field.text.js"; +import { MailField } from "@cms/modules/form/field.mail.js"; +import { CodeField } from "@cms/modules/form/field.code.js"; +import { SelectField } from "@cms/modules/form/field.select.js"; +import { MarkdownField } from "@cms/modules/form/field.markdown.js"; +import { EasyMDEField } from "@cms/modules/form/field.easymde.js"; +import { NumberField } from "@cms/modules/form/field.number.js"; +import { DateField } from "@cms/modules/form/field.date.js"; +import { ColorField } from "@cms/modules/form/field.color.js"; +import { DateTimeField } from "@cms/modules/form/field.datetime.js"; +import { RangeField } from "@cms/modules/form/field.range.js"; +import { RadioField } from "@cms/modules/form/field.radio.js"; +import { CheckboxField } from "@cms/modules/form/field.checkbox.js"; +import { Divider } from "@cms/modules/form/field.divider.js"; +import { MediaField } from "@cms/modules/form/field.media.js"; +import { ListField } from "@cms/modules/form/field.list.js"; +import { TextAreaField } from "@cms/modules/form/field.textarea.js"; +import { ReferenceField } from "@cms/modules/form/field.reference.js"; const createForm = (options) : Form => { diff --git a/modules/ui-module/src/main/ts/src/js/modules/locale-utils.js b/modules/ui-module/src/main/ts/src/js/modules/locale-utils.js index 6bc7cc9ae..b331e48a0 100644 --- a/modules/ui-module/src/main/ts/src/js/modules/locale-utils.js +++ b/modules/ui-module/src/main/ts/src/js/modules/locale-utils.js @@ -20,7 +20,7 @@ * #L% */ -import { UIStateManager } from './ui-state.js' +import { UIStateManager } from '@cms/modules/ui-state.js' const DEFAULT_LOCALE = 'en'; diff --git a/modules/ui-module/src/main/ts/src/js/modules/localization-loader.js b/modules/ui-module/src/main/ts/src/js/modules/localization-loader.js index 91992cf34..0d8181d43 100644 --- a/modules/ui-module/src/main/ts/src/js/modules/localization-loader.js +++ b/modules/ui-module/src/main/ts/src/js/modules/localization-loader.js @@ -19,9 +19,9 @@ * . * #L% */ -import { ACTION_LOCALIZATIONS } from './localization-actions.js'; -import { MODULE_LOCALIZATIONS } from './localization-modules.js'; -import { loadLocalizations } from './rpc/rpc-i18n.js' +import { ACTION_LOCALIZATIONS } from '@cms/modules/localization-actions.js'; +import { MODULE_LOCALIZATIONS } from '@cms/modules/localization-modules.js'; +import { loadLocalizations } from '@cms/modules/rpc/rpc-i18n.js' const DEFAULT_LOCALIZATIONS = { en: { diff --git a/modules/ui-module/src/main/ts/src/js/modules/localization.js b/modules/ui-module/src/main/ts/src/js/modules/localization.js index 140244c46..a6ac848f6 100644 --- a/modules/ui-module/src/main/ts/src/js/modules/localization.js +++ b/modules/ui-module/src/main/ts/src/js/modules/localization.js @@ -20,8 +20,8 @@ * #L% */ -import { getLocale, setLocale } from './locale-utils.js'; -import { loadLocalizationsWithDefaults } from './localization-loader.js'; +import { getLocale, setLocale } from '@cms/modules/locale-utils.js'; +import { loadLocalizationsWithDefaults } from '@cms/modules/localization-loader.js'; const DEFAULT_LOCALE = 'en'; diff --git a/modules/ui-module/src/main/ts/src/js/modules/manager-ui.js b/modules/ui-module/src/main/ts/src/js/modules/manager-ui.js index 25b4d32d1..28f29be12 100644 --- a/modules/ui-module/src/main/ts/src/js/modules/manager-ui.js +++ b/modules/ui-module/src/main/ts/src/js/modules/manager-ui.js @@ -20,8 +20,8 @@ * #L% */ -import { getContentNode, setMeta, getContent } from './rpc/rpc-content.js' -import { getPreviewUrl } from './preview.utils.js' +import { getContentNode, setMeta, getContent } from '@cms/modules/rpc/rpc-content.js' +import { getPreviewUrl } from '@cms/modules/preview.utils.js' export function updateStateButton() { var previewUrl = getPreviewUrl();; diff --git a/modules/ui-module/src/main/ts/src/js/modules/manager/manager.message.handlers.ts b/modules/ui-module/src/main/ts/src/js/modules/manager/manager.message.handlers.ts index 973991581..efc3ff5a4 100644 --- a/modules/ui-module/src/main/ts/src/js/modules/manager/manager.message.handlers.ts +++ b/modules/ui-module/src/main/ts/src/js/modules/manager/manager.message.handlers.ts @@ -1,6 +1,6 @@ -import frameMessenger from '../frameMessenger'; -import { getPreviewFrame, getPreviewUrl } from '../preview.utils'; -import { getContentNode } from '../rpc/rpc-content'; +import frameMessenger from '@cms/modules/frameMessenger.js'; +import { getPreviewFrame, getPreviewUrl } from '@cms/modules/preview.utils.js'; +import { getContentNode } from '@cms/modules/rpc/rpc-content.js'; const executeImageForm = (payload: any) => { const cmd: any = { diff --git a/modules/ui-module/src/main/ts/src/js/modules/manager/media.inject.ts b/modules/ui-module/src/main/ts/src/js/modules/manager/media.inject.ts index ccb758174..918c37435 100644 --- a/modules/ui-module/src/main/ts/src/js/modules/manager/media.inject.ts +++ b/modules/ui-module/src/main/ts/src/js/modules/manager/media.inject.ts @@ -1,5 +1,5 @@ -import { EDIT_ATTRIBUTES_ICON, IMAGE_ICON, MEDIA_CROP_ICON } from "./toolbar-icons"; -import frameMessenger from '../frameMessenger.js'; +import { EDIT_ATTRIBUTES_ICON, IMAGE_ICON, MEDIA_CROP_ICON } from "@cms/modules/manager/toolbar-icons"; +import frameMessenger from '@cms/modules/frameMessenger.js'; const isSameDomainImage = (imgElement) => { if (!(imgElement instanceof HTMLImageElement)) { diff --git a/modules/ui-module/src/main/ts/src/js/modules/manager/toolbar.inject.ts b/modules/ui-module/src/main/ts/src/js/modules/manager/toolbar.inject.ts index 0beaa0525..bc28644b5 100644 --- a/modules/ui-module/src/main/ts/src/js/modules/manager/toolbar.inject.ts +++ b/modules/ui-module/src/main/ts/src/js/modules/manager/toolbar.inject.ts @@ -1,5 +1,5 @@ -import frameMessenger from "../frameMessenger"; -import { EDIT_ATTRIBUTES_ICON, EDIT_PAGE_ICON, SECTION_ADD_ICON, SECTION_DELETE_ICON, SECTION_SORT_ICON, SECTION_UNPUBLISHED_ICON } from "./toolbar-icons"; +import frameMessenger from "@cms/modules/frameMessenger.js"; +import { EDIT_ATTRIBUTES_ICON, EDIT_PAGE_ICON, SECTION_ADD_ICON, SECTION_DELETE_ICON, SECTION_SORT_ICON, SECTION_UNPUBLISHED_ICON } from "@cms/modules/manager/toolbar-icons"; const addSection = (event : Event) => { var toolbar = (event.target as HTMLElement).closest('[data-cms-toolbar]') as HTMLElement; diff --git a/modules/ui-module/src/main/ts/src/js/modules/modal.js b/modules/ui-module/src/main/ts/src/js/modules/modal.js index a0e0ce93f..440c60f34 100644 --- a/modules/ui-module/src/main/ts/src/js/modules/modal.js +++ b/modules/ui-module/src/main/ts/src/js/modules/modal.js @@ -20,7 +20,7 @@ * #L% */ -import { i18n } from "./localization.js"; +import { i18n } from "@cms/modules/localization.js"; const defaultOptions = { validate: () => true diff --git a/modules/ui-module/src/main/ts/src/js/modules/preview.utils.js b/modules/ui-module/src/main/ts/src/js/modules/preview.utils.js index 5b8d9796c..c272b35b5 100644 --- a/modules/ui-module/src/main/ts/src/js/modules/preview.utils.js +++ b/modules/ui-module/src/main/ts/src/js/modules/preview.utils.js @@ -20,7 +20,7 @@ * #L% */ -import { EventBus } from "./event-bus.js"; +import { EventBus } from "@cms/modules/event-bus.js"; //PreviewHistory.init(); // close overlay on preview loaded diff --git a/modules/ui-module/src/main/ts/src/js/modules/rpc/rpc-content.ts b/modules/ui-module/src/main/ts/src/js/modules/rpc/rpc-content.ts index ee09accfb..51d5f30cb 100644 --- a/modules/ui-module/src/main/ts/src/js/modules/rpc/rpc-content.ts +++ b/modules/ui-module/src/main/ts/src/js/modules/rpc/rpc-content.ts @@ -20,7 +20,7 @@ * #L% */ -import { executeRemoteCall } from './rpc.js' +import { executeRemoteCall } from '@cms/modules/rpc/rpc.js' const getContentNode = async (options : any) => { var data = { diff --git a/modules/ui-module/src/main/ts/src/js/modules/rpc/rpc-files.ts b/modules/ui-module/src/main/ts/src/js/modules/rpc/rpc-files.ts index 024fa4f67..e681b4a9e 100644 --- a/modules/ui-module/src/main/ts/src/js/modules/rpc/rpc-files.ts +++ b/modules/ui-module/src/main/ts/src/js/modules/rpc/rpc-files.ts @@ -20,7 +20,7 @@ * #L% */ -import { executeRemoteCall } from './rpc.js' +import { executeRemoteCall } from '@cms/modules/rpc/rpc.js' const listFiles = async (options : any) => { var data = { diff --git a/modules/ui-module/src/main/ts/src/js/modules/rpc/rpc-i18n.ts b/modules/ui-module/src/main/ts/src/js/modules/rpc/rpc-i18n.ts index 99c4247c7..062f18e3f 100644 --- a/modules/ui-module/src/main/ts/src/js/modules/rpc/rpc-i18n.ts +++ b/modules/ui-module/src/main/ts/src/js/modules/rpc/rpc-i18n.ts @@ -20,7 +20,7 @@ * #L% */ -import { executeRemoteCall } from './rpc.js' +import { executeRemoteCall } from '@cms/modules/rpc/rpc.js' const loadLocalizations = async (options : any) => { var data = { diff --git a/modules/ui-module/src/main/ts/src/js/modules/rpc/rpc-manager.ts b/modules/ui-module/src/main/ts/src/js/modules/rpc/rpc-manager.ts index 12288bfb0..e4b9ca0fb 100644 --- a/modules/ui-module/src/main/ts/src/js/modules/rpc/rpc-manager.ts +++ b/modules/ui-module/src/main/ts/src/js/modules/rpc/rpc-manager.ts @@ -20,7 +20,7 @@ * #L% */ -import { executeRemoteCall } from './rpc.js' +import { executeRemoteCall } from '@cms/modules/rpc/rpc.js' const getSectionTemplates = async (options : any) => { var data = { diff --git a/modules/ui-module/src/main/ts/src/js/modules/rpc/rpc-media.ts b/modules/ui-module/src/main/ts/src/js/modules/rpc/rpc-media.ts index 35e3eb760..a62c6d318 100644 --- a/modules/ui-module/src/main/ts/src/js/modules/rpc/rpc-media.ts +++ b/modules/ui-module/src/main/ts/src/js/modules/rpc/rpc-media.ts @@ -20,7 +20,7 @@ * #L% */ -import { executeRemoteCall } from './rpc.js' +import { executeRemoteCall } from '@cms/modules/rpc/rpc.js' const getMediaMetaData = async (options : any) => { var data = { diff --git a/modules/ui-module/src/main/ts/src/js/modules/rpc/rpc-page.ts b/modules/ui-module/src/main/ts/src/js/modules/rpc/rpc-page.ts index 1cf3c1386..5e8004fc2 100644 --- a/modules/ui-module/src/main/ts/src/js/modules/rpc/rpc-page.ts +++ b/modules/ui-module/src/main/ts/src/js/modules/rpc/rpc-page.ts @@ -20,7 +20,7 @@ * #L% */ -import { executeRemoteCall } from './rpc.js' +import { executeRemoteCall } from '@cms/modules/rpc/rpc.js' export interface PageCreateOptions { uri: string; // The URI of the folder where the page should be created diff --git a/modules/ui-module/src/main/ts/src/js/modules/rpc/rpc-translation.ts b/modules/ui-module/src/main/ts/src/js/modules/rpc/rpc-translation.ts index 59bfb38cd..d14e4342d 100644 --- a/modules/ui-module/src/main/ts/src/js/modules/rpc/rpc-translation.ts +++ b/modules/ui-module/src/main/ts/src/js/modules/rpc/rpc-translation.ts @@ -20,7 +20,7 @@ * #L% */ -import { executeRemoteCall } from './rpc.js' +import { executeRemoteCall } from '@cms/modules/rpc/rpc.js' export interface GetTranslationsOptions { uri: string; // The URI of the folder where the page should be created diff --git a/modules/ui-module/src/main/ts/src/js/modules/rpc/rpc.ts b/modules/ui-module/src/main/ts/src/js/modules/rpc/rpc.ts index ce530ae84..1e153cda4 100644 --- a/modules/ui-module/src/main/ts/src/js/modules/rpc/rpc.ts +++ b/modules/ui-module/src/main/ts/src/js/modules/rpc/rpc.ts @@ -20,7 +20,7 @@ * #L% */ -import { i18n } from "../localization.js"; +import { i18n } from "@cms/modules/localization.js"; interface Options { method: string; diff --git a/modules/ui-module/src/main/ts/src/js/modules/toast.js b/modules/ui-module/src/main/ts/src/js/modules/toast.js index b8ceb01bb..2f5db2e31 100644 --- a/modules/ui-module/src/main/ts/src/js/modules/toast.js +++ b/modules/ui-module/src/main/ts/src/js/modules/toast.js @@ -20,7 +20,7 @@ * #L% */ -import { i18n } from './localization.js'; +import { i18n } from '@cms/modules/localization.js'; const showToast = (options) => { const toastId = 'toast_' + Date.now(); diff --git a/modules/ui-module/src/main/ts/src/js/modules/ui-state.js b/modules/ui-module/src/main/ts/src/js/modules/ui-state.js index 2bc940867..62b26e983 100644 --- a/modules/ui-module/src/main/ts/src/js/modules/ui-state.js +++ b/modules/ui-module/src/main/ts/src/js/modules/ui-state.js @@ -21,7 +21,7 @@ */ // state-manager.js -import { EventBus } from "./event-bus.js"; +import { EventBus } from "@cms/modules/event-bus.js"; const TAB_ID_KEY = "cms-tab-id"; const AUTH_KEY = "cms-auth-token"; diff --git a/modules/ui-module/src/main/ts/src/js/ui-actions.js b/modules/ui-module/src/main/ts/src/js/ui-actions.js index c9cffa522..6bec86fa9 100644 --- a/modules/ui-module/src/main/ts/src/js/ui-actions.js +++ b/modules/ui-module/src/main/ts/src/js/ui-actions.js @@ -20,8 +20,8 @@ * #L% */ -import { EventBus } from './modules/event-bus.js'; -import { i18n, localizeUi } from './modules/localization.js'; +import { EventBus } from '@cms/modules/event-bus.js'; +import { i18n, localizeUi } from '@cms/modules/localization.js'; window.addEventListener("DOMContentLoaded", async () => { diff --git a/modules/ui-module/src/main/ts/tsconfig.json b/modules/ui-module/src/main/ts/tsconfig.json index 76c8cb776..fd9ca7f79 100644 --- a/modules/ui-module/src/main/ts/tsconfig.json +++ b/modules/ui-module/src/main/ts/tsconfig.json @@ -2,6 +2,7 @@ "compilerOptions": { "outDir": "dist", "rootDir": "src", + "baseUrl": "src/", "module": "esnext", "target": "es2020", "moduleResolution": "node", @@ -9,6 +10,11 @@ "checkJs": false, "lib": ["dom", "es2020"], "sourceMap": false, + "paths": { + "@cms/modules/*": ["js/modules/*"], + "@cms/libs/*": ["js/libs/*"], + "@cms/*": ["js/*"], + } }, "include": [ "src/**/*", diff --git a/test-server/modules/example-module/libs/example-module-8.0.0.jar b/test-server/modules/example-module/libs/example-module-8.0.0.jar index 41c48396057e604f4030d7b4fc3f165bfc4a1360..29daf763b518b2872b31f916fef9033f5ebf036e 100644 GIT binary patch delta 3193 zcmaJ@2{@E%8~$bnSw`8H8DuQkGl((_Ga({TwvZ5Vl*S z)kUov))uunST`xi=37v{qrw(J5Jz~rA>fj|2Y6t*S$RFeYe5FKAdK)}9_QN$6bPa5 zU?9T84E#mjrMUY$)Vi|?8_gkt3K&Ld%HKy@a%*o`!>A2Bx1k)a#-2ZLyx&&KHiif@ zaKI!{<$I1}87F)!VU*X42LdW=yg;c)t6;xt=G)1fd6Q9qzr8Gks{yL1s^a$( z_W!)kl@3|$K!b6{4|VT9JE33?qdVZ~1PL4>53F*$=5T3i zqV4F6LEPE19ZZGDn%N%aUZ-p6p{gQPeN@`ypDC?-dTq$h^=q#9`w#h?>yR9~Ub}Li z;bW_Mpx%y?gbUwW4jE^Lu?P|@gdi@U5u*)!Y;=LOfh7BpuUHRV@_|f>c#%k@c4dRu zntivF+tXh>>$+FUQCI|4VXWy@b9tvj4UgZr^s$k9q2nfN$~Pv2EHK1$h;iu2E*D>cuAm|DvE4I7<1@U|%P zosq@SBJH-AF2YVhmO zc-sF;slzD)Dq?^@qz%L@)En&}k)I7yDR{ESL(21_3o-eH2Af}0s}KgHjyMj?W=F{`LLgvqoOYc-1=-CpF1wNUd?Vjkm*OO zIABryso#R7zo#$N*JCU-b|yP^TH$V2U6Gb=;Dtx~y?5t&8%drV-&wrho3-$sK`~^E zW-FAe6^zho@ML(0KYyZ6X7qY$x8Mhfoa(aa!hf%s6VI8~<=pJGIQ#7O3-;>Ca@^F1 z@Sl&@TmQ~ZN)@$Ac&we?-4r<248 z7n6T&6831Snsmv=bk_wBWJHGEGg5c)BTBaAnhIiky-#KiD10uTtC{pKcIal~$_#cl zZ|^J2GSwVg>=BecmN|8u;rZ!krq$wAHKD-wWXtL~%kkAJ<);LLB%ZW+NfzXoYvp(> zSf*B+P*0FB!U_+VtRjbjW_) z+Ypr2KpCD*2eDnMT*ss=e7ASVv6mA;1uh8M~H@=8F9EFd0MQ2+gjn`ne%v_ zX~bPE)Yly>9H*vYEMgUAf@J#61$fo39)3N<_~JD>C%^I@!=2gJW{!T%4sIKcpnFp& z#nG_c&;SwD8W|bW92v>i_$_#Nn=98MumV6g@~zu`>5=iZ;?DPFkw!VAAlu;A`TjUA5)DkhAtJy-;^ zT2Rm-v6k+r^|lOB{ZXeZlObHrAQtZJfhdSirL15eC>sZuCZH_A!mgiS8D@ZPfEChAUk5lur z^$UGfG$gdgW%UAyoL0!-`5wT4QFxQp`QsvdnduY_Xh(VAB0R-{nt1GGmQ+LX)4+;;A zj$V3qm)iyJU>8SJAixcXkwn1(Iv!;k*LIE{g8%(qsIn~h*z!pbtPcv6B>~VFO{#|)@CY**#`^}yhk Ye*n;OIS)4hl7kiKbRY<^c#0kQ8)x&Jy#N3J delta 3395 zcmaJ@2{@G78~(uUMkP1-2>N0k4WZ#1{Bp6AZ$^%9I|$`lABUh6JReg-8TKnXikBE(G`9AwH?e${*@km0Cl3rIN9 zEkS1owN2ofw;&!b3zH9e%kq178Oj(ynPuQTP8ZB$(14MoEIaiuxoD@BmY$|%kxtWz zmN~|B?(lX4m)gqwKUeLX@jPZupCC;8wwTog1+KnJ=T>d88T)gjVC>H$UnXBqNh2lK zSE~7$zbJKJQ>DjKjv96+{Dqj17D)R_c*YOUER;9Z-TJNn{(Ea37_sg>Xa9SVa zaXe9c-|x5f*xZoivY%1g-`5t9il$w!bDLDfzShaNTjtAfQ{+7i7yPFCdjme&uh!Opv?Z{v z@J3+Z_KcGmB}Nx!NH^L3C-y5Zei6cXShGW7IAKuMlUYR!Z+f(CcQx_Vu`!mmM34BD zGt&=y*_{mL=(ePG-YNfj(EIpi_=0O3iHuZ@tDc!lLsDvJxvGr}Q(r4myZ@fW_ny-C zrx$#*+L0jgG8=b*6+9xUeAE3xSH_h2%-XV5%|k2bwWQA7*YfsUV!JE$#0I9$pQaT* zkz+YqbUU?IlUk!|PFl+sxF5cXpG@DYz-nD2uY5R^+{zG1Rf+G(Bvpq<`L;~T-hN>a z&`xf>a&3Y~pYd#ToHsQnwP-A=QbzIp*FptZ81DEs+=^t$*F zRT<)^<5gl2_N=c~i9<`I`^7R>yS8(lwjk18slDN;bGjnSGrXl0JFYgpf^b)WBWC}s7-@4R zngQKzuq_cP4vGc*4As4|+Q3mY`>+E>tqL~uLWYnG?dpG{jg#}G+a<)pyr?tmJ=9QSYhF=pe$>q zITKzx=fP4-PqzFb83(bf8JW_W7H_>hw9OZ(g?X!;{&8Wco~ul#`*<5)zL4r&b;0Jo$k9|MBd zG9~+blkLaV4-X}?X-lt9<+dt1ncjBS< z)%9N@;?-#dL%V3cB)QX%GTON%CC{>K9ZqEQb7RhSt*l!1yyNXuzE@k+<&vFYIUJQT zT2jko!F-a+?T5ca4P_m?n<+0%ZCdm)IGs~klEjSP=Mwqr-Ouc};&ExwQbX1a@4i;E z#vSiw6vVFY`n;zr>QXoF8Ku!tcYgEDyQ9;e1Nyd(o>&uX;kL;7@*$InyEaAv9X$pg zydxydlCsJUtnZ4v1}>D?sr)+Z%=SO9Ds*-1n#PupVS}B=+;s~+^N8sO?;JDs_g_5i zwX}lFu~eV-x%@fj^l%9E8sTwUQ|B<{*UnYEwBzeCLUaB)U)PjHMb>%ncPwmfz}M0d z7}`)Ao_iYKGB!jwR37h@Hjh_KITZeaH>}Mgzjj`(Ft$0bn5;-3#u|=Gj7ub4f{Hl2 z0zvp#0DEoB(E{ISeih#-zaGJ+JP4dKzinJ#)L zFz~!7w-*A3A2T@KfdjSrd0~i6J2f zWSQ^X0|QONKmizFoD{g@5`hLe>!yOQmW7|L!T|JJ6}ulmo(Oy;t-|mU=0Ttd2$3NJ zNqI#e=^@iC7!j83pBoRtF~h~`l5s)8@jfI|kro-wG=6#z zVnTEqKrjU;Fl^9VFclU9oHB-6Lje|C7tr7+n7FXcLZCke{I|(0SQDIaFhG?tRTl#e zSR@4N(*=7+SZ^WF3j?0{7i>qIFH8kffiZ-?Ooi%$VoJbaHg`-N#t@d92?@`L%0hy$ z8bdI4mwot`kR?tL5`;w)68IO^w_j0Oxj8>Vu9G{uFyG^_s~BP-!07-Z2dW09!on?! nJ$z(KFk(#yi5}AEAC9>xzeR?&D6PgC0zJSx4;j&L8@}iNvS6rB diff --git a/test-server/themes/demo/templates/libs/fragments.html b/test-server/themes/demo/templates/libs/fragments.html index b5751c1e7..7098a21eb 100644 --- a/test-server/themes/demo/templates/libs/fragments.html +++ b/test-server/themes/demo/templates/libs/fragments.html @@ -17,4 +17,5 @@ {% endif %} -{{ hooks({'hook': 'theme/template/header'}) | raw }} \ No newline at end of file +{{ hooks({'hook': 'theme/template/header'}) | raw }} + From b156608b7245ccf3019481ba3d76f112ff834f24 Mon Sep 17 00:00:00 2001 From: Thorsten Marx Date: Wed, 10 Dec 2025 11:15:07 +0100 Subject: [PATCH 02/11] load script from classpath, remove logging --- .../api/utils/ClasspathResourceLoader.java | 112 ++++++++++++++++++ .../ExampleUiScriptActionSourceExtension.java | 7 +- .../condation/cms/modules/example/example.js | 24 ++++ .../resources/manager/js/manager-inject.js | 3 - .../src/main/ts/dist/js/manager-inject.js | 3 - .../src/main/ts/src/js/manager-inject.js | 3 - 6 files changed, 138 insertions(+), 14 deletions(-) create mode 100644 cms-api/src/main/java/com/condation/cms/api/utils/ClasspathResourceLoader.java create mode 100644 modules/example-module/src/main/resources/com/condation/cms/modules/example/example.js diff --git a/cms-api/src/main/java/com/condation/cms/api/utils/ClasspathResourceLoader.java b/cms-api/src/main/java/com/condation/cms/api/utils/ClasspathResourceLoader.java new file mode 100644 index 000000000..fcc326c6d --- /dev/null +++ b/cms-api/src/main/java/com/condation/cms/api/utils/ClasspathResourceLoader.java @@ -0,0 +1,112 @@ +package com.condation.cms.api.utils; + +/*- + * #%L + * cms-api + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ + +import java.io.BufferedReader; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.UncheckedIOException; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.Objects; + +/** + * Utility class for loading resources from the classpath as String. + */ +public final class ClasspathResourceLoader { + + private ClasspathResourceLoader() { + // Utility class: no instances allowed + } + + /** + * Loads a resource relative to the given class and returns its content as a String. + * + * @param baseClass class whose package is used as base for resolving the path + * @param relativePath relative path, e.g. "data/test.txt" or "/config/app.yml" + * @return content of the resource as String + * @throws IllegalArgumentException if parameters are invalid or the resource cannot be found + * @throws UncheckedIOException if an I/O error occurs while reading + */ + public static String loadRelative(Class baseClass, String relativePath) { + Objects.requireNonNull(baseClass, "baseClass must not be null"); + Objects.requireNonNull(relativePath, "relativePath must not be null"); + + try (InputStream in = baseClass.getResourceAsStream(relativePath)) { + if (in == null) { + throw new IllegalArgumentException("Resource not found relative to " + + baseClass.getName() + ": " + relativePath); + } + return toString(in); + } catch (IOException e) { + throw new UncheckedIOException("Failed to read resource relative to " + + baseClass.getName() + ": " + relativePath, e); + } + } + + /** + * Loads a resource using an absolute classpath path and returns its content as a String. + * + * @param absolutePath absolute path on the classpath, e.g. "config/app.yml" or "data/test.txt" + * @return content of the resource as String + * @throws IllegalArgumentException if the path is invalid or the resource cannot be found + * @throws UncheckedIOException if an I/O error occurs while reading + */ + public static String loadAbsolute(String absolutePath) { + Objects.requireNonNull(absolutePath, "absolutePath must not be null"); + + ClassLoader cl = Thread.currentThread().getContextClassLoader(); + if (cl == null) { + cl = ClasspathResourceLoader.class.getClassLoader(); + } + + try (InputStream in = cl.getResourceAsStream(absolutePath)) { + if (in == null) { + throw new IllegalArgumentException("Resource not found on classpath: " + absolutePath); + } + return toString(in); + } catch (IOException e) { + throw new UncheckedIOException("Failed to read resource from classpath: " + absolutePath, e); + } + } + + /** + * Reads an InputStream completely as a UTF-8 String. + * + * @param in input stream to read from + * @return content of the stream as String + * @throws IOException if an I/O error occurs while reading + */ + private static String toString(InputStream in) throws IOException { + StringBuilder sb = new StringBuilder(); + try (BufferedReader reader = new BufferedReader( + new InputStreamReader(in, StandardCharsets.UTF_8))) { + char[] buffer = new char[4096]; + int len; + while ((len = reader.read(buffer)) != -1) { + sb.append(buffer, 0, len); + } + } + return sb.toString(); + } +} diff --git a/modules/example-module/src/main/java/com/condation/cms/modules/example/ui/ExampleUiScriptActionSourceExtension.java b/modules/example-module/src/main/java/com/condation/cms/modules/example/ui/ExampleUiScriptActionSourceExtension.java index d57c99bba..8f7d38f3e 100644 --- a/modules/example-module/src/main/java/com/condation/cms/modules/example/ui/ExampleUiScriptActionSourceExtension.java +++ b/modules/example-module/src/main/java/com/condation/cms/modules/example/ui/ExampleUiScriptActionSourceExtension.java @@ -27,6 +27,7 @@ import com.condation.cms.api.ui.annotations.ShortCut; import com.condation.cms.api.ui.extensions.UIActionsExtensionPoint; import com.condation.cms.api.ui.extensions.UIScriptActionSourceExtension; +import com.condation.cms.api.utils.ClasspathResourceLoader; import com.condation.modules.api.annotation.Extension; import com.condation.modules.api.annotation.Extensions; import java.util.Map; @@ -43,11 +44,7 @@ public class ExampleUiScriptActionSourceExtension extends AbstractExtensionPoint @Override public Map getActionSources() { - return Map.of("example/source", """ - export async function runAction(parameters) { - console.log("This is an example action"); - } - """); + return Map.of("example/source", ClasspathResourceLoader.loadRelative(ExampleUiScriptActionSourceExtension.class, "example.js")); } @MenuEntry( diff --git a/modules/example-module/src/main/resources/com/condation/cms/modules/example/example.js b/modules/example-module/src/main/resources/com/condation/cms/modules/example/example.js new file mode 100644 index 000000000..c1b3f93f6 --- /dev/null +++ b/modules/example-module/src/main/resources/com/condation/cms/modules/example/example.js @@ -0,0 +1,24 @@ +/*- + * #%L + * example-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +export async function runAction(parameters) { + console.log("This is an example action"); +} diff --git a/modules/ui-module/src/main/resources/manager/js/manager-inject.js b/modules/ui-module/src/main/resources/manager/js/manager-inject.js index 2be90ce2a..40983c56c 100644 --- a/modules/ui-module/src/main/resources/manager/js/manager-inject.js +++ b/modules/ui-module/src/main/resources/manager/js/manager-inject.js @@ -37,15 +37,12 @@ script.type = 'importmap'; script.textContent = JSON.stringify(importMap); script.onload = () => { - console.log('✅ Import Map ready!'); // Debug resolve(); }; document.head.appendChild(script); // 3. window.manager kopieren window.manager = parentManager; // 4. Plugins laden - console.log('🔥 Loading manager-inject-init...'); const { initIframe } = await import('@cms/js/manager-inject-init.js'); - console.log('✅ initModule loaded!', initIframe); initIframe(); })(); diff --git a/modules/ui-module/src/main/ts/dist/js/manager-inject.js b/modules/ui-module/src/main/ts/dist/js/manager-inject.js index 2be90ce2a..40983c56c 100644 --- a/modules/ui-module/src/main/ts/dist/js/manager-inject.js +++ b/modules/ui-module/src/main/ts/dist/js/manager-inject.js @@ -37,15 +37,12 @@ script.type = 'importmap'; script.textContent = JSON.stringify(importMap); script.onload = () => { - console.log('✅ Import Map ready!'); // Debug resolve(); }; document.head.appendChild(script); // 3. window.manager kopieren window.manager = parentManager; // 4. Plugins laden - console.log('🔥 Loading manager-inject-init...'); const { initIframe } = await import('@cms/js/manager-inject-init.js'); - console.log('✅ initModule loaded!', initIframe); initIframe(); })(); diff --git a/modules/ui-module/src/main/ts/src/js/manager-inject.js b/modules/ui-module/src/main/ts/src/js/manager-inject.js index 6ec4b58c1..877d5c122 100644 --- a/modules/ui-module/src/main/ts/src/js/manager-inject.js +++ b/modules/ui-module/src/main/ts/src/js/manager-inject.js @@ -40,7 +40,6 @@ script.type = 'importmap'; script.textContent = JSON.stringify(importMap); script.onload = () => { - console.log('✅ Import Map ready!'); // Debug resolve(); }; document.head.appendChild(script); @@ -49,8 +48,6 @@ window.manager = parentManager; // 4. Plugins laden - console.log('🔥 Loading manager-inject-init...'); const { initIframe } = await import('@cms/js/manager-inject-init.js'); - console.log('✅ initModule loaded!', initIframe); initIframe() })(); \ No newline at end of file From 25ab87c2f00c89b5e31260445fc86f5862a719e3 Mon Sep 17 00:00:00 2001 From: Thorsten Marx Date: Wed, 10 Dec 2025 15:25:36 +0100 Subject: [PATCH 03/11] refactor ui package deploy npm package, use it in example module --- .gitignore | 4 +- .../ExampleUiScriptActionSourceExtension.java | 2 +- .../cms/modules/example/ui/example-action.js | 31 + .../src/main/ts/dist/example-action.js | 10 + .../example-module/src/main/ts/package.json | 17 + .../src/main/ts/src/example-action.ts | 13 + .../example-module/src/main/ts/tsconfig.json | 18 + .../manager/actions/media/edit-focal-point.js | 10 +- .../manager/actions/media/edit-media-form.js | 16 +- .../manager/actions/media/select-media.js | 10 +- .../manager/actions/page/add-section.js | 14 +- .../manager/actions/page/create-page.js | 2 +- .../manager/actions/page/delete-section.js | 10 +- .../manager/actions/page/edit-content.js | 12 +- .../actions/page/edit-metaattribute-list.js | 14 +- .../actions/page/edit-metaattribute.js | 14 +- .../actions/page/edit-page-settings.js | 16 +- .../manager/actions/page/edit-sections.js | 12 +- .../manager/actions/page/manage-assets.js | 2 +- .../actions/page/section-set-published.js | 4 +- .../manager/actions/page/translations.js | 14 +- .../resources/manager/actions/test-command.js | 4 +- .../src/main/resources/manager/index.html | 3 +- .../manager/js/libs/handlebars.min.js | 579 ------------------ .../manager/js/libs/sortablejs.min.js | 516 ---------------- .../resources/manager/js/manager-globals.d.ts | 38 ++ .../manager/js/manager-inject-init.d.ts | 23 + .../resources/manager/js/manager-inject.d.ts} | 5 +- .../main/resources/manager/js/manager.d.ts | 22 + .../manager/js/manager/media-inject.js | 141 ----- .../js/modules/filebrowser.template.js | 2 +- .../js/modules/manager/media-inject.js | 171 ------ .../main/resources/manager/js/ui-actions.d.ts | 22 + .../dist/actions/media/edit-focal-point.d.ts | 1 + .../ts/dist/actions/media/edit-focal-point.js | 10 +- .../dist/actions/media/edit-media-form.d.ts | 1 + .../ts/dist/actions/media/edit-media-form.js | 16 +- .../ts/dist/actions/media/select-media.d.ts | 1 + .../ts/dist/actions/media/select-media.js | 10 +- .../ts/dist/actions/page/add-section.d.ts | 1 + .../main/ts/dist/actions/page/add-section.js | 14 +- .../ts/dist/actions/page/create-page.d.ts | 1 + .../main/ts/dist/actions/page/create-page.js | 2 +- .../ts/dist/actions/page/delete-section.d.ts | 1 + .../ts/dist/actions/page/delete-section.js | 10 +- .../ts/dist/actions/page/edit-content.d.ts | 1 + .../main/ts/dist/actions/page/edit-content.js | 12 +- .../actions/page/edit-metaattribute-list.d.ts | 1 + .../actions/page/edit-metaattribute-list.js | 14 +- .../dist/actions/page/edit-metaattribute.d.ts | 1 + .../dist/actions/page/edit-metaattribute.js | 14 +- .../dist/actions/page/edit-page-settings.d.ts | 1 + .../dist/actions/page/edit-page-settings.js | 16 +- .../ts/dist/actions/page/edit-sections.d.ts | 1 + .../ts/dist/actions/page/edit-sections.js | 12 +- .../ts/dist/actions/page/manage-assets.d.ts | 1 + .../ts/dist/actions/page/manage-assets.js | 2 +- .../actions/page/section-set-published.d.ts | 1 + .../actions/page/section-set-published.js | 4 +- .../ts/dist/actions/page/translations.d.ts | 1 + .../main/ts/dist/actions/page/translations.js | 14 +- .../main/ts/dist/actions/reload-preview.d.ts | 1 + .../src/main/ts/dist/actions/site-change.d.ts | 1 + .../main/ts/dist/actions/test-command.d.ts | 1 + .../src/main/ts/dist/actions/test-command.js | 4 +- .../main/ts/dist/js/libs/handlebars.min.js | 579 ------------------ .../main/ts/dist/js/libs/sortablejs.min.js | 516 ---------------- .../src/main/ts/dist/js/manager-globals.d.ts | 17 + .../main/ts/dist/js/manager-inject-init.d.ts | 2 + .../src/main/ts/dist/js/manager-inject.d.ts | 0 .../src/main/ts/dist/js/manager.d.ts | 1 + .../src/main/ts/dist/js/modules/alerts.d.ts | 4 + .../main/ts/dist/js/modules/event-bus.d.ts | 4 + .../dist/js/modules/filebrowser.actions.d.ts | 24 + .../main/ts/dist/js/modules/filebrowser.d.ts | 5 + .../dist/js/modules/filebrowser.template.d.ts | 2 + .../dist/js/modules/filebrowser.template.js | 2 +- .../dist/js/modules/filebrowser.upload.d.ts | 2 + .../dist/js/modules/form/field.checkbox.d.ts | 11 + .../ts/dist/js/modules/form/field.code.d.ts | 9 + .../ts/dist/js/modules/form/field.color.d.ts | 4 + .../ts/dist/js/modules/form/field.date.d.ts | 5 + .../dist/js/modules/form/field.datetime.d.ts | 5 + .../dist/js/modules/form/field.divider.d.ts | 4 + .../dist/js/modules/form/field.easymde.d.ts | 4 + .../ts/dist/js/modules/form/field.list.d.ts | 7 + .../ts/dist/js/modules/form/field.mail.d.ts | 5 + .../dist/js/modules/form/field.markdown.d.ts | 6 + .../ts/dist/js/modules/form/field.media.d.ts | 4 + .../ts/dist/js/modules/form/field.number.d.ts | 10 + .../ts/dist/js/modules/form/field.radio.d.ts | 10 + .../ts/dist/js/modules/form/field.range.d.ts | 9 + .../dist/js/modules/form/field.reference.d.ts | 7 + .../ts/dist/js/modules/form/field.select.d.ts | 10 + .../ts/dist/js/modules/form/field.text.d.ts | 5 + .../dist/js/modules/form/field.textarea.d.ts | 5 + .../main/ts/dist/js/modules/form/forms.d.ts | 20 + .../main/ts/dist/js/modules/form/utils.d.ts | 6 + .../ts/dist/js/modules/frameMessenger.d.ts | 9 + .../main/ts/dist/js/modules/locale-utils.d.ts | 2 + .../dist/js/modules/localization-actions.d.ts | 13 + .../dist/js/modules/localization-loader.d.ts | 24 + .../dist/js/modules/localization-modules.d.ts | 16 + .../main/ts/dist/js/modules/localization.d.ts | 32 + .../main/ts/dist/js/modules/manager-ui.d.ts | 2 + .../manager/manager.message.handlers.d.ts | 2 + .../dist/js/modules/manager/media.inject.d.ts | 4 + .../js/modules/manager/toolbar-icons.d.ts | 9 + .../js/modules/manager/toolbar.inject.d.ts | 1 + .../src/main/ts/dist/js/modules/modal.d.ts | 1 + .../src/main/ts/dist/js/modules/node.d.ts | 14 + .../ts/dist/js/modules/preview.history.d.ts | 7 + .../ts/dist/js/modules/preview.utils.d.ts | 6 + .../ts/dist/js/modules/rpc/rpc-content.d.ts | 8 + .../ts/dist/js/modules/rpc/rpc-files.d.ts | 7 + .../main/ts/dist/js/modules/rpc/rpc-i18n.d.ts | 2 + .../ts/dist/js/modules/rpc/rpc-manager.d.ts | 23 + .../ts/dist/js/modules/rpc/rpc-media.d.ts | 3 + .../main/ts/dist/js/modules/rpc/rpc-page.d.ts | 8 + .../dist/js/modules/rpc/rpc-translation.d.ts | 33 + .../src/main/ts/dist/js/modules/rpc/rpc.d.ts | 7 + .../src/main/ts/dist/js/modules/sidebar.d.ts | 1 + .../src/main/ts/dist/js/modules/state.d.ts | 7 + .../src/main/ts/dist/js/modules/toast.d.ts | 1 + .../src/main/ts/dist/js/modules/ui-state.d.ts | 10 + .../src/main/ts/dist/js/modules/upload.d.ts | 8 + .../src/main/ts/dist/js/ui-actions.d.ts | 1 + .../main/ts/dist/public/manager-login.d.ts | 8 + modules/ui-module/src/main/ts/package.json | 8 + .../ts/src/actions/media/edit-focal-point.ts | 10 +- .../ts/src/actions/media/edit-media-form.js | 16 +- .../main/ts/src/actions/media/select-media.ts | 10 +- .../main/ts/src/actions/page/add-section.js | 14 +- .../main/ts/src/actions/page/create-page.js | 2 +- .../ts/src/actions/page/delete-section.js | 10 +- .../main/ts/src/actions/page/edit-content.js | 12 +- .../actions/page/edit-metaattribute-list.js | 14 +- .../ts/src/actions/page/edit-metaattribute.js | 14 +- .../ts/src/actions/page/edit-page-settings.js | 16 +- .../main/ts/src/actions/page/edit-sections.js | 12 +- .../main/ts/src/actions/page/manage-assets.js | 2 +- .../src/actions/page/section-set-published.ts | 4 +- .../main/ts/src/actions/page/translations.ts | 14 +- .../src/main/ts/src/actions/test-command.js | 4 +- .../src/main/ts/src/js/libs/handlebars.min.js | 8 - .../src/main/ts/src/js/libs/sortablejs.min.js | 14 - .../ts/src/js/modules/filebrowser.template.js | 2 +- modules/ui-module/src/main/ts/tsconfig.json | 1 + .../libs/example-module-8.0.0.jar | Bin 18692 -> 19409 bytes 149 files changed, 937 insertions(+), 2765 deletions(-) create mode 100644 modules/example-module/src/main/resources/com/condation/cms/modules/example/ui/example-action.js create mode 100644 modules/example-module/src/main/ts/dist/example-action.js create mode 100644 modules/example-module/src/main/ts/package.json create mode 100644 modules/example-module/src/main/ts/src/example-action.ts create mode 100644 modules/example-module/src/main/ts/tsconfig.json delete mode 100644 modules/ui-module/src/main/resources/manager/js/libs/handlebars.min.js delete mode 100644 modules/ui-module/src/main/resources/manager/js/libs/sortablejs.min.js create mode 100644 modules/ui-module/src/main/resources/manager/js/manager-globals.d.ts create mode 100644 modules/ui-module/src/main/resources/manager/js/manager-inject-init.d.ts rename modules/{example-module/src/main/resources/com/condation/cms/modules/example/example.js => ui-module/src/main/resources/manager/js/manager-inject.d.ts} (87%) create mode 100644 modules/ui-module/src/main/resources/manager/js/manager.d.ts delete mode 100644 modules/ui-module/src/main/resources/manager/js/manager/media-inject.js delete mode 100644 modules/ui-module/src/main/resources/manager/js/modules/manager/media-inject.js create mode 100644 modules/ui-module/src/main/resources/manager/js/ui-actions.d.ts create mode 100644 modules/ui-module/src/main/ts/dist/actions/media/edit-focal-point.d.ts create mode 100644 modules/ui-module/src/main/ts/dist/actions/media/edit-media-form.d.ts create mode 100644 modules/ui-module/src/main/ts/dist/actions/media/select-media.d.ts create mode 100644 modules/ui-module/src/main/ts/dist/actions/page/add-section.d.ts create mode 100644 modules/ui-module/src/main/ts/dist/actions/page/create-page.d.ts create mode 100644 modules/ui-module/src/main/ts/dist/actions/page/delete-section.d.ts create mode 100644 modules/ui-module/src/main/ts/dist/actions/page/edit-content.d.ts create mode 100644 modules/ui-module/src/main/ts/dist/actions/page/edit-metaattribute-list.d.ts create mode 100644 modules/ui-module/src/main/ts/dist/actions/page/edit-metaattribute.d.ts create mode 100644 modules/ui-module/src/main/ts/dist/actions/page/edit-page-settings.d.ts create mode 100644 modules/ui-module/src/main/ts/dist/actions/page/edit-sections.d.ts create mode 100644 modules/ui-module/src/main/ts/dist/actions/page/manage-assets.d.ts create mode 100644 modules/ui-module/src/main/ts/dist/actions/page/section-set-published.d.ts create mode 100644 modules/ui-module/src/main/ts/dist/actions/page/translations.d.ts create mode 100644 modules/ui-module/src/main/ts/dist/actions/reload-preview.d.ts create mode 100644 modules/ui-module/src/main/ts/dist/actions/site-change.d.ts create mode 100644 modules/ui-module/src/main/ts/dist/actions/test-command.d.ts delete mode 100644 modules/ui-module/src/main/ts/dist/js/libs/handlebars.min.js delete mode 100644 modules/ui-module/src/main/ts/dist/js/libs/sortablejs.min.js create mode 100644 modules/ui-module/src/main/ts/dist/js/manager-globals.d.ts create mode 100644 modules/ui-module/src/main/ts/dist/js/manager-inject-init.d.ts create mode 100644 modules/ui-module/src/main/ts/dist/js/manager-inject.d.ts create mode 100644 modules/ui-module/src/main/ts/dist/js/manager.d.ts create mode 100644 modules/ui-module/src/main/ts/dist/js/modules/alerts.d.ts create mode 100644 modules/ui-module/src/main/ts/dist/js/modules/event-bus.d.ts create mode 100644 modules/ui-module/src/main/ts/dist/js/modules/filebrowser.actions.d.ts create mode 100644 modules/ui-module/src/main/ts/dist/js/modules/filebrowser.d.ts create mode 100644 modules/ui-module/src/main/ts/dist/js/modules/filebrowser.template.d.ts create mode 100644 modules/ui-module/src/main/ts/dist/js/modules/filebrowser.upload.d.ts create mode 100644 modules/ui-module/src/main/ts/dist/js/modules/form/field.checkbox.d.ts create mode 100644 modules/ui-module/src/main/ts/dist/js/modules/form/field.code.d.ts create mode 100644 modules/ui-module/src/main/ts/dist/js/modules/form/field.color.d.ts create mode 100644 modules/ui-module/src/main/ts/dist/js/modules/form/field.date.d.ts create mode 100644 modules/ui-module/src/main/ts/dist/js/modules/form/field.datetime.d.ts create mode 100644 modules/ui-module/src/main/ts/dist/js/modules/form/field.divider.d.ts create mode 100644 modules/ui-module/src/main/ts/dist/js/modules/form/field.easymde.d.ts create mode 100644 modules/ui-module/src/main/ts/dist/js/modules/form/field.list.d.ts create mode 100644 modules/ui-module/src/main/ts/dist/js/modules/form/field.mail.d.ts create mode 100644 modules/ui-module/src/main/ts/dist/js/modules/form/field.markdown.d.ts create mode 100644 modules/ui-module/src/main/ts/dist/js/modules/form/field.media.d.ts create mode 100644 modules/ui-module/src/main/ts/dist/js/modules/form/field.number.d.ts create mode 100644 modules/ui-module/src/main/ts/dist/js/modules/form/field.radio.d.ts create mode 100644 modules/ui-module/src/main/ts/dist/js/modules/form/field.range.d.ts create mode 100644 modules/ui-module/src/main/ts/dist/js/modules/form/field.reference.d.ts create mode 100644 modules/ui-module/src/main/ts/dist/js/modules/form/field.select.d.ts create mode 100644 modules/ui-module/src/main/ts/dist/js/modules/form/field.text.d.ts create mode 100644 modules/ui-module/src/main/ts/dist/js/modules/form/field.textarea.d.ts create mode 100644 modules/ui-module/src/main/ts/dist/js/modules/form/forms.d.ts create mode 100644 modules/ui-module/src/main/ts/dist/js/modules/form/utils.d.ts create mode 100644 modules/ui-module/src/main/ts/dist/js/modules/frameMessenger.d.ts create mode 100644 modules/ui-module/src/main/ts/dist/js/modules/locale-utils.d.ts create mode 100644 modules/ui-module/src/main/ts/dist/js/modules/localization-actions.d.ts create mode 100644 modules/ui-module/src/main/ts/dist/js/modules/localization-loader.d.ts create mode 100644 modules/ui-module/src/main/ts/dist/js/modules/localization-modules.d.ts create mode 100644 modules/ui-module/src/main/ts/dist/js/modules/localization.d.ts create mode 100644 modules/ui-module/src/main/ts/dist/js/modules/manager-ui.d.ts create mode 100644 modules/ui-module/src/main/ts/dist/js/modules/manager/manager.message.handlers.d.ts create mode 100644 modules/ui-module/src/main/ts/dist/js/modules/manager/media.inject.d.ts create mode 100644 modules/ui-module/src/main/ts/dist/js/modules/manager/toolbar-icons.d.ts create mode 100644 modules/ui-module/src/main/ts/dist/js/modules/manager/toolbar.inject.d.ts create mode 100644 modules/ui-module/src/main/ts/dist/js/modules/modal.d.ts create mode 100644 modules/ui-module/src/main/ts/dist/js/modules/node.d.ts create mode 100644 modules/ui-module/src/main/ts/dist/js/modules/preview.history.d.ts create mode 100644 modules/ui-module/src/main/ts/dist/js/modules/preview.utils.d.ts create mode 100644 modules/ui-module/src/main/ts/dist/js/modules/rpc/rpc-content.d.ts create mode 100644 modules/ui-module/src/main/ts/dist/js/modules/rpc/rpc-files.d.ts create mode 100644 modules/ui-module/src/main/ts/dist/js/modules/rpc/rpc-i18n.d.ts create mode 100644 modules/ui-module/src/main/ts/dist/js/modules/rpc/rpc-manager.d.ts create mode 100644 modules/ui-module/src/main/ts/dist/js/modules/rpc/rpc-media.d.ts create mode 100644 modules/ui-module/src/main/ts/dist/js/modules/rpc/rpc-page.d.ts create mode 100644 modules/ui-module/src/main/ts/dist/js/modules/rpc/rpc-translation.d.ts create mode 100644 modules/ui-module/src/main/ts/dist/js/modules/rpc/rpc.d.ts create mode 100644 modules/ui-module/src/main/ts/dist/js/modules/sidebar.d.ts create mode 100644 modules/ui-module/src/main/ts/dist/js/modules/state.d.ts create mode 100644 modules/ui-module/src/main/ts/dist/js/modules/toast.d.ts create mode 100644 modules/ui-module/src/main/ts/dist/js/modules/ui-state.d.ts create mode 100644 modules/ui-module/src/main/ts/dist/js/modules/upload.d.ts create mode 100644 modules/ui-module/src/main/ts/dist/js/ui-actions.d.ts create mode 100644 modules/ui-module/src/main/ts/dist/public/manager-login.d.ts create mode 100644 modules/ui-module/src/main/ts/package.json delete mode 100644 modules/ui-module/src/main/ts/src/js/libs/handlebars.min.js delete mode 100644 modules/ui-module/src/main/ts/src/js/libs/sortablejs.min.js diff --git a/.gitignore b/.gitignore index 5b89c80d4..45e6960a2 100644 --- a/.gitignore +++ b/.gitignore @@ -72,4 +72,6 @@ test-server/hosts/features/data/ test-server/mail-server/fake-smtp-server-2.4.2.jar modules/api-module/src/test/resources/site/data cms-content/src/test/resources/site/data -integration-tests/hosts/test/data \ No newline at end of file +integration-tests/hosts/test/data +/modules/example-module/src/main/ts/node_modules/ +/modules/example-module/src/main/ts/pnpm-lock.yaml diff --git a/modules/example-module/src/main/java/com/condation/cms/modules/example/ui/ExampleUiScriptActionSourceExtension.java b/modules/example-module/src/main/java/com/condation/cms/modules/example/ui/ExampleUiScriptActionSourceExtension.java index 8f7d38f3e..d5843ebd5 100644 --- a/modules/example-module/src/main/java/com/condation/cms/modules/example/ui/ExampleUiScriptActionSourceExtension.java +++ b/modules/example-module/src/main/java/com/condation/cms/modules/example/ui/ExampleUiScriptActionSourceExtension.java @@ -44,7 +44,7 @@ public class ExampleUiScriptActionSourceExtension extends AbstractExtensionPoint @Override public Map getActionSources() { - return Map.of("example/source", ClasspathResourceLoader.loadRelative(ExampleUiScriptActionSourceExtension.class, "example.js")); + return Map.of("example/source", ClasspathResourceLoader.loadRelative(ExampleUiScriptActionSourceExtension.class, "example-action.js")); } @MenuEntry( diff --git a/modules/example-module/src/main/resources/com/condation/cms/modules/example/ui/example-action.js b/modules/example-module/src/main/resources/com/condation/cms/modules/example/ui/example-action.js new file mode 100644 index 000000000..6aaf9d1a7 --- /dev/null +++ b/modules/example-module/src/main/resources/com/condation/cms/modules/example/ui/example-action.js @@ -0,0 +1,31 @@ +/*- + * #%L + * example-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +import { showToast } from 'condation-cms-ui/dist/js/modules/toast.js'; +export async function runAction(parameters) { + console.log("This is an example action"); + showToast({ + title: 'Example Action', + message: 'Example Action executed successfully!', + type: 'success', + duration: 3000 + }); +} diff --git a/modules/example-module/src/main/ts/dist/example-action.js b/modules/example-module/src/main/ts/dist/example-action.js new file mode 100644 index 000000000..7c04ab322 --- /dev/null +++ b/modules/example-module/src/main/ts/dist/example-action.js @@ -0,0 +1,10 @@ +import { showToast } from 'condation-cms-ui/dist/js/modules/toast.js'; +export async function runAction(parameters) { + console.log("This is an example action"); + showToast({ + title: 'Example Action', + message: 'Example Action executed successfully!', + type: 'success', + duration: 3000 + }); +} diff --git a/modules/example-module/src/main/ts/package.json b/modules/example-module/src/main/ts/package.json new file mode 100644 index 000000000..20a5aeeba --- /dev/null +++ b/modules/example-module/src/main/ts/package.json @@ -0,0 +1,17 @@ +{ + "name": "ts", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "compile": "tsc" + }, + "keywords": [], + "author": "", + "license": "ISC", + "packageManager": "pnpm@10.25.0", + "dependencies": { + "condation-cms-ui": "^0.2.0", + "typescript": "^5.9.3" + } +} diff --git a/modules/example-module/src/main/ts/src/example-action.ts b/modules/example-module/src/main/ts/src/example-action.ts new file mode 100644 index 000000000..93e688710 --- /dev/null +++ b/modules/example-module/src/main/ts/src/example-action.ts @@ -0,0 +1,13 @@ + +import { showToast } from 'condation-cms-ui/dist/js/modules/toast.js'; + +export async function runAction(parameters : any) : Promise { + console.log("This is an example action"); + + showToast({ + title: 'Example Action', + message: 'Example Action executed successfully!', + type: 'success', + duration: 3000 + }) +} \ No newline at end of file diff --git a/modules/example-module/src/main/ts/tsconfig.json b/modules/example-module/src/main/ts/tsconfig.json new file mode 100644 index 000000000..757f2b4e9 --- /dev/null +++ b/modules/example-module/src/main/ts/tsconfig.json @@ -0,0 +1,18 @@ +{ + "compilerOptions": { + "outDir": "dist", + "rootDir": "src", + "baseUrl": ".", + "module": "esnext", + "target": "es2020", + "moduleResolution": "node", + "allowJs": true, + "checkJs": false, + "lib": ["dom", "es2020"], + "sourceMap": false + }, + "include": [ + "src/**/*", + "globals.d.ts" + ] +} diff --git a/modules/ui-module/src/main/resources/manager/actions/media/edit-focal-point.js b/modules/ui-module/src/main/resources/manager/actions/media/edit-focal-point.js index da7732ef6..2d9576112 100644 --- a/modules/ui-module/src/main/resources/manager/actions/media/edit-focal-point.js +++ b/modules/ui-module/src/main/resources/manager/actions/media/edit-focal-point.js @@ -19,11 +19,11 @@ * . * #L% */ -import { i18n } from "../../js/modules/localization.js"; -import { openModal } from "../../js/modules/modal.js"; -import { reloadPreview } from "../../js/modules/preview.utils.js"; -import { getMediaMetaData, setMediaMetaData } from "../../js/modules/rpc/rpc-media.js"; -import { showToast } from "../../js/modules/toast.js"; +import { i18n } from "@cms/modules/localization.js"; +import { openModal } from "@cms/modules/modal.js"; +import { reloadPreview } from "@cms/modules/preview.utils.js"; +import { getMediaMetaData, setMediaMetaData } from "@cms/modules/rpc/rpc-media.js"; +import { showToast } from "@cms/modules/toast.js"; export async function runAction(params) { var uri = params.options.uri || null; var mediaUrl = removeFormatParamFromUrl(uri); diff --git a/modules/ui-module/src/main/resources/manager/actions/media/edit-media-form.js b/modules/ui-module/src/main/resources/manager/actions/media/edit-media-form.js index 1ac188040..38f7c2d81 100644 --- a/modules/ui-module/src/main/resources/manager/actions/media/edit-media-form.js +++ b/modules/ui-module/src/main/resources/manager/actions/media/edit-media-form.js @@ -19,14 +19,14 @@ * . * #L% */ -import { openSidebar } from '../../js/modules/sidebar.js'; -import { createForm } from '../../js/modules/form/forms.js'; -import { showToast } from '../../js/modules/toast.js'; -import { setMeta } from '../../js/modules/rpc/rpc-content.js'; -import { reloadPreview } from '../../js/modules/preview.utils.js'; -import { i18n } from '../../js/modules/localization.js'; -import { getMediaForm } from '../../js/modules/rpc/rpc-manager.js'; -import { getMediaMetaData, setMediaMetaData } from '../../js/modules/rpc/rpc-media.js'; +import { openSidebar } from '@cms/modules/sidebar.js'; +import { createForm } from '@cms/modules/form/forms.js'; +import { showToast } from '@cms/modules/toast.js'; +import { setMeta } from '@cms/modules/rpc/rpc-content.js'; +import { reloadPreview } from '@cms/modules/preview.utils.js'; +import { i18n } from '@cms/modules/localization.js'; +import { getMediaForm } from '@cms/modules/rpc/rpc-manager.js'; +import { getMediaMetaData, setMediaMetaData } from '@cms/modules/rpc/rpc-media.js'; export async function runAction(params) { var mediaForm = (await getMediaForm({ form: params.options.form || 'meta' diff --git a/modules/ui-module/src/main/resources/manager/actions/media/select-media.js b/modules/ui-module/src/main/resources/manager/actions/media/select-media.js index 7fa55de49..9d3135268 100644 --- a/modules/ui-module/src/main/resources/manager/actions/media/select-media.js +++ b/modules/ui-module/src/main/resources/manager/actions/media/select-media.js @@ -19,11 +19,11 @@ * . * #L% */ -import { openFileBrowser } from "../../js/modules/filebrowser.js"; -import { i18n } from "../../js/modules/localization.js"; -import { getPreviewUrl, reloadPreview } from "../../js/modules/preview.utils.js"; -import { getContentNode, setMeta } from "../../js/modules/rpc/rpc-content.js"; -import { showToast } from "../../js/modules/toast.js"; +import { openFileBrowser } from "@cms/modules/filebrowser.js"; +import { i18n } from "@cms/modules/localization.js"; +import { getPreviewUrl, reloadPreview } from "@cms/modules/preview.utils.js"; +import { getContentNode, setMeta } from "@cms/modules/rpc/rpc-content.js"; +import { showToast } from "@cms/modules/toast.js"; export async function runAction(params) { var uri = null; if (params.options.uri) { diff --git a/modules/ui-module/src/main/resources/manager/actions/page/add-section.js b/modules/ui-module/src/main/resources/manager/actions/page/add-section.js index c4458c927..ba633716a 100644 --- a/modules/ui-module/src/main/resources/manager/actions/page/add-section.js +++ b/modules/ui-module/src/main/resources/manager/actions/page/add-section.js @@ -19,13 +19,13 @@ * . * #L% */ -import { openModal } from '../../js/modules/modal.js'; -import { showToast } from '../../js/modules/toast.js'; -import { addSection, getContentNode } from '../../js/modules/rpc/rpc-content.js'; -import { getPreviewUrl, reloadPreview } from '../../js/modules/preview.utils.js'; -import Handlebars from '../../js/libs/handlebars.min.js'; -import { i18n } from '../../js/modules/localization.js'; -import { getSectionTemplates } from '../../js/modules/rpc/rpc-manager.js'; +import { openModal } from '@cms/modules/modal.js'; +import { showToast } from '@cms/modules/toast.js'; +import { addSection, getContentNode } from '@cms/modules/rpc/rpc-content.js'; +import { getPreviewUrl, reloadPreview } from '@cms/modules/preview.utils.js'; +import Handlebars from 'https://cdn.jsdelivr.net/npm/handlebars@4.7.8/+esm'; +import { i18n } from '@cms/modules/localization.js'; +import { getSectionTemplates } from '@cms/modules/rpc/rpc-manager.js'; export async function runAction(params) { const contentNode = await getContentNode({ url: getPreviewUrl() diff --git a/modules/ui-module/src/main/resources/manager/actions/page/create-page.js b/modules/ui-module/src/main/resources/manager/actions/page/create-page.js index d744915fa..58863c147 100644 --- a/modules/ui-module/src/main/resources/manager/actions/page/create-page.js +++ b/modules/ui-module/src/main/resources/manager/actions/page/create-page.js @@ -19,7 +19,7 @@ * . * #L% */ -import { openFileBrowser } from '../../js/modules/filebrowser.js'; +import { openFileBrowser } from '@cms/modules/filebrowser.js'; // hook.js export async function runAction(params) { openFileBrowser({ diff --git a/modules/ui-module/src/main/resources/manager/actions/page/delete-section.js b/modules/ui-module/src/main/resources/manager/actions/page/delete-section.js index bb3bbb595..9b8d83b69 100644 --- a/modules/ui-module/src/main/resources/manager/actions/page/delete-section.js +++ b/modules/ui-module/src/main/resources/manager/actions/page/delete-section.js @@ -19,11 +19,11 @@ * . * #L% */ -import { i18n } from '../../js/modules/localization.js'; -import { alertConfirm } from '../../js/modules/alerts.js'; -import { deleteSection } from '../../js/modules/rpc/rpc-content.js'; -import { showToast } from '../../js/modules/toast.js'; -import { reloadPreview } from '../../js/modules/preview.utils.js'; +import { i18n } from '@cms/modules/localization.js'; +import { alertConfirm } from '@cms/modules/alerts.js'; +import { deleteSection } from '@cms/modules/rpc/rpc-content.js'; +import { showToast } from '@cms/modules/toast.js'; +import { reloadPreview } from '@cms/modules/preview.utils.js'; export async function runAction(params) { var confimred = await alertConfirm({ title: i18n.t("filebrowser.delete.confirm.title", "Are you sure?"), diff --git a/modules/ui-module/src/main/resources/manager/actions/page/edit-content.js b/modules/ui-module/src/main/resources/manager/actions/page/edit-content.js index 96d97b90b..0ba9dff58 100644 --- a/modules/ui-module/src/main/resources/manager/actions/page/edit-content.js +++ b/modules/ui-module/src/main/resources/manager/actions/page/edit-content.js @@ -19,12 +19,12 @@ * . * #L% */ -import { openModal } from '../../js/modules/modal.js'; -import { createForm } from '../../js/modules/form/forms.js'; -import { getPreviewUrl, reloadPreview } from '../../js/modules/preview.utils.js'; -import { getContentNode, getContent, setContent } from '../../js/modules/rpc/rpc-content.js'; -import { i18n } from '../../js/modules/localization.js'; -import { showToast } from '../../js/modules/toast.js'; +import { openModal } from '@cms/modules/modal.js'; +import { createForm } from '@cms/modules/form/forms.js'; +import { getPreviewUrl, reloadPreview } from '@cms/modules/preview.utils.js'; +import { getContentNode, getContent, setContent } from '@cms/modules/rpc/rpc-content.js'; +import { i18n } from '@cms/modules/localization.js'; +import { showToast } from '@cms/modules/toast.js'; // hook.js export async function runAction(params) { var uri = null; diff --git a/modules/ui-module/src/main/resources/manager/actions/page/edit-metaattribute-list.js b/modules/ui-module/src/main/resources/manager/actions/page/edit-metaattribute-list.js index f214138a6..5734a66c0 100644 --- a/modules/ui-module/src/main/resources/manager/actions/page/edit-metaattribute-list.js +++ b/modules/ui-module/src/main/resources/manager/actions/page/edit-metaattribute-list.js @@ -19,13 +19,13 @@ * . * #L% */ -import { createForm } from '../../js/modules/form/forms.js'; -import { showToast } from '../../js/modules/toast.js'; -import { getPreviewUrl, reloadPreview } from '../../js/modules/preview.utils.js'; -import { getValueByPath } from '../../js/modules/node.js'; -import { getContentNode, getContent, setMeta } from '../../js/modules/rpc/rpc-content.js'; -import { i18n } from '../../js/modules/localization.js'; -import { openSidebar } from '../../js/modules/sidebar.js'; +import { createForm } from '@cms/modules/form/forms.js'; +import { showToast } from '@cms/modules/toast.js'; +import { getPreviewUrl, reloadPreview } from '@cms/modules/preview.utils.js'; +import { getValueByPath } from '@cms/modules/node.js'; +import { getContentNode, getContent, setMeta } from '@cms/modules/rpc/rpc-content.js'; +import { i18n } from '@cms/modules/localization.js'; +import { openSidebar } from '@cms/modules/sidebar.js'; // hook.js export async function runAction(params) { var uri = null; diff --git a/modules/ui-module/src/main/resources/manager/actions/page/edit-metaattribute.js b/modules/ui-module/src/main/resources/manager/actions/page/edit-metaattribute.js index 001169192..39b1eb2f7 100644 --- a/modules/ui-module/src/main/resources/manager/actions/page/edit-metaattribute.js +++ b/modules/ui-module/src/main/resources/manager/actions/page/edit-metaattribute.js @@ -19,13 +19,13 @@ * . * #L% */ -import { createForm } from '../../js/modules/form/forms.js'; -import { showToast } from '../../js/modules/toast.js'; -import { getPreviewUrl, reloadPreview } from '../../js/modules/preview.utils.js'; -import { getValueByPath } from '../../js/modules/node.js'; -import { getContentNode, setMeta, getContent } from '../../js/modules/rpc/rpc-content.js'; -import { i18n } from '../../js/modules/localization.js'; -import { openSidebar } from '../../js/modules/sidebar.js'; +import { createForm } from '@cms/modules/form/forms.js'; +import { showToast } from '@cms/modules/toast.js'; +import { getPreviewUrl, reloadPreview } from '@cms/modules/preview.utils.js'; +import { getValueByPath } from '@cms/modules/node.js'; +import { getContentNode, setMeta, getContent } from '@cms/modules/rpc/rpc-content.js'; +import { i18n } from '@cms/modules/localization.js'; +import { openSidebar } from '@cms/modules/sidebar.js'; // hook.js export async function runAction(params) { var uri = null; diff --git a/modules/ui-module/src/main/resources/manager/actions/page/edit-page-settings.js b/modules/ui-module/src/main/resources/manager/actions/page/edit-page-settings.js index bb8d7961a..137b52462 100644 --- a/modules/ui-module/src/main/resources/manager/actions/page/edit-page-settings.js +++ b/modules/ui-module/src/main/resources/manager/actions/page/edit-page-settings.js @@ -19,14 +19,14 @@ * . * #L% */ -import { openSidebar } from '../../js/modules/sidebar.js'; -import { createForm } from '../../js/modules/form/forms.js'; -import { showToast } from '../../js/modules/toast.js'; -import { getContentNode, setMeta, getContent } from '../../js/modules/rpc/rpc-content.js'; -import { getPreviewUrl, reloadPreview } from '../../js/modules/preview.utils.js'; -import { i18n } from '../../js/modules/localization.js'; -import { getPageTemplates } from '../../js/modules/rpc/rpc-manager.js'; -import { buildValuesFromFields } from '../../js/modules/node.js'; +import { openSidebar } from '@cms/modules/sidebar.js'; +import { createForm } from '@cms/modules/form/forms.js'; +import { showToast } from '@cms/modules/toast.js'; +import { getContentNode, setMeta, getContent } from '@cms/modules/rpc/rpc-content.js'; +import { getPreviewUrl, reloadPreview } from '@cms/modules/preview.utils.js'; +import { i18n } from '@cms/modules/localization.js'; +import { getPageTemplates } from '@cms/modules/rpc/rpc-manager.js'; +import { buildValuesFromFields } from '@cms/modules/node.js'; const DEFAULT_FIELDS = [ { type: 'text', diff --git a/modules/ui-module/src/main/resources/manager/actions/page/edit-sections.js b/modules/ui-module/src/main/resources/manager/actions/page/edit-sections.js index 7087b5cb2..1872e9228 100644 --- a/modules/ui-module/src/main/resources/manager/actions/page/edit-sections.js +++ b/modules/ui-module/src/main/resources/manager/actions/page/edit-sections.js @@ -19,12 +19,12 @@ * . * #L% */ -import { openModal } from '../../js/modules/modal.js'; -import { showToast } from '../../js/modules/toast.js'; -import { getPreviewUrl, reloadPreview } from '../../js/modules/preview.utils.js'; -import { Sortable } from '../../js/libs/sortablejs.min.js'; -import Handlebars from '../../js/libs/handlebars.min.js'; -import { getContentNode, setMetaBatch } from '../../js/modules/rpc/rpc-content.js'; +import { openModal } from '@cms/modules/modal.js'; +import { showToast } from '@cms/modules/toast.js'; +import { getPreviewUrl, reloadPreview } from '@cms/modules/preview.utils.js'; +import Sortable from 'https://cdn.jsdelivr.net/npm/sortablejs@1.15.6/+esm'; +import Handlebars from 'https://cdn.jsdelivr.net/npm/handlebars@4.7.8/+esm'; +import { getContentNode, setMetaBatch } from '@cms/modules/rpc/rpc-content.js'; // hook.js export async function runAction(params) { const contentNode = await getContentNode({ diff --git a/modules/ui-module/src/main/resources/manager/actions/page/manage-assets.js b/modules/ui-module/src/main/resources/manager/actions/page/manage-assets.js index 304c50623..849f3063b 100644 --- a/modules/ui-module/src/main/resources/manager/actions/page/manage-assets.js +++ b/modules/ui-module/src/main/resources/manager/actions/page/manage-assets.js @@ -19,7 +19,7 @@ * . * #L% */ -import { openFileBrowser } from '../../js/modules/filebrowser.js'; +import { openFileBrowser } from '@cms/modules/filebrowser.js'; // hook.js export async function runAction(params) { openFileBrowser({ diff --git a/modules/ui-module/src/main/resources/manager/actions/page/section-set-published.js b/modules/ui-module/src/main/resources/manager/actions/page/section-set-published.js index b2e8df77c..f8fed62c3 100644 --- a/modules/ui-module/src/main/resources/manager/actions/page/section-set-published.js +++ b/modules/ui-module/src/main/resources/manager/actions/page/section-set-published.js @@ -19,8 +19,8 @@ * . * #L% */ -import { reloadPreview } from "../../js/modules/preview.utils"; -import { setMeta } from "../../js/modules/rpc/rpc-content"; +import { reloadPreview } from "@cms/modules/preview.utils"; +import { setMeta } from "@cms/modules/rpc/rpc-content"; export async function runAction(params) { var request = { uri: params.sectionUri, diff --git a/modules/ui-module/src/main/resources/manager/actions/page/translations.js b/modules/ui-module/src/main/resources/manager/actions/page/translations.js index 19b11e6fb..39d24b579 100644 --- a/modules/ui-module/src/main/resources/manager/actions/page/translations.js +++ b/modules/ui-module/src/main/resources/manager/actions/page/translations.js @@ -19,13 +19,13 @@ * . * #L% */ -import { openFileBrowser } from '../../js/modules/filebrowser.js'; -import { i18n } from '../../js/modules/localization.js'; -import { openModal } from '../../js/modules/modal.js'; -import { getPreviewUrl } from '../../js/modules/preview.utils.js'; -import { getContentNode } from '../../js/modules/rpc/rpc-content.js'; -import { addTranslation, getTranslations } from '../../js/modules/rpc/rpc-translation.js'; -import { showToast } from '../../js/modules/toast.js'; +import { openFileBrowser } from '@cms/modules/filebrowser.js'; +import { i18n } from '@cms/modules/localization.js'; +import { openModal } from '@cms/modules/modal.js'; +import { getPreviewUrl } from '@cms/modules/preview.utils.js'; +import { getContentNode } from '@cms/modules/rpc/rpc-content.js'; +import { addTranslation, getTranslations } from '@cms/modules/rpc/rpc-translation.js'; +import { showToast } from '@cms/modules/toast.js'; // hook.js export async function runAction(params) { const contentNode = await getContentNode({ diff --git a/modules/ui-module/src/main/resources/manager/actions/test-command.js b/modules/ui-module/src/main/resources/manager/actions/test-command.js index 92cc3a2c3..8b3c24377 100644 --- a/modules/ui-module/src/main/resources/manager/actions/test-command.js +++ b/modules/ui-module/src/main/resources/manager/actions/test-command.js @@ -19,8 +19,8 @@ * . * #L% */ -import { executeCommand } from '../../js/modules/system-commands.js'; -import { getPreviewUrl } from '../../js/modules/preview.utils.js'; +import { executeCommand } from '@cms/modules/system-commands.js'; +import { getPreviewUrl } from '@cms/modules/preview.utils.js'; // hook.js export async function runAction(params) { var contentNode = await executeCommand({ diff --git a/modules/ui-module/src/main/resources/manager/index.html b/modules/ui-module/src/main/resources/manager/index.html index ecbd0a03f..9e17778ba 100644 --- a/modules/ui-module/src/main/resources/manager/index.html +++ b/modules/ui-module/src/main/resources/manager/index.html @@ -82,7 +82,8 @@ "@cms/js/": "{{ managerBaseURL }}/js/", "@cms/libs/": "{{ managerBaseURL }}/js/libs/", "@cms/manager/": "{{ managerBaseURL }}/js/manager/", - "@cms/modules/": "{{ managerBaseURL }}/js/modules/" + "@cms/modules/": "{{ managerBaseURL }}/js/modules/", + "condation-cms-ui/dist/js/modules/" : "{{ managerBaseURL }}/js/modules/" } } diff --git a/modules/ui-module/src/main/resources/manager/js/libs/handlebars.min.js b/modules/ui-module/src/main/resources/manager/js/libs/handlebars.min.js deleted file mode 100644 index 7c1004ce7..000000000 --- a/modules/ui-module/src/main/resources/manager/js/libs/handlebars.min.js +++ /dev/null @@ -1,579 +0,0 @@ -/** - * Bundled by jsDelivr using Rollup v2.79.2 and Terser v5.39.0. - * Original file: /npm/handlebars@4.7.8/dist/cjs/handlebars.js - * - * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files - */ -var t = { exports: {} }, e = { exports: {} }, r = {}, s = { __esModule: !0 }; -s.extend = l, s.indexOf = function (t, e) { for (var r = 0, s = t.length; r < s; r++) - if (t[r] === e) - return r; return -1; }, s.escapeExpression = function (t) { if ("string" != typeof t) { - if (t && t.toHTML) - return t.toHTML(); - if (null == t) - return ""; - if (!t) - return t + ""; - t = "" + t; -} if (!o.test(t)) - return t; return t.replace(n, a); }, s.isEmpty = function (t) { return !t && 0 !== t || !(!h(t) || 0 !== t.length); }, s.createFrame = function (t) { var e = l({}, t); return e._parent = t, e; }, s.blockParams = function (t, e) { return t.path = e, t; }, s.appendContextPath = function (t, e) { return (t ? t + "." : "") + e; }; -var i = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'", "`": "`", "=": "=" }, n = /[&<>"'`=]/g, o = /[&<>"'`=]/; -function a(t) { return i[t]; } -function l(t) { for (var e = 1; e < arguments.length; e++) - for (var r in arguments[e]) - Object.prototype.hasOwnProperty.call(arguments[e], r) && (t[r] = arguments[e][r]); return t; } -var c = Object.prototype.toString; -s.toString = c; -var p = function (t) { return "function" == typeof t; }; -p(/x/) && (s.isFunction = p = function (t) { return "function" == typeof t && "[object Function]" === c.call(t); }), s.isFunction = p; -var h = Array.isArray || function (t) { return !(!t || "object" != typeof t) && "[object Array]" === c.call(t); }; -s.isArray = h; -var u = { exports: {} }; -!function (t, e) { e.__esModule = !0; var r = ["description", "fileName", "lineNumber", "endLineNumber", "message", "name", "number", "stack"]; function s(t, e) { var i = e && e.loc, n = void 0, o = void 0, a = void 0, l = void 0; i && (n = i.start.line, o = i.end.line, a = i.start.column, l = i.end.column, t += " - " + n + ":" + a); for (var c = Error.prototype.constructor.call(this, t), p = 0; p < r.length; p++) - this[r[p]] = c[r[p]]; Error.captureStackTrace && Error.captureStackTrace(this, s); try { - i && (this.lineNumber = n, this.endLineNumber = o, Object.defineProperty ? (Object.defineProperty(this, "column", { value: a, enumerable: !0 }), Object.defineProperty(this, "endColumn", { value: l, enumerable: !0 })) : (this.column = a, this.endColumn = l)); -} -catch (t) { } } s.prototype = new Error, e.default = s, t.exports = e.default; }(u, u.exports); -var f = {}, d = { exports: {} }; -!function (t, e) { e.__esModule = !0; var r = s; e.default = function (t) { t.registerHelper("blockHelperMissing", (function (e, s) { var i = s.inverse, n = s.fn; if (!0 === e) - return n(this); if (!1 === e || null == e) - return i(this); if (r.isArray(e)) - return e.length > 0 ? (s.ids && (s.ids = [s.name]), t.helpers.each(e, s)) : i(this); if (s.data && s.ids) { - var o = r.createFrame(s.data); - o.contextPath = r.appendContextPath(s.data.contextPath, s.name), s = { data: o }; -} return n(e, s); })); }, t.exports = e.default; }(d, d.exports); -var m = { exports: {} }; -!function (t, e) { e.__esModule = !0; var r, i = s, n = (r = u.exports) && r.__esModule ? r : { default: r }; e.default = function (t) { t.registerHelper("each", (function (t, e) { if (!e) - throw new n.default("Must pass iterator to #each"); var r, s = e.fn, o = e.inverse, a = 0, l = "", c = void 0, p = void 0; function h(e, r, n) { c && (c.key = e, c.index = r, c.first = 0 === r, c.last = !!n, p && (c.contextPath = p + e)), l += s(t[e], { data: c, blockParams: i.blockParams([t[e], e], [p + e, null]) }); } if (e.data && e.ids && (p = i.appendContextPath(e.data.contextPath, e.ids[0]) + "."), i.isFunction(t) && (t = t.call(this)), e.data && (c = i.createFrame(e.data)), t && "object" == typeof t) - if (i.isArray(t)) - for (var u = t.length; a < u; a++) - a in t && h(a, a, a === t.length - 1); - else if ("function" == typeof Symbol && t[Symbol.iterator]) { - for (var f = [], d = t[Symbol.iterator](), m = d.next(); !m.done; m = d.next()) - f.push(m.value); - for (u = (t = f).length; a < u; a++) - h(a, a, a === t.length - 1); - } - else - r = void 0, Object.keys(t).forEach((function (t) { void 0 !== r && h(r, a - 1), r = t, a++; })), void 0 !== r && h(r, a - 1, !0); return 0 === a && (l = o(this)), l; })); }, t.exports = e.default; }(m, m.exports); -var g = { exports: {} }; -!function (t, e) { e.__esModule = !0; var r, s = (r = u.exports) && r.__esModule ? r : { default: r }; e.default = function (t) { t.registerHelper("helperMissing", (function () { if (1 !== arguments.length) - throw new s.default('Missing helper: "' + arguments[arguments.length - 1].name + '"'); })); }, t.exports = e.default; }(g, g.exports); -var v = { exports: {} }; -!function (t, e) { e.__esModule = !0; var r, i = s, n = (r = u.exports) && r.__esModule ? r : { default: r }; e.default = function (t) { t.registerHelper("if", (function (t, e) { if (2 != arguments.length) - throw new n.default("#if requires exactly one argument"); return i.isFunction(t) && (t = t.call(this)), !e.hash.includeZero && !t || i.isEmpty(t) ? e.inverse(this) : e.fn(this); })), t.registerHelper("unless", (function (e, r) { if (2 != arguments.length) - throw new n.default("#unless requires exactly one argument"); return t.helpers.if.call(this, e, { fn: r.inverse, inverse: r.fn, hash: r.hash }); })); }, t.exports = e.default; }(v, v.exports); -var y, k, _ = { exports: {} }; -y = _, (k = _.exports).__esModule = !0, k.default = function (t) { t.registerHelper("log", (function () { for (var e = [void 0], r = arguments[arguments.length - 1], s = 0; s < arguments.length - 1; s++) - e.push(arguments[s]); var i = 1; null != r.hash.level ? i = r.hash.level : r.data && null != r.data.level && (i = r.data.level), e[0] = i, t.log.apply(t, e); })); }, y.exports = k.default; -var S = { exports: {} }; -!function (t, e) { e.__esModule = !0, e.default = function (t) { t.registerHelper("lookup", (function (t, e, r) { return t ? r.lookupProperty(t, e) : t; })); }, t.exports = e.default; }(S, S.exports); -var x = { exports: {} }; -function P(t) { return t && t.__esModule ? t : { default: t }; } -!function (t, e) { e.__esModule = !0; var r, i = s, n = (r = u.exports) && r.__esModule ? r : { default: r }; e.default = function (t) { t.registerHelper("with", (function (t, e) { if (2 != arguments.length) - throw new n.default("#with requires exactly one argument"); i.isFunction(t) && (t = t.call(this)); var r = e.fn; if (i.isEmpty(t)) - return e.inverse(this); var s = e.data; return e.data && e.ids && ((s = i.createFrame(e.data)).contextPath = i.appendContextPath(e.data.contextPath, e.ids[0])), r(t, { data: s, blockParams: i.blockParams([t], [s && s.contextPath]) }); })); }, t.exports = e.default; }(x, x.exports), f.__esModule = !0, f.registerDefaultHelpers = function (t) { b.default(t), w.default(t), E.default(t), L.default(t), C.default(t), I.default(t), O.default(t); }, f.moveHelperToHooks = function (t, e, r) { t.helpers[e] && (t.hooks[e] = t.helpers[e], r || delete t.helpers[e]); }; -var b = P(d.exports), w = P(m.exports), E = P(g.exports), L = P(v.exports), C = P(_.exports), I = P(S.exports), O = P(x.exports); -var N = {}, A = { exports: {} }; -!function (t, e) { e.__esModule = !0; var r = s; e.default = function (t) { t.registerDecorator("inline", (function (t, e, s, i) { var n = t; return e.partials || (e.partials = {}, n = function (i, n) { var o = s.partials; s.partials = r.extend({}, o, e.partials); var a = t(i, n); return s.partials = o, a; }), e.partials[i.args[0]] = i.fn, n; })); }, t.exports = e.default; }(A, A.exports), N.__esModule = !0, N.registerDefaultDecorators = function (t) { B.default(t); }; -var M, B = (M = A.exports) && M.__esModule ? M : { default: M }; -var D = { exports: {} }; -!function (t, e) { e.__esModule = !0; var r = s, i = { methodMap: ["debug", "info", "warn", "error"], level: "info", lookupLevel: function (t) { if ("string" == typeof t) { - var e = r.indexOf(i.methodMap, t.toLowerCase()); - t = e >= 0 ? e : parseInt(t, 10); - } return t; }, log: function (t) { if (t = i.lookupLevel(t), "undefined" != typeof console && i.lookupLevel(i.level) <= t) { - var e = i.methodMap[t]; - console[e] || (e = "log"); - for (var r = arguments.length, s = Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++) - s[n - 1] = arguments[n]; - console[e].apply(console, s); - } } }; e.default = i, t.exports = e.default; }(D, D.exports); -var H = {}, $ = { __esModule: !0, createNewLookupObject: function () { for (var t = arguments.length, e = Array(t), r = 0; r < t; r++) - e[r] = arguments[r]; return R.extend.apply(void 0, [Object.create(null)].concat(e)); } }, R = s; -H.__esModule = !0, H.createProtoAccessControl = function (t) { var e = Object.create(null); e.constructor = !1, e.__defineGetter__ = !1, e.__defineSetter__ = !1, e.__lookupGetter__ = !1; var r = Object.create(null); return r.__proto__ = !1, { properties: { whitelist: j.createNewLookupObject(r, t.allowedProtoProperties), defaultValue: t.allowProtoPropertiesByDefault }, methods: { whitelist: j.createNewLookupObject(e, t.allowedProtoMethods), defaultValue: t.allowProtoMethodsByDefault } }; }, H.resultIsAllowed = function (t, e, r) { return V("function" == typeof t ? e.methods : e.properties, r); }, H.resetLoggedProperties = function () { Object.keys(F).forEach((function (t) { delete F[t]; })); }; -var j = $, T = function (t) { return t && t.__esModule ? t : { default: t }; }(D.exports), F = Object.create(null); -function V(t, e) { return void 0 !== t.whitelist[e] ? !0 === t.whitelist[e] : void 0 !== t.defaultValue ? t.defaultValue : (function (t) { !0 !== F[t] && (F[t] = !0, T.default.log("error", 'Handlebars: Access has been denied to resolve the property "' + t + '" because it is not an "own property" of its parent.\nYou can add a runtime option to disable the check or this warning:\nSee https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details')); }(e), !1); } -function K(t) { return t && t.__esModule ? t : { default: t }; } -r.__esModule = !0, r.HandlebarsEnvironment = X; -var U = s, q = K(u.exports), W = f, J = N, G = K(D.exports), z = H; -r.VERSION = "4.7.8"; -r.COMPILER_REVISION = 8; -r.LAST_COMPATIBLE_COMPILER_REVISION = 7; -r.REVISION_CHANGES = { 1: "<= 1.0.rc.2", 2: "== 1.0.0-rc.3", 3: "== 1.0.0-rc.4", 4: "== 1.x.x", 5: "== 2.0.0-alpha.x", 6: ">= 2.0.0-beta.1", 7: ">= 4.0.0 <4.3.0", 8: ">= 4.3.0" }; -var Y = "[object Object]"; -function X(t, e, r) { this.helpers = t || {}, this.partials = e || {}, this.decorators = r || {}, W.registerDefaultHelpers(this), J.registerDefaultDecorators(this); } -X.prototype = { constructor: X, logger: G.default, log: G.default.log, registerHelper: function (t, e) { if (U.toString.call(t) === Y) { - if (e) - throw new q.default("Arg not supported with multiple helpers"); - U.extend(this.helpers, t); - } - else - this.helpers[t] = e; }, unregisterHelper: function (t) { delete this.helpers[t]; }, registerPartial: function (t, e) { if (U.toString.call(t) === Y) - U.extend(this.partials, t); - else { - if (void 0 === e) - throw new q.default('Attempting to register a partial called "' + t + '" as undefined'); - this.partials[t] = e; - } }, unregisterPartial: function (t) { delete this.partials[t]; }, registerDecorator: function (t, e) { if (U.toString.call(t) === Y) { - if (e) - throw new q.default("Arg not supported with multiple decorators"); - U.extend(this.decorators, t); - } - else - this.decorators[t] = e; }, unregisterDecorator: function (t) { delete this.decorators[t]; }, resetLoggedPropertyAccesses: function () { z.resetLoggedProperties(); } }; -var Z = G.default.log; -r.log = Z, r.createFrame = U.createFrame, r.logger = G.default; -var Q = { exports: {} }; -!function (t, e) { function r(t) { this.string = t; } e.__esModule = !0, r.prototype.toString = r.prototype.toHTML = function () { return "" + this.string; }, e.default = r, t.exports = e.default; }(Q, Q.exports); -var tt = {}, et = {}; -et.__esModule = !0, et.wrapHelper = function (t, e) { if ("function" != typeof t) - return t; return function () { return arguments[arguments.length - 1] = e(arguments[arguments.length - 1]), t.apply(this, arguments); }; }, tt.__esModule = !0, tt.checkRevision = function (t) { var e = t && t[0] || 1, r = it.COMPILER_REVISION; if (e >= it.LAST_COMPATIBLE_COMPILER_REVISION && e <= it.COMPILER_REVISION) - return; if (e < it.LAST_COMPATIBLE_COMPILER_REVISION) { - var s = it.REVISION_CHANGES[r], i = it.REVISION_CHANGES[e]; - throw new st.default("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version (" + s + ") or downgrade your runtime to an older version (" + i + ")."); -} throw new st.default("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version (" + t[1] + ")."); }, tt.template = function (t, e) { if (!e) - throw new st.default("No environment passed to template"); if (!t || !t.main) - throw new st.default("Unknown template object: " + typeof t); t.main.decorator = t.main_d, e.VM.checkRevision(t.compiler); var r = t.compiler && 7 === t.compiler[0]; var s = { strict: function (t, e, r) { if (!t || !(e in t)) - throw new st.default('"' + e + '" not defined in ' + t, { loc: r }); return s.lookupProperty(t, e); }, lookupProperty: function (t, e) { var r = t[e]; return null == r || Object.prototype.hasOwnProperty.call(t, e) || at.resultIsAllowed(r, s.protoAccessControl, e) ? r : void 0; }, lookup: function (t, e) { for (var r = t.length, i = 0; i < r; i++) { - if (null != (t[i] && s.lookupProperty(t[i], e))) - return t[i][e]; - } }, lambda: function (t, e) { return "function" == typeof t ? t.call(e) : t; }, escapeExpression: rt.escapeExpression, invokePartial: function (r, s, i) { i.hash && (s = rt.extend({}, s, i.hash), i.ids && (i.ids[0] = !0)), r = e.VM.resolvePartial.call(this, r, s, i); var n = rt.extend({}, i, { hooks: this.hooks, protoAccessControl: this.protoAccessControl }), o = e.VM.invokePartial.call(this, r, s, n); if (null == o && e.compile && (i.partials[i.name] = e.compile(r, t.compilerOptions, e), o = i.partials[i.name](s, n)), null != o) { - if (i.indent) { - for (var a = o.split("\n"), l = 0, c = a.length; l < c && (a[l] || l + 1 !== c); l++) - a[l] = i.indent + a[l]; - o = a.join("\n"); - } - return o; - } throw new st.default("The partial " + i.name + " could not be compiled when running in runtime-only mode"); }, fn: function (e) { var r = t[e]; return r.decorator = t[e + "_d"], r; }, programs: [], program: function (t, e, r, s, i) { var n = this.programs[t], o = this.fn(t); return e || i || s || r ? n = lt(this, t, o, e, r, s, i) : n || (n = this.programs[t] = lt(this, t, o)), n; }, data: function (t, e) { for (; t && e--;) - t = t._parent; return t; }, mergeIfNeeded: function (t, e) { var r = t || e; return t && e && t !== e && (r = rt.extend({}, e, t)), r; }, nullContext: Object.seal({}), noop: e.VM.noop, compilerInfo: t.compiler }; function i(e) { var r = arguments.length <= 1 || void 0 === arguments[1] ? {} : arguments[1], n = r.data; i._setup(r), !r.partial && t.useData && (n = function (t, e) { e && "root" in e || ((e = e ? it.createFrame(e) : {}).root = t); return e; }(e, n)); var o = void 0, a = t.useBlockParams ? [] : void 0; function l(e) { return "" + t.main(s, e, s.helpers, s.partials, n, a, o); } return t.useDepths && (o = r.depths ? e != r.depths[0] ? [e].concat(r.depths) : r.depths : [e]), (l = pt(t.main, l, s, r.depths || [], n, a))(e, r); } return i.isTop = !0, i._setup = function (i) { if (i.partial) - s.protoAccessControl = i.protoAccessControl, s.helpers = i.helpers, s.partials = i.partials, s.decorators = i.decorators, s.hooks = i.hooks; -else { - var n = rt.extend({}, e.helpers, i.helpers); - !function (t, e) { Object.keys(t).forEach((function (r) { var s = t[r]; t[r] = function (t, e) { var r = e.lookupProperty; return ot.wrapHelper(t, (function (t) { return rt.extend({ lookupProperty: r }, t); })); }(s, e); })); }(n, s), s.helpers = n, t.usePartial && (s.partials = s.mergeIfNeeded(i.partials, e.partials)), (t.usePartial || t.useDecorators) && (s.decorators = rt.extend({}, e.decorators, i.decorators)), s.hooks = {}, s.protoAccessControl = at.createProtoAccessControl(i); - var o = i.allowCallsToHelperMissing || r; - nt.moveHelperToHooks(s, "helperMissing", o), nt.moveHelperToHooks(s, "blockHelperMissing", o); -} }, i._child = function (e, r, i, n) { if (t.useBlockParams && !i) - throw new st.default("must pass block params"); if (t.useDepths && !n) - throw new st.default("must pass parent depths"); return lt(s, e, t[e], r, 0, i, n); }, i; }, tt.wrapProgram = lt, tt.resolvePartial = function (t, e, r) { t ? t.call || r.name || (r.name = t, t = r.partials[t]) : t = "@partial-block" === r.name ? r.data["partial-block"] : r.partials[r.name]; return t; }, tt.invokePartial = function (t, e, r) { var s = r.data && r.data["partial-block"]; r.partial = !0, r.ids && (r.data.contextPath = r.ids[0] || r.data.contextPath); var i = void 0; r.fn && r.fn !== ct && function () { r.data = it.createFrame(r.data); var t = r.fn; i = r.data["partial-block"] = function (e) { var r = arguments.length <= 1 || void 0 === arguments[1] ? {} : arguments[1]; return r.data = it.createFrame(r.data), r.data["partial-block"] = s, t(e, r); }, t.partials && (r.partials = rt.extend({}, r.partials, t.partials)); }(); void 0 === t && i && (t = i); if (void 0 === t) - throw new st.default("The partial " + r.name + " could not be found"); if (t instanceof Function) - return t(e, r); }, tt.noop = ct; -var rt = function (t) { if (t && t.__esModule) - return t; var e = {}; if (null != t) - for (var r in t) - Object.prototype.hasOwnProperty.call(t, r) && (e[r] = t[r]); return e.default = t, e; }(s), st = function (t) { return t && t.__esModule ? t : { default: t }; }(u.exports), it = r, nt = f, ot = et, at = H; -function lt(t, e, r, s, i, n, o) { function a(e) { var i = arguments.length <= 1 || void 0 === arguments[1] ? {} : arguments[1], a = o; return !o || e == o[0] || e === t.nullContext && null === o[0] || (a = [e].concat(o)), r(t, e, t.helpers, t.partials, i.data || s, n && [i.blockParams].concat(n), a); } return (a = pt(r, a, t, o, s, n)).program = e, a.depth = o ? o.length : 0, a.blockParams = i || 0, a; } -function ct() { return ""; } -function pt(t, e, r, s, i, n) { if (t.decorator) { - var o = {}; - e = t.decorator(e, o, r, s && s[0], i, n, s), rt.extend(e, o); -} return e; } -var ht = { exports: {} }; -!function (t, e) { e.__esModule = !0, e.default = function (t) { "object" != typeof globalThis && (Object.prototype.__defineGetter__("__magic__", (function () { return this; })), __magic__.globalThis = __magic__, delete Object.prototype.__magic__); var e = globalThis.Handlebars; t.noConflict = function () { return globalThis.Handlebars === t && (globalThis.Handlebars = e), t; }; }, t.exports = e.default; }(ht, ht.exports), function (t, e) { function i(t) { return t && t.__esModule ? t : { default: t }; } function n(t) { if (t && t.__esModule) - return t; var e = {}; if (null != t) - for (var r in t) - Object.prototype.hasOwnProperty.call(t, r) && (e[r] = t[r]); return e.default = t, e; } e.__esModule = !0; var o = n(r), a = i(Q.exports), l = i(u.exports), c = n(s), p = n(tt), h = i(ht.exports); function f() { var t = new o.HandlebarsEnvironment; return c.extend(t, o), t.SafeString = a.default, t.Exception = l.default, t.Utils = c, t.escapeExpression = c.escapeExpression, t.VM = p, t.template = function (e) { return p.template(e, t); }, t; } var d = f(); d.create = f, h.default(d), d.default = d, e.default = d, t.exports = e.default; }(e, e.exports); -var ut = { exports: {} }; -!function (t, e) { e.__esModule = !0; var r = { helpers: { helperExpression: function (t) { return "SubExpression" === t.type || ("MustacheStatement" === t.type || "BlockStatement" === t.type) && !!(t.params && t.params.length || t.hash); }, scopedId: function (t) { return /^\.|this\b/.test(t.original); }, simpleId: function (t) { return 1 === t.parts.length && !r.helpers.scopedId(t) && !t.depth; } } }; e.default = r, t.exports = e.default; }(ut, ut.exports); -var ft = {}, dt = { exports: {} }; -!function (t, e) { e.__esModule = !0; var r = function () { var t = { trace: function () { }, yy: {}, symbols_: { error: 2, root: 3, program: 4, EOF: 5, program_repetition0: 6, statement: 7, mustache: 8, block: 9, rawBlock: 10, partial: 11, partialBlock: 12, content: 13, COMMENT: 14, CONTENT: 15, openRawBlock: 16, rawBlock_repetition0: 17, END_RAW_BLOCK: 18, OPEN_RAW_BLOCK: 19, helperName: 20, openRawBlock_repetition0: 21, openRawBlock_option0: 22, CLOSE_RAW_BLOCK: 23, openBlock: 24, block_option0: 25, closeBlock: 26, openInverse: 27, block_option1: 28, OPEN_BLOCK: 29, openBlock_repetition0: 30, openBlock_option0: 31, openBlock_option1: 32, CLOSE: 33, OPEN_INVERSE: 34, openInverse_repetition0: 35, openInverse_option0: 36, openInverse_option1: 37, openInverseChain: 38, OPEN_INVERSE_CHAIN: 39, openInverseChain_repetition0: 40, openInverseChain_option0: 41, openInverseChain_option1: 42, inverseAndProgram: 43, INVERSE: 44, inverseChain: 45, inverseChain_option0: 46, OPEN_ENDBLOCK: 47, OPEN: 48, mustache_repetition0: 49, mustache_option0: 50, OPEN_UNESCAPED: 51, mustache_repetition1: 52, mustache_option1: 53, CLOSE_UNESCAPED: 54, OPEN_PARTIAL: 55, partialName: 56, partial_repetition0: 57, partial_option0: 58, openPartialBlock: 59, OPEN_PARTIAL_BLOCK: 60, openPartialBlock_repetition0: 61, openPartialBlock_option0: 62, param: 63, sexpr: 64, OPEN_SEXPR: 65, sexpr_repetition0: 66, sexpr_option0: 67, CLOSE_SEXPR: 68, hash: 69, hash_repetition_plus0: 70, hashSegment: 71, ID: 72, EQUALS: 73, blockParams: 74, OPEN_BLOCK_PARAMS: 75, blockParams_repetition_plus0: 76, CLOSE_BLOCK_PARAMS: 77, path: 78, dataName: 79, STRING: 80, NUMBER: 81, BOOLEAN: 82, UNDEFINED: 83, NULL: 84, DATA: 85, pathSegments: 86, SEP: 87, $accept: 0, $end: 1 }, terminals_: { 2: "error", 5: "EOF", 14: "COMMENT", 15: "CONTENT", 18: "END_RAW_BLOCK", 19: "OPEN_RAW_BLOCK", 23: "CLOSE_RAW_BLOCK", 29: "OPEN_BLOCK", 33: "CLOSE", 34: "OPEN_INVERSE", 39: "OPEN_INVERSE_CHAIN", 44: "INVERSE", 47: "OPEN_ENDBLOCK", 48: "OPEN", 51: "OPEN_UNESCAPED", 54: "CLOSE_UNESCAPED", 55: "OPEN_PARTIAL", 60: "OPEN_PARTIAL_BLOCK", 65: "OPEN_SEXPR", 68: "CLOSE_SEXPR", 72: "ID", 73: "EQUALS", 75: "OPEN_BLOCK_PARAMS", 77: "CLOSE_BLOCK_PARAMS", 80: "STRING", 81: "NUMBER", 82: "BOOLEAN", 83: "UNDEFINED", 84: "NULL", 85: "DATA", 87: "SEP" }, productions_: [0, [3, 2], [4, 1], [7, 1], [7, 1], [7, 1], [7, 1], [7, 1], [7, 1], [7, 1], [13, 1], [10, 3], [16, 5], [9, 4], [9, 4], [24, 6], [27, 6], [38, 6], [43, 2], [45, 3], [45, 1], [26, 3], [8, 5], [8, 5], [11, 5], [12, 3], [59, 5], [63, 1], [63, 1], [64, 5], [69, 1], [71, 3], [74, 3], [20, 1], [20, 1], [20, 1], [20, 1], [20, 1], [20, 1], [20, 1], [56, 1], [56, 1], [79, 2], [78, 1], [86, 3], [86, 1], [6, 0], [6, 2], [17, 0], [17, 2], [21, 0], [21, 2], [22, 0], [22, 1], [25, 0], [25, 1], [28, 0], [28, 1], [30, 0], [30, 2], [31, 0], [31, 1], [32, 0], [32, 1], [35, 0], [35, 2], [36, 0], [36, 1], [37, 0], [37, 1], [40, 0], [40, 2], [41, 0], [41, 1], [42, 0], [42, 1], [46, 0], [46, 1], [49, 0], [49, 2], [50, 0], [50, 1], [52, 0], [52, 2], [53, 0], [53, 1], [57, 0], [57, 2], [58, 0], [58, 1], [61, 0], [61, 2], [62, 0], [62, 1], [66, 0], [66, 2], [67, 0], [67, 1], [70, 1], [70, 2], [76, 1], [76, 2]], performAction: function (t, e, r, s, i, n, o) { var a = n.length - 1; switch (i) { - case 1: return n[a - 1]; - case 2: - this.$ = s.prepareProgram(n[a]); - break; - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 20: - case 27: - case 28: - case 33: - case 34: - case 40: - case 41: - this.$ = n[a]; - break; - case 9: - this.$ = { type: "CommentStatement", value: s.stripComment(n[a]), strip: s.stripFlags(n[a], n[a]), loc: s.locInfo(this._$) }; - break; - case 10: - this.$ = { type: "ContentStatement", original: n[a], value: n[a], loc: s.locInfo(this._$) }; - break; - case 11: - this.$ = s.prepareRawBlock(n[a - 2], n[a - 1], n[a], this._$); - break; - case 12: - this.$ = { path: n[a - 3], params: n[a - 2], hash: n[a - 1] }; - break; - case 13: - this.$ = s.prepareBlock(n[a - 3], n[a - 2], n[a - 1], n[a], !1, this._$); - break; - case 14: - this.$ = s.prepareBlock(n[a - 3], n[a - 2], n[a - 1], n[a], !0, this._$); - break; - case 15: - this.$ = { open: n[a - 5], path: n[a - 4], params: n[a - 3], hash: n[a - 2], blockParams: n[a - 1], strip: s.stripFlags(n[a - 5], n[a]) }; - break; - case 16: - case 17: - this.$ = { path: n[a - 4], params: n[a - 3], hash: n[a - 2], blockParams: n[a - 1], strip: s.stripFlags(n[a - 5], n[a]) }; - break; - case 18: - this.$ = { strip: s.stripFlags(n[a - 1], n[a - 1]), program: n[a] }; - break; - case 19: - var l = s.prepareBlock(n[a - 2], n[a - 1], n[a], n[a], !1, this._$), c = s.prepareProgram([l], n[a - 1].loc); - c.chained = !0, this.$ = { strip: n[a - 2].strip, program: c, chain: !0 }; - break; - case 21: - this.$ = { path: n[a - 1], strip: s.stripFlags(n[a - 2], n[a]) }; - break; - case 22: - case 23: - this.$ = s.prepareMustache(n[a - 3], n[a - 2], n[a - 1], n[a - 4], s.stripFlags(n[a - 4], n[a]), this._$); - break; - case 24: - this.$ = { type: "PartialStatement", name: n[a - 3], params: n[a - 2], hash: n[a - 1], indent: "", strip: s.stripFlags(n[a - 4], n[a]), loc: s.locInfo(this._$) }; - break; - case 25: - this.$ = s.preparePartialBlock(n[a - 2], n[a - 1], n[a], this._$); - break; - case 26: - this.$ = { path: n[a - 3], params: n[a - 2], hash: n[a - 1], strip: s.stripFlags(n[a - 4], n[a]) }; - break; - case 29: - this.$ = { type: "SubExpression", path: n[a - 3], params: n[a - 2], hash: n[a - 1], loc: s.locInfo(this._$) }; - break; - case 30: - this.$ = { type: "Hash", pairs: n[a], loc: s.locInfo(this._$) }; - break; - case 31: - this.$ = { type: "HashPair", key: s.id(n[a - 2]), value: n[a], loc: s.locInfo(this._$) }; - break; - case 32: - this.$ = s.id(n[a - 1]); - break; - case 35: - this.$ = { type: "StringLiteral", value: n[a], original: n[a], loc: s.locInfo(this._$) }; - break; - case 36: - this.$ = { type: "NumberLiteral", value: Number(n[a]), original: Number(n[a]), loc: s.locInfo(this._$) }; - break; - case 37: - this.$ = { type: "BooleanLiteral", value: "true" === n[a], original: "true" === n[a], loc: s.locInfo(this._$) }; - break; - case 38: - this.$ = { type: "UndefinedLiteral", original: void 0, value: void 0, loc: s.locInfo(this._$) }; - break; - case 39: - this.$ = { type: "NullLiteral", original: null, value: null, loc: s.locInfo(this._$) }; - break; - case 42: - this.$ = s.preparePath(!0, n[a], this._$); - break; - case 43: - this.$ = s.preparePath(!1, n[a], this._$); - break; - case 44: - n[a - 2].push({ part: s.id(n[a]), original: n[a], separator: n[a - 1] }), this.$ = n[a - 2]; - break; - case 45: - this.$ = [{ part: s.id(n[a]), original: n[a] }]; - break; - case 46: - case 48: - case 50: - case 58: - case 64: - case 70: - case 78: - case 82: - case 86: - case 90: - case 94: - this.$ = []; - break; - case 47: - case 49: - case 51: - case 59: - case 65: - case 71: - case 79: - case 83: - case 87: - case 91: - case 95: - case 99: - case 101: - n[a - 1].push(n[a]); - break; - case 98: - case 100: this.$ = [n[a]]; - } }, table: [{ 3: 1, 4: 2, 5: [2, 46], 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 1: [3] }, { 5: [1, 4] }, { 5: [2, 2], 7: 5, 8: 6, 9: 7, 10: 8, 11: 9, 12: 10, 13: 11, 14: [1, 12], 15: [1, 20], 16: 17, 19: [1, 23], 24: 15, 27: 16, 29: [1, 21], 34: [1, 22], 39: [2, 2], 44: [2, 2], 47: [2, 2], 48: [1, 13], 51: [1, 14], 55: [1, 18], 59: 19, 60: [1, 24] }, { 1: [2, 1] }, { 5: [2, 47], 14: [2, 47], 15: [2, 47], 19: [2, 47], 29: [2, 47], 34: [2, 47], 39: [2, 47], 44: [2, 47], 47: [2, 47], 48: [2, 47], 51: [2, 47], 55: [2, 47], 60: [2, 47] }, { 5: [2, 3], 14: [2, 3], 15: [2, 3], 19: [2, 3], 29: [2, 3], 34: [2, 3], 39: [2, 3], 44: [2, 3], 47: [2, 3], 48: [2, 3], 51: [2, 3], 55: [2, 3], 60: [2, 3] }, { 5: [2, 4], 14: [2, 4], 15: [2, 4], 19: [2, 4], 29: [2, 4], 34: [2, 4], 39: [2, 4], 44: [2, 4], 47: [2, 4], 48: [2, 4], 51: [2, 4], 55: [2, 4], 60: [2, 4] }, { 5: [2, 5], 14: [2, 5], 15: [2, 5], 19: [2, 5], 29: [2, 5], 34: [2, 5], 39: [2, 5], 44: [2, 5], 47: [2, 5], 48: [2, 5], 51: [2, 5], 55: [2, 5], 60: [2, 5] }, { 5: [2, 6], 14: [2, 6], 15: [2, 6], 19: [2, 6], 29: [2, 6], 34: [2, 6], 39: [2, 6], 44: [2, 6], 47: [2, 6], 48: [2, 6], 51: [2, 6], 55: [2, 6], 60: [2, 6] }, { 5: [2, 7], 14: [2, 7], 15: [2, 7], 19: [2, 7], 29: [2, 7], 34: [2, 7], 39: [2, 7], 44: [2, 7], 47: [2, 7], 48: [2, 7], 51: [2, 7], 55: [2, 7], 60: [2, 7] }, { 5: [2, 8], 14: [2, 8], 15: [2, 8], 19: [2, 8], 29: [2, 8], 34: [2, 8], 39: [2, 8], 44: [2, 8], 47: [2, 8], 48: [2, 8], 51: [2, 8], 55: [2, 8], 60: [2, 8] }, { 5: [2, 9], 14: [2, 9], 15: [2, 9], 19: [2, 9], 29: [2, 9], 34: [2, 9], 39: [2, 9], 44: [2, 9], 47: [2, 9], 48: [2, 9], 51: [2, 9], 55: [2, 9], 60: [2, 9] }, { 20: 25, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 36, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 4: 37, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 39: [2, 46], 44: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 4: 38, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 44: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 15: [2, 48], 17: 39, 18: [2, 48] }, { 20: 41, 56: 40, 64: 42, 65: [1, 43], 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 4: 44, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 5: [2, 10], 14: [2, 10], 15: [2, 10], 18: [2, 10], 19: [2, 10], 29: [2, 10], 34: [2, 10], 39: [2, 10], 44: [2, 10], 47: [2, 10], 48: [2, 10], 51: [2, 10], 55: [2, 10], 60: [2, 10] }, { 20: 45, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 46, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 47, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 41, 56: 48, 64: 42, 65: [1, 43], 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 33: [2, 78], 49: 49, 65: [2, 78], 72: [2, 78], 80: [2, 78], 81: [2, 78], 82: [2, 78], 83: [2, 78], 84: [2, 78], 85: [2, 78] }, { 23: [2, 33], 33: [2, 33], 54: [2, 33], 65: [2, 33], 68: [2, 33], 72: [2, 33], 75: [2, 33], 80: [2, 33], 81: [2, 33], 82: [2, 33], 83: [2, 33], 84: [2, 33], 85: [2, 33] }, { 23: [2, 34], 33: [2, 34], 54: [2, 34], 65: [2, 34], 68: [2, 34], 72: [2, 34], 75: [2, 34], 80: [2, 34], 81: [2, 34], 82: [2, 34], 83: [2, 34], 84: [2, 34], 85: [2, 34] }, { 23: [2, 35], 33: [2, 35], 54: [2, 35], 65: [2, 35], 68: [2, 35], 72: [2, 35], 75: [2, 35], 80: [2, 35], 81: [2, 35], 82: [2, 35], 83: [2, 35], 84: [2, 35], 85: [2, 35] }, { 23: [2, 36], 33: [2, 36], 54: [2, 36], 65: [2, 36], 68: [2, 36], 72: [2, 36], 75: [2, 36], 80: [2, 36], 81: [2, 36], 82: [2, 36], 83: [2, 36], 84: [2, 36], 85: [2, 36] }, { 23: [2, 37], 33: [2, 37], 54: [2, 37], 65: [2, 37], 68: [2, 37], 72: [2, 37], 75: [2, 37], 80: [2, 37], 81: [2, 37], 82: [2, 37], 83: [2, 37], 84: [2, 37], 85: [2, 37] }, { 23: [2, 38], 33: [2, 38], 54: [2, 38], 65: [2, 38], 68: [2, 38], 72: [2, 38], 75: [2, 38], 80: [2, 38], 81: [2, 38], 82: [2, 38], 83: [2, 38], 84: [2, 38], 85: [2, 38] }, { 23: [2, 39], 33: [2, 39], 54: [2, 39], 65: [2, 39], 68: [2, 39], 72: [2, 39], 75: [2, 39], 80: [2, 39], 81: [2, 39], 82: [2, 39], 83: [2, 39], 84: [2, 39], 85: [2, 39] }, { 23: [2, 43], 33: [2, 43], 54: [2, 43], 65: [2, 43], 68: [2, 43], 72: [2, 43], 75: [2, 43], 80: [2, 43], 81: [2, 43], 82: [2, 43], 83: [2, 43], 84: [2, 43], 85: [2, 43], 87: [1, 50] }, { 72: [1, 35], 86: 51 }, { 23: [2, 45], 33: [2, 45], 54: [2, 45], 65: [2, 45], 68: [2, 45], 72: [2, 45], 75: [2, 45], 80: [2, 45], 81: [2, 45], 82: [2, 45], 83: [2, 45], 84: [2, 45], 85: [2, 45], 87: [2, 45] }, { 52: 52, 54: [2, 82], 65: [2, 82], 72: [2, 82], 80: [2, 82], 81: [2, 82], 82: [2, 82], 83: [2, 82], 84: [2, 82], 85: [2, 82] }, { 25: 53, 38: 55, 39: [1, 57], 43: 56, 44: [1, 58], 45: 54, 47: [2, 54] }, { 28: 59, 43: 60, 44: [1, 58], 47: [2, 56] }, { 13: 62, 15: [1, 20], 18: [1, 61] }, { 33: [2, 86], 57: 63, 65: [2, 86], 72: [2, 86], 80: [2, 86], 81: [2, 86], 82: [2, 86], 83: [2, 86], 84: [2, 86], 85: [2, 86] }, { 33: [2, 40], 65: [2, 40], 72: [2, 40], 80: [2, 40], 81: [2, 40], 82: [2, 40], 83: [2, 40], 84: [2, 40], 85: [2, 40] }, { 33: [2, 41], 65: [2, 41], 72: [2, 41], 80: [2, 41], 81: [2, 41], 82: [2, 41], 83: [2, 41], 84: [2, 41], 85: [2, 41] }, { 20: 64, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 26: 65, 47: [1, 66] }, { 30: 67, 33: [2, 58], 65: [2, 58], 72: [2, 58], 75: [2, 58], 80: [2, 58], 81: [2, 58], 82: [2, 58], 83: [2, 58], 84: [2, 58], 85: [2, 58] }, { 33: [2, 64], 35: 68, 65: [2, 64], 72: [2, 64], 75: [2, 64], 80: [2, 64], 81: [2, 64], 82: [2, 64], 83: [2, 64], 84: [2, 64], 85: [2, 64] }, { 21: 69, 23: [2, 50], 65: [2, 50], 72: [2, 50], 80: [2, 50], 81: [2, 50], 82: [2, 50], 83: [2, 50], 84: [2, 50], 85: [2, 50] }, { 33: [2, 90], 61: 70, 65: [2, 90], 72: [2, 90], 80: [2, 90], 81: [2, 90], 82: [2, 90], 83: [2, 90], 84: [2, 90], 85: [2, 90] }, { 20: 74, 33: [2, 80], 50: 71, 63: 72, 64: 75, 65: [1, 43], 69: 73, 70: 76, 71: 77, 72: [1, 78], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 72: [1, 79] }, { 23: [2, 42], 33: [2, 42], 54: [2, 42], 65: [2, 42], 68: [2, 42], 72: [2, 42], 75: [2, 42], 80: [2, 42], 81: [2, 42], 82: [2, 42], 83: [2, 42], 84: [2, 42], 85: [2, 42], 87: [1, 50] }, { 20: 74, 53: 80, 54: [2, 84], 63: 81, 64: 75, 65: [1, 43], 69: 82, 70: 76, 71: 77, 72: [1, 78], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 26: 83, 47: [1, 66] }, { 47: [2, 55] }, { 4: 84, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 39: [2, 46], 44: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 47: [2, 20] }, { 20: 85, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 4: 86, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 26: 87, 47: [1, 66] }, { 47: [2, 57] }, { 5: [2, 11], 14: [2, 11], 15: [2, 11], 19: [2, 11], 29: [2, 11], 34: [2, 11], 39: [2, 11], 44: [2, 11], 47: [2, 11], 48: [2, 11], 51: [2, 11], 55: [2, 11], 60: [2, 11] }, { 15: [2, 49], 18: [2, 49] }, { 20: 74, 33: [2, 88], 58: 88, 63: 89, 64: 75, 65: [1, 43], 69: 90, 70: 76, 71: 77, 72: [1, 78], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 65: [2, 94], 66: 91, 68: [2, 94], 72: [2, 94], 80: [2, 94], 81: [2, 94], 82: [2, 94], 83: [2, 94], 84: [2, 94], 85: [2, 94] }, { 5: [2, 25], 14: [2, 25], 15: [2, 25], 19: [2, 25], 29: [2, 25], 34: [2, 25], 39: [2, 25], 44: [2, 25], 47: [2, 25], 48: [2, 25], 51: [2, 25], 55: [2, 25], 60: [2, 25] }, { 20: 92, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 74, 31: 93, 33: [2, 60], 63: 94, 64: 75, 65: [1, 43], 69: 95, 70: 76, 71: 77, 72: [1, 78], 75: [2, 60], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 74, 33: [2, 66], 36: 96, 63: 97, 64: 75, 65: [1, 43], 69: 98, 70: 76, 71: 77, 72: [1, 78], 75: [2, 66], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 74, 22: 99, 23: [2, 52], 63: 100, 64: 75, 65: [1, 43], 69: 101, 70: 76, 71: 77, 72: [1, 78], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 74, 33: [2, 92], 62: 102, 63: 103, 64: 75, 65: [1, 43], 69: 104, 70: 76, 71: 77, 72: [1, 78], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 33: [1, 105] }, { 33: [2, 79], 65: [2, 79], 72: [2, 79], 80: [2, 79], 81: [2, 79], 82: [2, 79], 83: [2, 79], 84: [2, 79], 85: [2, 79] }, { 33: [2, 81] }, { 23: [2, 27], 33: [2, 27], 54: [2, 27], 65: [2, 27], 68: [2, 27], 72: [2, 27], 75: [2, 27], 80: [2, 27], 81: [2, 27], 82: [2, 27], 83: [2, 27], 84: [2, 27], 85: [2, 27] }, { 23: [2, 28], 33: [2, 28], 54: [2, 28], 65: [2, 28], 68: [2, 28], 72: [2, 28], 75: [2, 28], 80: [2, 28], 81: [2, 28], 82: [2, 28], 83: [2, 28], 84: [2, 28], 85: [2, 28] }, { 23: [2, 30], 33: [2, 30], 54: [2, 30], 68: [2, 30], 71: 106, 72: [1, 107], 75: [2, 30] }, { 23: [2, 98], 33: [2, 98], 54: [2, 98], 68: [2, 98], 72: [2, 98], 75: [2, 98] }, { 23: [2, 45], 33: [2, 45], 54: [2, 45], 65: [2, 45], 68: [2, 45], 72: [2, 45], 73: [1, 108], 75: [2, 45], 80: [2, 45], 81: [2, 45], 82: [2, 45], 83: [2, 45], 84: [2, 45], 85: [2, 45], 87: [2, 45] }, { 23: [2, 44], 33: [2, 44], 54: [2, 44], 65: [2, 44], 68: [2, 44], 72: [2, 44], 75: [2, 44], 80: [2, 44], 81: [2, 44], 82: [2, 44], 83: [2, 44], 84: [2, 44], 85: [2, 44], 87: [2, 44] }, { 54: [1, 109] }, { 54: [2, 83], 65: [2, 83], 72: [2, 83], 80: [2, 83], 81: [2, 83], 82: [2, 83], 83: [2, 83], 84: [2, 83], 85: [2, 83] }, { 54: [2, 85] }, { 5: [2, 13], 14: [2, 13], 15: [2, 13], 19: [2, 13], 29: [2, 13], 34: [2, 13], 39: [2, 13], 44: [2, 13], 47: [2, 13], 48: [2, 13], 51: [2, 13], 55: [2, 13], 60: [2, 13] }, { 38: 55, 39: [1, 57], 43: 56, 44: [1, 58], 45: 111, 46: 110, 47: [2, 76] }, { 33: [2, 70], 40: 112, 65: [2, 70], 72: [2, 70], 75: [2, 70], 80: [2, 70], 81: [2, 70], 82: [2, 70], 83: [2, 70], 84: [2, 70], 85: [2, 70] }, { 47: [2, 18] }, { 5: [2, 14], 14: [2, 14], 15: [2, 14], 19: [2, 14], 29: [2, 14], 34: [2, 14], 39: [2, 14], 44: [2, 14], 47: [2, 14], 48: [2, 14], 51: [2, 14], 55: [2, 14], 60: [2, 14] }, { 33: [1, 113] }, { 33: [2, 87], 65: [2, 87], 72: [2, 87], 80: [2, 87], 81: [2, 87], 82: [2, 87], 83: [2, 87], 84: [2, 87], 85: [2, 87] }, { 33: [2, 89] }, { 20: 74, 63: 115, 64: 75, 65: [1, 43], 67: 114, 68: [2, 96], 69: 116, 70: 76, 71: 77, 72: [1, 78], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 33: [1, 117] }, { 32: 118, 33: [2, 62], 74: 119, 75: [1, 120] }, { 33: [2, 59], 65: [2, 59], 72: [2, 59], 75: [2, 59], 80: [2, 59], 81: [2, 59], 82: [2, 59], 83: [2, 59], 84: [2, 59], 85: [2, 59] }, { 33: [2, 61], 75: [2, 61] }, { 33: [2, 68], 37: 121, 74: 122, 75: [1, 120] }, { 33: [2, 65], 65: [2, 65], 72: [2, 65], 75: [2, 65], 80: [2, 65], 81: [2, 65], 82: [2, 65], 83: [2, 65], 84: [2, 65], 85: [2, 65] }, { 33: [2, 67], 75: [2, 67] }, { 23: [1, 123] }, { 23: [2, 51], 65: [2, 51], 72: [2, 51], 80: [2, 51], 81: [2, 51], 82: [2, 51], 83: [2, 51], 84: [2, 51], 85: [2, 51] }, { 23: [2, 53] }, { 33: [1, 124] }, { 33: [2, 91], 65: [2, 91], 72: [2, 91], 80: [2, 91], 81: [2, 91], 82: [2, 91], 83: [2, 91], 84: [2, 91], 85: [2, 91] }, { 33: [2, 93] }, { 5: [2, 22], 14: [2, 22], 15: [2, 22], 19: [2, 22], 29: [2, 22], 34: [2, 22], 39: [2, 22], 44: [2, 22], 47: [2, 22], 48: [2, 22], 51: [2, 22], 55: [2, 22], 60: [2, 22] }, { 23: [2, 99], 33: [2, 99], 54: [2, 99], 68: [2, 99], 72: [2, 99], 75: [2, 99] }, { 73: [1, 108] }, { 20: 74, 63: 125, 64: 75, 65: [1, 43], 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 5: [2, 23], 14: [2, 23], 15: [2, 23], 19: [2, 23], 29: [2, 23], 34: [2, 23], 39: [2, 23], 44: [2, 23], 47: [2, 23], 48: [2, 23], 51: [2, 23], 55: [2, 23], 60: [2, 23] }, { 47: [2, 19] }, { 47: [2, 77] }, { 20: 74, 33: [2, 72], 41: 126, 63: 127, 64: 75, 65: [1, 43], 69: 128, 70: 76, 71: 77, 72: [1, 78], 75: [2, 72], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 5: [2, 24], 14: [2, 24], 15: [2, 24], 19: [2, 24], 29: [2, 24], 34: [2, 24], 39: [2, 24], 44: [2, 24], 47: [2, 24], 48: [2, 24], 51: [2, 24], 55: [2, 24], 60: [2, 24] }, { 68: [1, 129] }, { 65: [2, 95], 68: [2, 95], 72: [2, 95], 80: [2, 95], 81: [2, 95], 82: [2, 95], 83: [2, 95], 84: [2, 95], 85: [2, 95] }, { 68: [2, 97] }, { 5: [2, 21], 14: [2, 21], 15: [2, 21], 19: [2, 21], 29: [2, 21], 34: [2, 21], 39: [2, 21], 44: [2, 21], 47: [2, 21], 48: [2, 21], 51: [2, 21], 55: [2, 21], 60: [2, 21] }, { 33: [1, 130] }, { 33: [2, 63] }, { 72: [1, 132], 76: 131 }, { 33: [1, 133] }, { 33: [2, 69] }, { 15: [2, 12], 18: [2, 12] }, { 14: [2, 26], 15: [2, 26], 19: [2, 26], 29: [2, 26], 34: [2, 26], 47: [2, 26], 48: [2, 26], 51: [2, 26], 55: [2, 26], 60: [2, 26] }, { 23: [2, 31], 33: [2, 31], 54: [2, 31], 68: [2, 31], 72: [2, 31], 75: [2, 31] }, { 33: [2, 74], 42: 134, 74: 135, 75: [1, 120] }, { 33: [2, 71], 65: [2, 71], 72: [2, 71], 75: [2, 71], 80: [2, 71], 81: [2, 71], 82: [2, 71], 83: [2, 71], 84: [2, 71], 85: [2, 71] }, { 33: [2, 73], 75: [2, 73] }, { 23: [2, 29], 33: [2, 29], 54: [2, 29], 65: [2, 29], 68: [2, 29], 72: [2, 29], 75: [2, 29], 80: [2, 29], 81: [2, 29], 82: [2, 29], 83: [2, 29], 84: [2, 29], 85: [2, 29] }, { 14: [2, 15], 15: [2, 15], 19: [2, 15], 29: [2, 15], 34: [2, 15], 39: [2, 15], 44: [2, 15], 47: [2, 15], 48: [2, 15], 51: [2, 15], 55: [2, 15], 60: [2, 15] }, { 72: [1, 137], 77: [1, 136] }, { 72: [2, 100], 77: [2, 100] }, { 14: [2, 16], 15: [2, 16], 19: [2, 16], 29: [2, 16], 34: [2, 16], 44: [2, 16], 47: [2, 16], 48: [2, 16], 51: [2, 16], 55: [2, 16], 60: [2, 16] }, { 33: [1, 138] }, { 33: [2, 75] }, { 33: [2, 32] }, { 72: [2, 101], 77: [2, 101] }, { 14: [2, 17], 15: [2, 17], 19: [2, 17], 29: [2, 17], 34: [2, 17], 39: [2, 17], 44: [2, 17], 47: [2, 17], 48: [2, 17], 51: [2, 17], 55: [2, 17], 60: [2, 17] }], defaultActions: { 4: [2, 1], 54: [2, 55], 56: [2, 20], 60: [2, 57], 73: [2, 81], 82: [2, 85], 86: [2, 18], 90: [2, 89], 101: [2, 53], 104: [2, 93], 110: [2, 19], 111: [2, 77], 116: [2, 97], 119: [2, 63], 122: [2, 69], 135: [2, 75], 136: [2, 32] }, parseError: function (t, e) { throw new Error(t); }, parse: function (t) { var e = this, r = [0], s = [null], i = [], n = this.table, o = "", a = 0, l = 0; this.lexer.setInput(t), this.lexer.yy = this.yy, this.yy.lexer = this.lexer, this.yy.parser = this, void 0 === this.lexer.yylloc && (this.lexer.yylloc = {}); var c = this.lexer.yylloc; i.push(c); var p = this.lexer.options && this.lexer.options.ranges; "function" == typeof this.yy.parseError && (this.parseError = this.yy.parseError); for (var h, u, f, d, m, g, v, y, k, _ = {};;) { - if (u = r[r.length - 1], this.defaultActions[u] ? f = this.defaultActions[u] : (null == h && (k = void 0, "number" != typeof (k = e.lexer.lex() || 1) && (k = e.symbols_[k] || k), h = k), f = n[u] && n[u][h]), void 0 === f || !f.length || !f[0]) { - var S = ""; - for (m in y = [], n[u]) - this.terminals_[m] && m > 2 && y.push("'" + this.terminals_[m] + "'"); - S = this.lexer.showPosition ? "Parse error on line " + (a + 1) + ":\n" + this.lexer.showPosition() + "\nExpecting " + y.join(", ") + ", got '" + (this.terminals_[h] || h) + "'" : "Parse error on line " + (a + 1) + ": Unexpected " + (1 == h ? "end of input" : "'" + (this.terminals_[h] || h) + "'"), this.parseError(S, { text: this.lexer.match, token: this.terminals_[h] || h, line: this.lexer.yylineno, loc: c, expected: y }); - } - if (f[0] instanceof Array && f.length > 1) - throw new Error("Parse Error: multiple actions possible at state: " + u + ", token: " + h); - switch (f[0]) { - case 1: - r.push(h), s.push(this.lexer.yytext), i.push(this.lexer.yylloc), r.push(f[1]), h = null, l = this.lexer.yyleng, o = this.lexer.yytext, a = this.lexer.yylineno, c = this.lexer.yylloc; - break; - case 2: - if (g = this.productions_[f[1]][1], _.$ = s[s.length - g], _._$ = { first_line: i[i.length - (g || 1)].first_line, last_line: i[i.length - 1].last_line, first_column: i[i.length - (g || 1)].first_column, last_column: i[i.length - 1].last_column }, p && (_._$.range = [i[i.length - (g || 1)].range[0], i[i.length - 1].range[1]]), void 0 !== (d = this.performAction.call(_, o, l, a, this.yy, f[1], s, i))) - return d; - g && (r = r.slice(0, -1 * g * 2), s = s.slice(0, -1 * g), i = i.slice(0, -1 * g)), r.push(this.productions_[f[1]][0]), s.push(_.$), i.push(_._$), v = n[r[r.length - 2]][r[r.length - 1]], r.push(v); - break; - case 3: return !0; - } - } return !0; } }, e = function () { var t = { EOF: 1, parseError: function (t, e) { if (!this.yy.parser) - throw new Error(t); this.yy.parser.parseError(t, e); }, setInput: function (t) { return this._input = t, this._more = this._less = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = { first_line: 1, first_column: 0, last_line: 1, last_column: 0 }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this; }, input: function () { var t = this._input[0]; return this.yytext += t, this.yyleng++, this.offset++, this.match += t, this.matched += t, t.match(/(?:\r\n?|\n).*/g) ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), t; }, unput: function (t) { var e = t.length, r = t.split(/(?:\r\n?|\n)/g); this._input = t + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - e - 1), this.offset -= e; var s = this.match.split(/(?:\r\n?|\n)/g); this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), r.length - 1 && (this.yylineno -= r.length - 1); var i = this.yylloc.range; return this.yylloc = { first_line: this.yylloc.first_line, last_line: this.yylineno + 1, first_column: this.yylloc.first_column, last_column: r ? (r.length === s.length ? this.yylloc.first_column : 0) + s[s.length - r.length].length - r[0].length : this.yylloc.first_column - e }, this.options.ranges && (this.yylloc.range = [i[0], i[0] + this.yyleng - e]), this; }, more: function () { return this._more = !0, this; }, less: function (t) { this.unput(this.match.slice(t)); }, pastInput: function () { var t = this.matched.substr(0, this.matched.length - this.match.length); return (t.length > 20 ? "..." : "") + t.substr(-20).replace(/\n/g, ""); }, upcomingInput: function () { var t = this.match; return t.length < 20 && (t += this._input.substr(0, 20 - t.length)), (t.substr(0, 20) + (t.length > 20 ? "..." : "")).replace(/\n/g, ""); }, showPosition: function () { var t = this.pastInput(), e = new Array(t.length + 1).join("-"); return t + this.upcomingInput() + "\n" + e + "^"; }, next: function () { if (this.done) - return this.EOF; var t, e, r, s, i; this._input || (this.done = !0), this._more || (this.yytext = "", this.match = ""); for (var n = this._currentRules(), o = 0; o < n.length && (!(r = this._input.match(this.rules[n[o]])) || e && !(r[0].length > e[0].length) || (e = r, s = o, this.options.flex)); o++) - ; return e ? ((i = e[0].match(/(?:\r\n?|\n).*/g)) && (this.yylineno += i.length), this.yylloc = { first_line: this.yylloc.last_line, last_line: this.yylineno + 1, first_column: this.yylloc.last_column, last_column: i ? i[i.length - 1].length - i[i.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + e[0].length }, this.yytext += e[0], this.match += e[0], this.matches = e, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = !1, this._input = this._input.slice(e[0].length), this.matched += e[0], t = this.performAction.call(this, this.yy, this, n[s], this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), t || void 0) : "" === this._input ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), { text: "", token: null, line: this.yylineno }); }, lex: function () { var t = this.next(); return void 0 !== t ? t : this.lex(); }, begin: function (t) { this.conditionStack.push(t); }, popState: function () { return this.conditionStack.pop(); }, _currentRules: function () { return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; }, topState: function () { return this.conditionStack[this.conditionStack.length - 2]; }, pushState: function (t) { this.begin(t); }, options: {}, performAction: function (t, e, r, s) { function i(t, r) { return e.yytext = e.yytext.substring(t, e.yyleng - r + t); } switch (r) { - case 0: - if ("\\\\" === e.yytext.slice(-2) ? (i(0, 1), this.begin("mu")) : "\\" === e.yytext.slice(-1) ? (i(0, 1), this.begin("emu")) : this.begin("mu"), e.yytext) - return 15; - break; - case 1: - case 5: return 15; - case 2: return this.popState(), 15; - case 3: return this.begin("raw"), 15; - case 4: return this.popState(), "raw" === this.conditionStack[this.conditionStack.length - 1] ? 15 : (i(5, 9), "END_RAW_BLOCK"); - case 6: - case 22: return this.popState(), 14; - case 7: return 65; - case 8: return 68; - case 9: return 19; - case 10: return this.popState(), this.begin("raw"), 23; - case 11: return 55; - case 12: return 60; - case 13: return 29; - case 14: return 47; - case 15: - case 16: return this.popState(), 44; - case 17: return 34; - case 18: return 39; - case 19: return 51; - case 20: - case 23: return 48; - case 21: - this.unput(e.yytext), this.popState(), this.begin("com"); - break; - case 24: return 73; - case 25: - case 26: - case 41: return 72; - case 27: return 87; - case 28: break; - case 29: return this.popState(), 54; - case 30: return this.popState(), 33; - case 31: return e.yytext = i(1, 2).replace(/\\"/g, '"'), 80; - case 32: return e.yytext = i(1, 2).replace(/\\'/g, "'"), 80; - case 33: return 85; - case 34: - case 35: return 82; - case 36: return 83; - case 37: return 84; - case 38: return 81; - case 39: return 75; - case 40: return 77; - case 42: return e.yytext = e.yytext.replace(/\\([\\\]])/g, "$1"), 72; - case 43: return "INVALID"; - case 44: return 5; - } }, rules: [/^(?:[^\x00]*?(?=(\{\{)))/, /^(?:[^\x00]+)/, /^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/, /^(?:\{\{\{\{(?=[^/]))/, /^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/, /^(?:[^\x00]+?(?=(\{\{\{\{)))/, /^(?:[\s\S]*?--(~)?\}\})/, /^(?:\()/, /^(?:\))/, /^(?:\{\{\{\{)/, /^(?:\}\}\}\})/, /^(?:\{\{(~)?>)/, /^(?:\{\{(~)?#>)/, /^(?:\{\{(~)?#\*?)/, /^(?:\{\{(~)?\/)/, /^(?:\{\{(~)?\^\s*(~)?\}\})/, /^(?:\{\{(~)?\s*else\s*(~)?\}\})/, /^(?:\{\{(~)?\^)/, /^(?:\{\{(~)?\s*else\b)/, /^(?:\{\{(~)?\{)/, /^(?:\{\{(~)?&)/, /^(?:\{\{(~)?!--)/, /^(?:\{\{(~)?![\s\S]*?\}\})/, /^(?:\{\{(~)?\*?)/, /^(?:=)/, /^(?:\.\.)/, /^(?:\.(?=([=~}\s\/.)|])))/, /^(?:[\/.])/, /^(?:\s+)/, /^(?:\}(~)?\}\})/, /^(?:(~)?\}\})/, /^(?:"(\\["]|[^"])*")/, /^(?:'(\\[']|[^'])*')/, /^(?:@)/, /^(?:true(?=([~}\s)])))/, /^(?:false(?=([~}\s)])))/, /^(?:undefined(?=([~}\s)])))/, /^(?:null(?=([~}\s)])))/, /^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/, /^(?:as\s+\|)/, /^(?:\|)/, /^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/, /^(?:\[(\\\]|[^\]])*\])/, /^(?:.)/, /^(?:$)/], conditions: { mu: { rules: [7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44], inclusive: !1 }, emu: { rules: [2], inclusive: !1 }, com: { rules: [6], inclusive: !1 }, raw: { rules: [3, 4, 5], inclusive: !1 }, INITIAL: { rules: [0, 1, 44], inclusive: !0 } } }; return t; }(); function r() { this.yy = {}; } return t.lexer = e, r.prototype = t, t.Parser = r, new r; }(); e.default = r, t.exports = e.default; }(dt, dt.exports); -var mt = { exports: {} }, gt = { exports: {} }; -!function (t, e) { e.__esModule = !0; var r = function (t) { return t && t.__esModule ? t : { default: t }; }(u.exports); function s() { this.parents = []; } function i(t) { this.acceptRequired(t, "path"), this.acceptArray(t.params), this.acceptKey(t, "hash"); } function n(t) { i.call(this, t), this.acceptKey(t, "program"), this.acceptKey(t, "inverse"); } function o(t) { this.acceptRequired(t, "name"), this.acceptArray(t.params), this.acceptKey(t, "hash"); } s.prototype = { constructor: s, mutating: !1, acceptKey: function (t, e) { var i = this.accept(t[e]); if (this.mutating) { - if (i && !s.prototype[i.type]) - throw new r.default('Unexpected node type "' + i.type + '" found when accepting ' + e + " on " + t.type); - t[e] = i; - } }, acceptRequired: function (t, e) { if (this.acceptKey(t, e), !t[e]) - throw new r.default(t.type + " requires " + e); }, acceptArray: function (t) { for (var e = 0, r = t.length; e < r; e++) - this.acceptKey(t, e), t[e] || (t.splice(e, 1), e--, r--); }, accept: function (t) { if (t) { - if (!this[t.type]) - throw new r.default("Unknown type: " + t.type, t); - this.current && this.parents.unshift(this.current), this.current = t; - var e = this[t.type](t); - return this.current = this.parents.shift(), !this.mutating || e ? e : !1 !== e ? t : void 0; - } }, Program: function (t) { this.acceptArray(t.body); }, MustacheStatement: i, Decorator: i, BlockStatement: n, DecoratorBlock: n, PartialStatement: o, PartialBlockStatement: function (t) { o.call(this, t), this.acceptKey(t, "program"); }, ContentStatement: function () { }, CommentStatement: function () { }, SubExpression: i, PathExpression: function () { }, StringLiteral: function () { }, NumberLiteral: function () { }, BooleanLiteral: function () { }, UndefinedLiteral: function () { }, NullLiteral: function () { }, Hash: function (t) { this.acceptArray(t.pairs); }, HashPair: function (t) { this.acceptRequired(t, "value"); } }, e.default = s, t.exports = e.default; }(gt, gt.exports), function (t, e) { e.__esModule = !0; var r = function (t) { return t && t.__esModule ? t : { default: t }; }(gt.exports); function s() { var t = arguments.length <= 0 || void 0 === arguments[0] ? {} : arguments[0]; this.options = t; } function i(t, e, r) { void 0 === e && (e = t.length); var s = t[e - 1], i = t[e - 2]; return s ? "ContentStatement" === s.type ? (i || !r ? /\r?\n\s*?$/ : /(^|\r?\n)\s*?$/).test(s.original) : void 0 : r; } function n(t, e, r) { void 0 === e && (e = -1); var s = t[e + 1], i = t[e + 2]; return s ? "ContentStatement" === s.type ? (i || !r ? /^\s*?\r?\n/ : /^\s*?(\r?\n|$)/).test(s.original) : void 0 : r; } function o(t, e, r) { var s = t[null == e ? 0 : e + 1]; if (s && "ContentStatement" === s.type && (r || !s.rightStripped)) { - var i = s.value; - s.value = s.value.replace(r ? /^\s+/ : /^[ \t]*\r?\n?/, ""), s.rightStripped = s.value !== i; -} } function a(t, e, r) { var s = t[null == e ? t.length - 1 : e - 1]; if (s && "ContentStatement" === s.type && (r || !s.leftStripped)) { - var i = s.value; - return s.value = s.value.replace(r ? /\s+$/ : /[ \t]+$/, ""), s.leftStripped = s.value !== i, s.leftStripped; -} } s.prototype = new r.default, s.prototype.Program = function (t) { var e = !this.options.ignoreStandalone, r = !this.isRootSeen; this.isRootSeen = !0; for (var s = t.body, l = 0, c = s.length; l < c; l++) { - var p = s[l], h = this.accept(p); - if (h) { - var u = i(s, l, r), f = n(s, l, r), d = h.openStandalone && u, m = h.closeStandalone && f, g = h.inlineStandalone && u && f; - h.close && o(s, l, !0), h.open && a(s, l, !0), e && g && (o(s, l), a(s, l) && "PartialStatement" === p.type && (p.indent = /([ \t]+$)/.exec(s[l - 1].original)[1])), e && d && (o((p.program || p.inverse).body), a(s, l)), e && m && (o(s, l), a((p.inverse || p.program).body)); - } -} return t; }, s.prototype.BlockStatement = s.prototype.DecoratorBlock = s.prototype.PartialBlockStatement = function (t) { this.accept(t.program), this.accept(t.inverse); var e = t.program || t.inverse, r = t.program && t.inverse, s = r, l = r; if (r && r.chained) - for (s = r.body[0].program; l.chained;) - l = l.body[l.body.length - 1].program; var c = { open: t.openStrip.open, close: t.closeStrip.close, openStandalone: n(e.body), closeStandalone: i((s || e).body) }; if (t.openStrip.close && o(e.body, null, !0), r) { - var p = t.inverseStrip; - p.open && a(e.body, null, !0), p.close && o(s.body, null, !0), t.closeStrip.open && a(l.body, null, !0), !this.options.ignoreStandalone && i(e.body) && n(s.body) && (a(e.body), o(s.body)); -} -else - t.closeStrip.open && a(e.body, null, !0); return c; }, s.prototype.Decorator = s.prototype.MustacheStatement = function (t) { return t.strip; }, s.prototype.PartialStatement = s.prototype.CommentStatement = function (t) { var e = t.strip || {}; return { inlineStandalone: !0, open: e.open, close: e.close }; }, e.default = s, t.exports = e.default; }(mt, mt.exports); -var vt = {}; -vt.__esModule = !0, vt.SourceLocation = function (t, e) { this.source = t, this.start = { line: e.first_line, column: e.first_column }, this.end = { line: e.last_line, column: e.last_column }; }, vt.id = function (t) { return /^\[.*\]$/.test(t) ? t.substring(1, t.length - 1) : t; }, vt.stripFlags = function (t, e) { return { open: "~" === t.charAt(2), close: "~" === e.charAt(e.length - 3) }; }, vt.stripComment = function (t) { return t.replace(/^\{\{~?!-?-?/, "").replace(/-?-?~?\}\}$/, ""); }, vt.preparePath = function (t, e, r) { r = this.locInfo(r); for (var s = t ? "@" : "", i = [], n = 0, o = 0, a = e.length; o < a; o++) { - var l = e[o].part, c = e[o].original !== l; - if (s += (e[o].separator || "") + l, c || ".." !== l && "." !== l && "this" !== l) - i.push(l); - else { - if (i.length > 0) - throw new yt.default("Invalid path: " + s, { loc: r }); - ".." === l && n++; - } -} return { type: "PathExpression", data: t, depth: n, parts: i, original: s, loc: r }; }, vt.prepareMustache = function (t, e, r, s, i, n) { var o = s.charAt(3) || s.charAt(2), a = "{" !== o && "&" !== o; return { type: /\*/.test(s) ? "Decorator" : "MustacheStatement", path: t, params: e, hash: r, escaped: a, strip: i, loc: this.locInfo(n) }; }, vt.prepareRawBlock = function (t, e, r, s) { kt(t, r), s = this.locInfo(s); var i = { type: "Program", body: e, strip: {}, loc: s }; return { type: "BlockStatement", path: t.path, params: t.params, hash: t.hash, program: i, openStrip: {}, inverseStrip: {}, closeStrip: {}, loc: s }; }, vt.prepareBlock = function (t, e, r, s, i, n) { s && s.path && kt(t, s); var o = /\*/.test(t.open); e.blockParams = t.blockParams; var a = void 0, l = void 0; if (r) { - if (o) - throw new yt.default("Unexpected inverse block on decorator", r); - r.chain && (r.program.body[0].closeStrip = s.strip), l = r.strip, a = r.program; -} i && (i = a, a = e, e = i); return { type: o ? "DecoratorBlock" : "BlockStatement", path: t.path, params: t.params, hash: t.hash, program: e, inverse: a, openStrip: t.strip, inverseStrip: l, closeStrip: s && s.strip, loc: this.locInfo(n) }; }, vt.prepareProgram = function (t, e) { if (!e && t.length) { - var r = t[0].loc, s = t[t.length - 1].loc; - r && s && (e = { source: r.source, start: { line: r.start.line, column: r.start.column }, end: { line: s.end.line, column: s.end.column } }); -} return { type: "Program", body: t, strip: {}, loc: e }; }, vt.preparePartialBlock = function (t, e, r, s) { return kt(t, r), { type: "PartialBlockStatement", name: t.path, params: t.params, hash: t.hash, program: e, openStrip: t.strip, closeStrip: r && r.strip, loc: this.locInfo(s) }; }; -var yt = function (t) { return t && t.__esModule ? t : { default: t }; }(u.exports); -function kt(t, e) { if (e = e.path ? e.path.original : e, t.path.original !== e) { - var r = { loc: t.path.loc }; - throw new yt.default(t.path.original + " doesn't match " + e, r); -} } -function _t(t) { return t && t.__esModule ? t : { default: t }; } -ft.__esModule = !0, ft.parseWithoutProcessing = Et, ft.parse = function (t, e) { var r = Et(t, e); return new xt.default(e).accept(r); }; -var St = _t(dt.exports), xt = _t(mt.exports), Pt = function (t) { if (t && t.__esModule) - return t; var e = {}; if (null != t) - for (var r in t) - Object.prototype.hasOwnProperty.call(t, r) && (e[r] = t[r]); return e.default = t, e; }(vt), bt = s; -ft.parser = St.default; -var wt = {}; -function Et(t, e) { return "Program" === t.type ? t : (St.default.yy = wt, wt.locInfo = function (t) { return new wt.SourceLocation(e && e.srcName, t); }, St.default.parse(t)); } -bt.extend(wt, Pt); -var Lt = {}; -function Ct(t) { return t && t.__esModule ? t : { default: t }; } -Lt.__esModule = !0, Lt.Compiler = Mt, Lt.precompile = function (t, e, r) { if (null == t || "string" != typeof t && "Program" !== t.type) - throw new It.default("You must pass a string or Handlebars AST to Handlebars.precompile. You passed " + t); "data" in (e = e || {}) || (e.data = !0); e.compat && (e.useDepths = !0); var s = r.parse(t, e), i = (new r.Compiler).compile(s, e); return (new r.JavaScriptCompiler).compile(i, e); }, Lt.compile = function (t, e, r) { void 0 === e && (e = {}); if (null == t || "string" != typeof t && "Program" !== t.type) - throw new It.default("You must pass a string or Handlebars AST to Handlebars.compile. You passed " + t); "data" in (e = Ot.extend({}, e)) || (e.data = !0); e.compat && (e.useDepths = !0); var s = void 0; function i() { var s = r.parse(t, e), i = (new r.Compiler).compile(s, e), n = (new r.JavaScriptCompiler).compile(i, e, void 0, !0); return r.template(n); } function n(t, e) { return s || (s = i()), s.call(this, t, e); } return n._setup = function (t) { return s || (s = i()), s._setup(t); }, n._child = function (t, e, r, n) { return s || (s = i()), s._child(t, e, r, n); }, n; }; -var It = Ct(u.exports), Ot = s, Nt = Ct(ut.exports), At = [].slice; -function Mt() { } -function Bt(t, e) { if (t === e) - return !0; if (Ot.isArray(t) && Ot.isArray(e) && t.length === e.length) { - for (var r = 0; r < t.length; r++) - if (!Bt(t[r], e[r])) - return !1; - return !0; -} } -function Dt(t) { if (!t.path.parts) { - var e = t.path; - t.path = { type: "PathExpression", data: !1, depth: 0, parts: [e.original + ""], original: e.original + "", loc: e.loc }; -} } -Mt.prototype = { compiler: Mt, equals: function (t) { var e = this.opcodes.length; if (t.opcodes.length !== e) - return !1; for (var r = 0; r < e; r++) { - var s = this.opcodes[r], i = t.opcodes[r]; - if (s.opcode !== i.opcode || !Bt(s.args, i.args)) - return !1; - } e = this.children.length; for (r = 0; r < e; r++) - if (!this.children[r].equals(t.children[r])) - return !1; return !0; }, guid: 0, compile: function (t, e) { return this.sourceNode = [], this.opcodes = [], this.children = [], this.options = e, this.stringParams = e.stringParams, this.trackIds = e.trackIds, e.blockParams = e.blockParams || [], e.knownHelpers = Ot.extend(Object.create(null), { helperMissing: !0, blockHelperMissing: !0, each: !0, if: !0, unless: !0, with: !0, log: !0, lookup: !0 }, e.knownHelpers), this.accept(t); }, compileProgram: function (t) { var e = (new this.compiler).compile(t, this.options), r = this.guid++; return this.usePartial = this.usePartial || e.usePartial, this.children[r] = e, this.useDepths = this.useDepths || e.useDepths, r; }, accept: function (t) { if (!this[t.type]) - throw new It.default("Unknown type: " + t.type, t); this.sourceNode.unshift(t); var e = this[t.type](t); return this.sourceNode.shift(), e; }, Program: function (t) { this.options.blockParams.unshift(t.blockParams); for (var e = t.body, r = e.length, s = 0; s < r; s++) - this.accept(e[s]); return this.options.blockParams.shift(), this.isSimple = 1 === r, this.blockParams = t.blockParams ? t.blockParams.length : 0, this; }, BlockStatement: function (t) { Dt(t); var e = t.program, r = t.inverse; e = e && this.compileProgram(e), r = r && this.compileProgram(r); var s = this.classifySexpr(t); "helper" === s ? this.helperSexpr(t, e, r) : "simple" === s ? (this.simpleSexpr(t), this.opcode("pushProgram", e), this.opcode("pushProgram", r), this.opcode("emptyHash"), this.opcode("blockValue", t.path.original)) : (this.ambiguousSexpr(t, e, r), this.opcode("pushProgram", e), this.opcode("pushProgram", r), this.opcode("emptyHash"), this.opcode("ambiguousBlockValue")), this.opcode("append"); }, DecoratorBlock: function (t) { var e = t.program && this.compileProgram(t.program), r = this.setupFullMustacheParams(t, e, void 0), s = t.path; this.useDecorators = !0, this.opcode("registerDecorator", r.length, s.original); }, PartialStatement: function (t) { this.usePartial = !0; var e = t.program; e && (e = this.compileProgram(t.program)); var r = t.params; if (r.length > 1) - throw new It.default("Unsupported number of partial arguments: " + r.length, t); r.length || (this.options.explicitPartialContext ? this.opcode("pushLiteral", "undefined") : r.push({ type: "PathExpression", parts: [], depth: 0 })); var s = t.name.original, i = "SubExpression" === t.name.type; i && this.accept(t.name), this.setupFullMustacheParams(t, e, void 0, !0); var n = t.indent || ""; this.options.preventIndent && n && (this.opcode("appendContent", n), n = ""), this.opcode("invokePartial", i, s, n), this.opcode("append"); }, PartialBlockStatement: function (t) { this.PartialStatement(t); }, MustacheStatement: function (t) { this.SubExpression(t), t.escaped && !this.options.noEscape ? this.opcode("appendEscaped") : this.opcode("append"); }, Decorator: function (t) { this.DecoratorBlock(t); }, ContentStatement: function (t) { t.value && this.opcode("appendContent", t.value); }, CommentStatement: function () { }, SubExpression: function (t) { Dt(t); var e = this.classifySexpr(t); "simple" === e ? this.simpleSexpr(t) : "helper" === e ? this.helperSexpr(t) : this.ambiguousSexpr(t); }, ambiguousSexpr: function (t, e, r) { var s = t.path, i = s.parts[0], n = null != e || null != r; this.opcode("getContext", s.depth), this.opcode("pushProgram", e), this.opcode("pushProgram", r), s.strict = !0, this.accept(s), this.opcode("invokeAmbiguous", i, n); }, simpleSexpr: function (t) { var e = t.path; e.strict = !0, this.accept(e), this.opcode("resolvePossibleLambda"); }, helperSexpr: function (t, e, r) { var s = this.setupFullMustacheParams(t, e, r), i = t.path, n = i.parts[0]; if (this.options.knownHelpers[n]) - this.opcode("invokeKnownHelper", s.length, n); - else { - if (this.options.knownHelpersOnly) - throw new It.default("You specified knownHelpersOnly, but used the unknown helper " + n, t); - i.strict = !0, i.falsy = !0, this.accept(i), this.opcode("invokeHelper", s.length, i.original, Nt.default.helpers.simpleId(i)); - } }, PathExpression: function (t) { this.addDepth(t.depth), this.opcode("getContext", t.depth); var e = t.parts[0], r = Nt.default.helpers.scopedId(t), s = !t.depth && !r && this.blockParamIndex(e); s ? this.opcode("lookupBlockParam", s, t.parts) : e ? t.data ? (this.options.data = !0, this.opcode("lookupData", t.depth, t.parts, t.strict)) : this.opcode("lookupOnContext", t.parts, t.falsy, t.strict, r) : this.opcode("pushContext"); }, StringLiteral: function (t) { this.opcode("pushString", t.value); }, NumberLiteral: function (t) { this.opcode("pushLiteral", t.value); }, BooleanLiteral: function (t) { this.opcode("pushLiteral", t.value); }, UndefinedLiteral: function () { this.opcode("pushLiteral", "undefined"); }, NullLiteral: function () { this.opcode("pushLiteral", "null"); }, Hash: function (t) { var e = t.pairs, r = 0, s = e.length; for (this.opcode("pushHash"); r < s; r++) - this.pushParam(e[r].value); for (; r--;) - this.opcode("assignToHash", e[r].key); this.opcode("popHash"); }, opcode: function (t) { this.opcodes.push({ opcode: t, args: At.call(arguments, 1), loc: this.sourceNode[0].loc }); }, addDepth: function (t) { t && (this.useDepths = !0); }, classifySexpr: function (t) { var e = Nt.default.helpers.simpleId(t.path), r = e && !!this.blockParamIndex(t.path.parts[0]), s = !r && Nt.default.helpers.helperExpression(t), i = !r && (s || e); if (i && !s) { - var n = t.path.parts[0], o = this.options; - o.knownHelpers[n] ? s = !0 : o.knownHelpersOnly && (i = !1); - } return s ? "helper" : i ? "ambiguous" : "simple"; }, pushParams: function (t) { for (var e = 0, r = t.length; e < r; e++) - this.pushParam(t[e]); }, pushParam: function (t) { var e = null != t.value ? t.value : t.original || ""; if (this.stringParams) - e.replace && (e = e.replace(/^(\.?\.\/)*/g, "").replace(/\//g, ".")), t.depth && this.addDepth(t.depth), this.opcode("getContext", t.depth || 0), this.opcode("pushStringParam", e, t.type), "SubExpression" === t.type && this.accept(t); - else { - if (this.trackIds) { - var r = void 0; - if (!t.parts || Nt.default.helpers.scopedId(t) || t.depth || (r = this.blockParamIndex(t.parts[0])), r) { - var s = t.parts.slice(1).join("."); - this.opcode("pushId", "BlockParam", r, s); - } - else - (e = t.original || e).replace && (e = e.replace(/^this(?:\.|$)/, "").replace(/^\.\//, "").replace(/^\.$/, "")), this.opcode("pushId", t.type, e); - } - this.accept(t); - } }, setupFullMustacheParams: function (t, e, r, s) { var i = t.params; return this.pushParams(i), this.opcode("pushProgram", e), this.opcode("pushProgram", r), t.hash ? this.accept(t.hash) : this.opcode("emptyHash", s), i; }, blockParamIndex: function (t) { for (var e = 0, r = this.options.blockParams.length; e < r; e++) { - var s = this.options.blockParams[e], i = s && Ot.indexOf(s, t); - if (s && i >= 0) - return [e, i]; - } } }; -var Ht = { exports: {} }, $t = { exports: {} }; -!function (t, e) { e.__esModule = !0; var r = s, i = void 0; try { - var n = require("source-map"); - i = n.SourceNode; -} -catch (t) { } function o(t, e, s) { if (r.isArray(t)) { - for (var i = [], n = 0, o = t.length; n < o; n++) - i.push(e.wrap(t[n], s)); - return i; -} return "boolean" == typeof t || "number" == typeof t ? t + "" : t; } function a(t) { this.srcFile = t, this.source = []; } i || ((i = function (t, e, r, s) { this.src = "", s && this.add(s); }).prototype = { add: function (t) { r.isArray(t) && (t = t.join("")), this.src += t; }, prepend: function (t) { r.isArray(t) && (t = t.join("")), this.src = t + this.src; }, toStringWithSourceMap: function () { return { code: this.toString() }; }, toString: function () { return this.src; } }), a.prototype = { isEmpty: function () { return !this.source.length; }, prepend: function (t, e) { this.source.unshift(this.wrap(t, e)); }, push: function (t, e) { this.source.push(this.wrap(t, e)); }, merge: function () { var t = this.empty(); return this.each((function (e) { t.add([" ", e, "\n"]); })), t; }, each: function (t) { for (var e = 0, r = this.source.length; e < r; e++) - t(this.source[e]); }, empty: function () { var t = this.currentLocation || { start: {} }; return new i(t.start.line, t.start.column, this.srcFile); }, wrap: function (t) { var e = arguments.length <= 1 || void 0 === arguments[1] ? this.currentLocation || { start: {} } : arguments[1]; return t instanceof i ? t : (t = o(t, this, e), new i(e.start.line, e.start.column, this.srcFile, t)); }, functionCall: function (t, e, r) { return r = this.generateList(r), this.wrap([t, e ? "." + e + "(" : "(", r, ")"]); }, quotedString: function (t) { return '"' + (t + "").replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029") + '"'; }, objectLiteral: function (t) { var e = this, r = []; Object.keys(t).forEach((function (s) { var i = o(t[s], e); "undefined" !== i && r.push([e.quotedString(s), ":", i]); })); var s = this.generateList(r); return s.prepend("{"), s.add("}"), s; }, generateList: function (t) { for (var e = this.empty(), r = 0, s = t.length; r < s; r++) - r && e.add(","), e.add(o(t[r], this)); return e; }, generateArray: function (t) { var e = this.generateList(t); return e.prepend("["), e.add("]"), e; } }, e.default = a, t.exports = e.default; }($t, $t.exports), function (t, e) { function i(t) { return t && t.__esModule ? t : { default: t }; } e.__esModule = !0; var n = r, o = i(u.exports), a = s, l = i($t.exports); function c(t) { this.value = t; } function p() { } p.prototype = { nameLookup: function (t, e) { return this.internalNameLookup(t, e); }, depthedLookup: function (t) { return [this.aliasable("container.lookup"), "(depths, ", JSON.stringify(t), ")"]; }, compilerInfo: function () { var t = n.COMPILER_REVISION; return [t, n.REVISION_CHANGES[t]]; }, appendToBuffer: function (t, e, r) { return a.isArray(t) || (t = [t]), t = this.source.wrap(t, e), this.environment.isSimple ? ["return ", t, ";"] : r ? ["buffer += ", t, ";"] : (t.appendToBuffer = !0, t); }, initializeBuffer: function () { return this.quotedString(""); }, internalNameLookup: function (t, e) { return this.lookupPropertyFunctionIsUsed = !0, ["lookupProperty(", t, ",", JSON.stringify(e), ")"]; }, lookupPropertyFunctionIsUsed: !1, compile: function (t, e, r, s) { this.environment = t, this.options = e, this.stringParams = this.options.stringParams, this.trackIds = this.options.trackIds, this.precompile = !s, this.name = this.environment.name, this.isChild = !!r, this.context = r || { decorators: [], programs: [], environments: [] }, this.preamble(), this.stackSlot = 0, this.stackVars = [], this.aliases = {}, this.registers = { list: [] }, this.hashes = [], this.compileStack = [], this.inlineStack = [], this.blockParams = [], this.compileChildren(t, e), this.useDepths = this.useDepths || t.useDepths || t.useDecorators || this.options.compat, this.useBlockParams = this.useBlockParams || t.useBlockParams; var i = t.opcodes, n = void 0, a = void 0, l = void 0, c = void 0; for (l = 0, c = i.length; l < c; l++) - n = i[l], this.source.currentLocation = n.loc, a = a || n.loc, this[n.opcode].apply(this, n.args); if (this.source.currentLocation = a, this.pushSource(""), this.stackSlot || this.inlineStack.length || this.compileStack.length) - throw new o.default("Compile completed with content left on stack"); this.decorators.isEmpty() ? this.decorators = void 0 : (this.useDecorators = !0, this.decorators.prepend(["var decorators = container.decorators, ", this.lookupPropertyFunctionVarDeclaration(), ";\n"]), this.decorators.push("return fn;"), s ? this.decorators = Function.apply(this, ["fn", "props", "container", "depth0", "data", "blockParams", "depths", this.decorators.merge()]) : (this.decorators.prepend("function(fn, props, container, depth0, data, blockParams, depths) {\n"), this.decorators.push("}\n"), this.decorators = this.decorators.merge())); var p = this.createFunctionContext(s); if (this.isChild) - return p; var h = { compiler: this.compilerInfo(), main: p }; this.decorators && (h.main_d = this.decorators, h.useDecorators = !0); var u = this.context, f = u.programs, d = u.decorators; for (l = 0, c = f.length; l < c; l++) - f[l] && (h[l] = f[l], d[l] && (h[l + "_d"] = d[l], h.useDecorators = !0)); return this.environment.usePartial && (h.usePartial = !0), this.options.data && (h.useData = !0), this.useDepths && (h.useDepths = !0), this.useBlockParams && (h.useBlockParams = !0), this.options.compat && (h.compat = !0), s ? h.compilerOptions = this.options : (h.compiler = JSON.stringify(h.compiler), this.source.currentLocation = { start: { line: 1, column: 0 } }, h = this.objectLiteral(h), e.srcName ? (h = h.toStringWithSourceMap({ file: e.destName })).map = h.map && h.map.toString() : h = h.toString()), h; }, preamble: function () { this.lastContext = 0, this.source = new l.default(this.options.srcName), this.decorators = new l.default(this.options.srcName); }, createFunctionContext: function (t) { var e = this, r = "", s = this.stackVars.concat(this.registers.list); s.length > 0 && (r += ", " + s.join(", ")); var i = 0; Object.keys(this.aliases).forEach((function (t) { var s = e.aliases[t]; s.children && s.referenceCount > 1 && (r += ", alias" + ++i + "=" + t, s.children[0] = "alias" + i); })), this.lookupPropertyFunctionIsUsed && (r += ", " + this.lookupPropertyFunctionVarDeclaration()); var n = ["container", "depth0", "helpers", "partials", "data"]; (this.useBlockParams || this.useDepths) && n.push("blockParams"), this.useDepths && n.push("depths"); var o = this.mergeSource(r); return t ? (n.push(o), Function.apply(this, n)) : this.source.wrap(["function(", n.join(","), ") {\n ", o, "}"]); }, mergeSource: function (t) { var e = this.environment.isSimple, r = !this.forceBuffer, s = void 0, i = void 0, n = void 0, o = void 0; return this.source.each((function (t) { t.appendToBuffer ? (n ? t.prepend(" + ") : n = t, o = t) : (n && (i ? n.prepend("buffer += ") : s = !0, o.add(";"), n = o = void 0), i = !0, e || (r = !1)); })), r ? n ? (n.prepend("return "), o.add(";")) : i || this.source.push('return "";') : (t += ", buffer = " + (s ? "" : this.initializeBuffer()), n ? (n.prepend("return buffer + "), o.add(";")) : this.source.push("return buffer;")), t && this.source.prepend("var " + t.substring(2) + (s ? "" : ";\n")), this.source.merge(); }, lookupPropertyFunctionVarDeclaration: function () { return "\n lookupProperty = container.lookupProperty || function(parent, propertyName) {\n if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {\n return parent[propertyName];\n }\n return undefined\n }\n ".trim(); }, blockValue: function (t) { var e = this.aliasable("container.hooks.blockHelperMissing"), r = [this.contextName(0)]; this.setupHelperArgs(t, 0, r); var s = this.popStack(); r.splice(1, 0, s), this.push(this.source.functionCall(e, "call", r)); }, ambiguousBlockValue: function () { var t = this.aliasable("container.hooks.blockHelperMissing"), e = [this.contextName(0)]; this.setupHelperArgs("", 0, e, !0), this.flushInline(); var r = this.topStack(); e.splice(1, 0, r), this.pushSource(["if (!", this.lastHelper, ") { ", r, " = ", this.source.functionCall(t, "call", e), "}"]); }, appendContent: function (t) { this.pendingContent ? t = this.pendingContent + t : this.pendingLocation = this.source.currentLocation, this.pendingContent = t; }, append: function () { if (this.isInline()) - this.replaceStack((function (t) { return [" != null ? ", t, ' : ""']; })), this.pushSource(this.appendToBuffer(this.popStack())); - else { - var t = this.popStack(); - this.pushSource(["if (", t, " != null) { ", this.appendToBuffer(t, void 0, !0), " }"]), this.environment.isSimple && this.pushSource(["else { ", this.appendToBuffer("''", void 0, !0), " }"]); - } }, appendEscaped: function () { this.pushSource(this.appendToBuffer([this.aliasable("container.escapeExpression"), "(", this.popStack(), ")"])); }, getContext: function (t) { this.lastContext = t; }, pushContext: function () { this.pushStackLiteral(this.contextName(this.lastContext)); }, lookupOnContext: function (t, e, r, s) { var i = 0; s || !this.options.compat || this.lastContext ? this.pushContext() : this.push(this.depthedLookup(t[i++])), this.resolvePath("context", t, i, e, r); }, lookupBlockParam: function (t, e) { this.useBlockParams = !0, this.push(["blockParams[", t[0], "][", t[1], "]"]), this.resolvePath("context", e, 1); }, lookupData: function (t, e, r) { t ? this.pushStackLiteral("container.data(data, " + t + ")") : this.pushStackLiteral("data"), this.resolvePath("data", e, 0, !0, r); }, resolvePath: function (t, e, r, s, i) { var n = this; if (this.options.strict || this.options.assumeObjects) - this.push(function (t, e, r, s, i) { var n = e.popStack(), o = r.length; t && o--; for (; s < o; s++) - n = e.nameLookup(n, r[s], i); return t ? [e.aliasable("container.strict"), "(", n, ", ", e.quotedString(r[s]), ", ", JSON.stringify(e.source.currentLocation), " )"] : n; }(this.options.strict && i, this, e, r, t)); - else - for (var o = e.length; r < o; r++) - this.replaceStack((function (i) { var o = n.nameLookup(i, e[r], t); return s ? [" && ", o] : [" != null ? ", o, " : ", i]; })); }, resolvePossibleLambda: function () { this.push([this.aliasable("container.lambda"), "(", this.popStack(), ", ", this.contextName(0), ")"]); }, pushStringParam: function (t, e) { this.pushContext(), this.pushString(e), "SubExpression" !== e && ("string" == typeof t ? this.pushString(t) : this.pushStackLiteral(t)); }, emptyHash: function (t) { this.trackIds && this.push("{}"), this.stringParams && (this.push("{}"), this.push("{}")), this.pushStackLiteral(t ? "undefined" : "{}"); }, pushHash: function () { this.hash && this.hashes.push(this.hash), this.hash = { values: {}, types: [], contexts: [], ids: [] }; }, popHash: function () { var t = this.hash; this.hash = this.hashes.pop(), this.trackIds && this.push(this.objectLiteral(t.ids)), this.stringParams && (this.push(this.objectLiteral(t.contexts)), this.push(this.objectLiteral(t.types))), this.push(this.objectLiteral(t.values)); }, pushString: function (t) { this.pushStackLiteral(this.quotedString(t)); }, pushLiteral: function (t) { this.pushStackLiteral(t); }, pushProgram: function (t) { null != t ? this.pushStackLiteral(this.programExpression(t)) : this.pushStackLiteral(null); }, registerDecorator: function (t, e) { var r = this.nameLookup("decorators", e, "decorator"), s = this.setupHelperArgs(e, t); this.decorators.push(["fn = ", this.decorators.functionCall(r, "", ["fn", "props", "container", s]), " || fn;"]); }, invokeHelper: function (t, e, r) { var s = this.popStack(), i = this.setupHelper(t, e), n = []; r && n.push(i.name), n.push(s), this.options.strict || n.push(this.aliasable("container.hooks.helperMissing")); var o = ["(", this.itemsSeparatedBy(n, "||"), ")"], a = this.source.functionCall(o, "call", i.callParams); this.push(a); }, itemsSeparatedBy: function (t, e) { var r = []; r.push(t[0]); for (var s = 1; s < t.length; s++) - r.push(e, t[s]); return r; }, invokeKnownHelper: function (t, e) { var r = this.setupHelper(t, e); this.push(this.source.functionCall(r.name, "call", r.callParams)); }, invokeAmbiguous: function (t, e) { this.useRegister("helper"); var r = this.popStack(); this.emptyHash(); var s = this.setupHelper(0, t, e), i = ["(", "(helper = ", this.lastHelper = this.nameLookup("helpers", t, "helper"), " || ", r, ")"]; this.options.strict || (i[0] = "(helper = ", i.push(" != null ? helper : ", this.aliasable("container.hooks.helperMissing"))), this.push(["(", i, s.paramsInit ? ["),(", s.paramsInit] : [], "),", "(typeof helper === ", this.aliasable('"function"'), " ? ", this.source.functionCall("helper", "call", s.callParams), " : helper))"]); }, invokePartial: function (t, e, r) { var s = [], i = this.setupParams(e, 1, s); t && (e = this.popStack(), delete i.name), r && (i.indent = JSON.stringify(r)), i.helpers = "helpers", i.partials = "partials", i.decorators = "container.decorators", t ? s.unshift(e) : s.unshift(this.nameLookup("partials", e, "partial")), this.options.compat && (i.depths = "depths"), i = this.objectLiteral(i), s.push(i), this.push(this.source.functionCall("container.invokePartial", "", s)); }, assignToHash: function (t) { var e = this.popStack(), r = void 0, s = void 0, i = void 0; this.trackIds && (i = this.popStack()), this.stringParams && (s = this.popStack(), r = this.popStack()); var n = this.hash; r && (n.contexts[t] = r), s && (n.types[t] = s), i && (n.ids[t] = i), n.values[t] = e; }, pushId: function (t, e, r) { "BlockParam" === t ? this.pushStackLiteral("blockParams[" + e[0] + "].path[" + e[1] + "]" + (r ? " + " + JSON.stringify("." + r) : "")) : "PathExpression" === t ? this.pushString(e) : "SubExpression" === t ? this.pushStackLiteral("true") : this.pushStackLiteral("null"); }, compiler: p, compileChildren: function (t, e) { for (var r = t.children, s = void 0, i = void 0, n = 0, o = r.length; n < o; n++) { - s = r[n], i = new this.compiler; - var a = this.matchExistingProgram(s); - if (null == a) { - this.context.programs.push(""); - var l = this.context.programs.length; - s.index = l, s.name = "program" + l, this.context.programs[l] = i.compile(s, e, this.context, !this.precompile), this.context.decorators[l] = i.decorators, this.context.environments[l] = s, this.useDepths = this.useDepths || i.useDepths, this.useBlockParams = this.useBlockParams || i.useBlockParams, s.useDepths = this.useDepths, s.useBlockParams = this.useBlockParams; - } - else - s.index = a.index, s.name = "program" + a.index, this.useDepths = this.useDepths || a.useDepths, this.useBlockParams = this.useBlockParams || a.useBlockParams; - } }, matchExistingProgram: function (t) { for (var e = 0, r = this.context.environments.length; e < r; e++) { - var s = this.context.environments[e]; - if (s && s.equals(t)) - return s; - } }, programExpression: function (t) { var e = this.environment.children[t], r = [e.index, "data", e.blockParams]; return (this.useBlockParams || this.useDepths) && r.push("blockParams"), this.useDepths && r.push("depths"), "container.program(" + r.join(", ") + ")"; }, useRegister: function (t) { this.registers[t] || (this.registers[t] = !0, this.registers.list.push(t)); }, push: function (t) { return t instanceof c || (t = this.source.wrap(t)), this.inlineStack.push(t), t; }, pushStackLiteral: function (t) { this.push(new c(t)); }, pushSource: function (t) { this.pendingContent && (this.source.push(this.appendToBuffer(this.source.quotedString(this.pendingContent), this.pendingLocation)), this.pendingContent = void 0), t && this.source.push(t); }, replaceStack: function (t) { var e = ["("], r = void 0, s = void 0, i = void 0; if (!this.isInline()) - throw new o.default("replaceStack on non-inline"); var n = this.popStack(!0); if (n instanceof c) - e = ["(", r = [n.value]], i = !0; - else { - s = !0; - var a = this.incrStack(); - e = ["((", this.push(a), " = ", n, ")"], r = this.topStack(); - } var l = t.call(this, r); i || this.popStack(), s && this.stackSlot--, this.push(e.concat(l, ")")); }, incrStack: function () { return this.stackSlot++, this.stackSlot > this.stackVars.length && this.stackVars.push("stack" + this.stackSlot), this.topStackName(); }, topStackName: function () { return "stack" + this.stackSlot; }, flushInline: function () { var t = this.inlineStack; this.inlineStack = []; for (var e = 0, r = t.length; e < r; e++) { - var s = t[e]; - if (s instanceof c) - this.compileStack.push(s); - else { - var i = this.incrStack(); - this.pushSource([i, " = ", s, ";"]), this.compileStack.push(i); - } - } }, isInline: function () { return this.inlineStack.length; }, popStack: function (t) { var e = this.isInline(), r = (e ? this.inlineStack : this.compileStack).pop(); if (!t && r instanceof c) - return r.value; if (!e) { - if (!this.stackSlot) - throw new o.default("Invalid stack pop"); - this.stackSlot--; - } return r; }, topStack: function () { var t = this.isInline() ? this.inlineStack : this.compileStack, e = t[t.length - 1]; return e instanceof c ? e.value : e; }, contextName: function (t) { return this.useDepths && t ? "depths[" + t + "]" : "depth" + t; }, quotedString: function (t) { return this.source.quotedString(t); }, objectLiteral: function (t) { return this.source.objectLiteral(t); }, aliasable: function (t) { var e = this.aliases[t]; return e ? (e.referenceCount++, e) : ((e = this.aliases[t] = this.source.wrap(t)).aliasable = !0, e.referenceCount = 1, e); }, setupHelper: function (t, e, r) { var s = []; return { params: s, paramsInit: this.setupHelperArgs(e, t, s, r), name: this.nameLookup("helpers", e, "helper"), callParams: [this.aliasable(this.contextName(0) + " != null ? " + this.contextName(0) + " : (container.nullContext || {})")].concat(s) }; }, setupParams: function (t, e, r) { var s = {}, i = [], n = [], o = [], a = !r, l = void 0; a && (r = []), s.name = this.quotedString(t), s.hash = this.popStack(), this.trackIds && (s.hashIds = this.popStack()), this.stringParams && (s.hashTypes = this.popStack(), s.hashContexts = this.popStack()); var c = this.popStack(), p = this.popStack(); (p || c) && (s.fn = p || "container.noop", s.inverse = c || "container.noop"); for (var h = e; h--;) - l = this.popStack(), r[h] = l, this.trackIds && (o[h] = this.popStack()), this.stringParams && (n[h] = this.popStack(), i[h] = this.popStack()); return a && (s.args = this.source.generateArray(r)), this.trackIds && (s.ids = this.source.generateArray(o)), this.stringParams && (s.types = this.source.generateArray(n), s.contexts = this.source.generateArray(i)), this.options.data && (s.data = "data"), this.useBlockParams && (s.blockParams = "blockParams"), s; }, setupHelperArgs: function (t, e, r, s) { var i = this.setupParams(t, e, r); return i.loc = JSON.stringify(this.source.currentLocation), i = this.objectLiteral(i), s ? (this.useRegister("options"), r.push("options"), ["options=", i]) : r ? (r.push(i), "") : i; } }, function () { for (var t = "break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield await null true false".split(" "), e = p.RESERVED_WORDS = {}, r = 0, s = t.length; r < s; r++) - e[t[r]] = !0; }(), p.isValidJavaScriptVariableName = function (t) { return !p.RESERVED_WORDS[t] && /^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(t); }, e.default = p, t.exports = e.default; }(Ht, Ht.exports), function (t, r) { function s(t) { return t && t.__esModule ? t : { default: t }; } r.__esModule = !0; var i = s(e.exports), n = s(ut.exports), o = ft, a = Lt, l = s(Ht.exports), c = s(gt.exports), p = s(ht.exports), h = i.default.create; function u() { var t = h(); return t.compile = function (e, r) { return a.compile(e, r, t); }, t.precompile = function (e, r) { return a.precompile(e, r, t); }, t.AST = n.default, t.Compiler = a.Compiler, t.JavaScriptCompiler = l.default, t.Parser = o.parser, t.parse = o.parse, t.parseWithoutProcessing = o.parseWithoutProcessing, t; } var f = u(); f.create = u, p.default(f), f.Visitor = c.default, f.default = f, r.default = f, t.exports = r.default; }(t, t.exports); -var Rt = t.exports, jt = t.exports.__esModule; -export { jt as __esModule, Rt as default }; -//# sourceMappingURL=/sm/3d42de05bb0e3ecf6003f94da42455f7519c72c5b0fbec32ebd1ddbfe6b99c51.map diff --git a/modules/ui-module/src/main/resources/manager/js/libs/sortablejs.min.js b/modules/ui-module/src/main/resources/manager/js/libs/sortablejs.min.js deleted file mode 100644 index 75aa1c8ba..000000000 --- a/modules/ui-module/src/main/resources/manager/js/libs/sortablejs.min.js +++ /dev/null @@ -1,516 +0,0 @@ -/** - * Bundled by jsDelivr using Rollup v2.79.2 and Terser v5.39.0. - * Original file: /npm/sortablejs@1.15.6/modular/sortable.esm.js - * - * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files - */ -/**! - * Sortable 1.15.6 - * @author RubaXa - * @author owenm - * @license MIT - */ -function t(t, e) { var n = Object.keys(t); if (Object.getOwnPropertySymbols) { - var o = Object.getOwnPropertySymbols(t); - e && (o = o.filter((function (e) { return Object.getOwnPropertyDescriptor(t, e).enumerable; }))), n.push.apply(n, o); -} return n; } -function e(e) { for (var n = 1; n < arguments.length; n++) { - var i = null != arguments[n] ? arguments[n] : {}; - n % 2 ? t(Object(i), !0).forEach((function (t) { o(e, t, i[t]); })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(i)) : t(Object(i)).forEach((function (t) { Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(i, t)); })); -} return e; } -function n(t) { return n = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; }, n(t); } -function o(t, e, n) { return e in t ? Object.defineProperty(t, e, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = n, t; } -function i() { return i = Object.assign || function (t) { for (var e = 1; e < arguments.length; e++) { - var n = arguments[e]; - for (var o in n) - Object.prototype.hasOwnProperty.call(n, o) && (t[o] = n[o]); -} return t; }, i.apply(this, arguments); } -function r(t, e) { if (null == t) - return {}; var n, o, i = function (t, e) { if (null == t) - return {}; var n, o, i = {}, r = Object.keys(t); for (o = 0; o < r.length; o++) - n = r[o], e.indexOf(n) >= 0 || (i[n] = t[n]); return i; }(t, e); if (Object.getOwnPropertySymbols) { - var r = Object.getOwnPropertySymbols(t); - for (o = 0; o < r.length; o++) - n = r[o], e.indexOf(n) >= 0 || Object.prototype.propertyIsEnumerable.call(t, n) && (i[n] = t[n]); -} return i; } -function a(t) { return function (t) { if (Array.isArray(t)) - return l(t); }(t) || function (t) { if ("undefined" != typeof Symbol && null != t[Symbol.iterator] || null != t["@@iterator"]) - return Array.from(t); }(t) || function (t, e) { if (!t) - return; if ("string" == typeof t) - return l(t, e); var n = Object.prototype.toString.call(t).slice(8, -1); "Object" === n && t.constructor && (n = t.constructor.name); if ("Map" === n || "Set" === n) - return Array.from(t); if ("Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) - return l(t, e); }(t) || function () { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }(); } -function l(t, e) { (null == e || e > t.length) && (e = t.length); for (var n = 0, o = new Array(e); n < e; n++) - o[n] = t[n]; return o; } -function s(t) { if ("undefined" != typeof window && window.navigator) - return !!navigator.userAgent.match(t); } -var c = s(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i), u = s(/Edge/i), d = s(/firefox/i), h = s(/safari/i) && !s(/chrome/i) && !s(/android/i), f = s(/iP(ad|od|hone)/i), p = s(/chrome/i) && s(/android/i), g = { capture: !1, passive: !1 }; -function v(t, e, n) { t.addEventListener(e, n, !c && g); } -function m(t, e, n) { t.removeEventListener(e, n, !c && g); } -function b(t, e) { if (e) { - if (">" === e[0] && (e = e.substring(1)), t) - try { - if (t.matches) - return t.matches(e); - if (t.msMatchesSelector) - return t.msMatchesSelector(e); - if (t.webkitMatchesSelector) - return t.webkitMatchesSelector(e); - } - catch (t) { - return !1; - } - return !1; -} } -function y(t) { return t.host && t !== document && t.host.nodeType ? t.host : t.parentNode; } -function w(t, e, n, o) { if (t) { - n = n || document; - do { - if (null != e && (">" === e[0] ? t.parentNode === n && b(t, e) : b(t, e)) || o && t === n) - return t; - if (t === n) - break; - } while (t = y(t)); -} return null; } -var D, E = /\s+/g; -function S(t, e, n) { if (t && e) - if (t.classList) - t.classList[n ? "add" : "remove"](e); - else { - var o = (" " + t.className + " ").replace(E, " ").replace(" " + e + " ", " "); - t.className = (o + (n ? " " + e : "")).replace(E, " "); - } } -function _(t, e, n) { var o = t && t.style; if (o) { - if (void 0 === n) - return document.defaultView && document.defaultView.getComputedStyle ? n = document.defaultView.getComputedStyle(t, "") : t.currentStyle && (n = t.currentStyle), void 0 === e ? n : n[e]; - e in o || -1 !== e.indexOf("webkit") || (e = "-webkit-" + e), o[e] = n + ("string" == typeof n ? "" : "px"); -} } -function C(t, e) { var n = ""; if ("string" == typeof t) - n = t; -else - do { - var o = _(t, "transform"); - o && "none" !== o && (n = o + " " + n); - } while (!e && (t = t.parentNode)); var i = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix; return i && new i(n); } -function T(t, e, n) { if (t) { - var o = t.getElementsByTagName(e), i = 0, r = o.length; - if (n) - for (; i < r; i++) - n(o[i], i); - return o; -} return []; } -function x() { var t = document.scrollingElement; return t || document.documentElement; } -function O(t, e, n, o, i) { if (t.getBoundingClientRect || t === window) { - var r, a, l, s, u, d, h; - if (t !== window && t.parentNode && t !== x() ? (a = (r = t.getBoundingClientRect()).top, l = r.left, s = r.bottom, u = r.right, d = r.height, h = r.width) : (a = 0, l = 0, s = window.innerHeight, u = window.innerWidth, d = window.innerHeight, h = window.innerWidth), (e || n) && t !== window && (i = i || t.parentNode, !c)) - do { - if (i && i.getBoundingClientRect && ("none" !== _(i, "transform") || n && "static" !== _(i, "position"))) { - var f = i.getBoundingClientRect(); - a -= f.top + parseInt(_(i, "border-top-width")), l -= f.left + parseInt(_(i, "border-left-width")), s = a + r.height, u = l + r.width; - break; - } - } while (i = i.parentNode); - if (o && t !== window) { - var p = C(i || t), g = p && p.a, v = p && p.d; - p && (s = (a /= v) + (d /= v), u = (l /= g) + (h /= g)); - } - return { top: a, left: l, bottom: s, right: u, width: h, height: d }; -} } -function M(t, e, n) { for (var o = k(t, !0), i = O(t)[e]; o;) { - var r = O(o)[n]; - if (!("top" === n || "left" === n ? i >= r : i <= r)) - return o; - if (o === x()) - break; - o = k(o, !1); -} return !1; } -function A(t, e, n, o) { for (var i = 0, r = 0, a = t.children; r < a.length;) { - if ("none" !== a[r].style.display && a[r] !== Ht.ghost && (o || a[r] !== Ht.dragged) && w(a[r], n.draggable, t, !1)) { - if (i === e) - return a[r]; - i++; - } - r++; -} return null; } -function N(t, e) { for (var n = t.lastElementChild; n && (n === Ht.ghost || "none" === _(n, "display") || e && !b(n, e));) - n = n.previousElementSibling; return n || null; } -function I(t, e) { var n = 0; if (!t || !t.parentNode) - return -1; for (; t = t.previousElementSibling;) - "TEMPLATE" === t.nodeName.toUpperCase() || t === Ht.clone || e && !b(t, e) || n++; return n; } -function P(t) { var e = 0, n = 0, o = x(); if (t) - do { - var i = C(t), r = i.a, a = i.d; - e += t.scrollLeft * r, n += t.scrollTop * a; - } while (t !== o && (t = t.parentNode)); return [e, n]; } -function k(t, e) { if (!t || !t.getBoundingClientRect) - return x(); var n = t, o = !1; do { - if (n.clientWidth < n.scrollWidth || n.clientHeight < n.scrollHeight) { - var i = _(n); - if (n.clientWidth < n.scrollWidth && ("auto" == i.overflowX || "scroll" == i.overflowX) || n.clientHeight < n.scrollHeight && ("auto" == i.overflowY || "scroll" == i.overflowY)) { - if (!n.getBoundingClientRect || n === document.body) - return x(); - if (o || e) - return n; - o = !0; - } - } -} while (n = n.parentNode); return x(); } -function R(t, e) { return Math.round(t.top) === Math.round(e.top) && Math.round(t.left) === Math.round(e.left) && Math.round(t.height) === Math.round(e.height) && Math.round(t.width) === Math.round(e.width); } -function X(t, e) { return function () { if (!D) { - var n = arguments; - 1 === n.length ? t.call(this, n[0]) : t.apply(this, n), D = setTimeout((function () { D = void 0; }), e); -} }; } -function Y(t, e, n) { t.scrollLeft += e, t.scrollTop += n; } -function B(t) { var e = window.Polymer, n = window.jQuery || window.Zepto; return e && e.dom ? e.dom(t).cloneNode(!0) : n ? n(t).clone(!0)[0] : t.cloneNode(!0); } -function F(t, e) { _(t, "position", "absolute"), _(t, "top", e.top), _(t, "left", e.left), _(t, "width", e.width), _(t, "height", e.height); } -function j(t) { _(t, "position", ""), _(t, "top", ""), _(t, "left", ""), _(t, "width", ""), _(t, "height", ""); } -function H(t, e, n) { var o = {}; return Array.from(t.children).forEach((function (i) { var r, a, l, s; if (w(i, e.draggable, t, !1) && !i.animated && i !== n) { - var c = O(i); - o.left = Math.min(null !== (r = o.left) && void 0 !== r ? r : 1 / 0, c.left), o.top = Math.min(null !== (a = o.top) && void 0 !== a ? a : 1 / 0, c.top), o.right = Math.max(null !== (l = o.right) && void 0 !== l ? l : -1 / 0, c.right), o.bottom = Math.max(null !== (s = o.bottom) && void 0 !== s ? s : -1 / 0, c.bottom); -} })), o.width = o.right - o.left, o.height = o.bottom - o.top, o.x = o.left, o.y = o.top, o; } -var L = "Sortable" + (new Date).getTime(); -function K() { var t, n = []; return { captureAnimationState: function () { (n = [], this.options.animation) && [].slice.call(this.el.children).forEach((function (t) { if ("none" !== _(t, "display") && t !== Ht.ghost) { - n.push({ target: t, rect: O(t) }); - var o = e({}, n[n.length - 1].rect); - if (t.thisAnimationDuration) { - var i = C(t, !0); - i && (o.top -= i.f, o.left -= i.e); - } - t.fromRect = o; - } })); }, addAnimationState: function (t) { n.push(t); }, removeAnimationState: function (t) { n.splice(function (t, e) { for (var n in t) - if (t.hasOwnProperty(n)) - for (var o in e) - if (e.hasOwnProperty(o) && e[o] === t[n][o]) - return Number(n); return -1; }(n, { target: t }), 1); }, animateAll: function (e) { var o = this; if (!this.options.animation) - return clearTimeout(t), void ("function" == typeof e && e()); var i = !1, r = 0; n.forEach((function (t) { var e = 0, n = t.target, a = n.fromRect, l = O(n), s = n.prevFromRect, c = n.prevToRect, u = t.rect, d = C(n, !0); d && (l.top -= d.f, l.left -= d.e), n.toRect = l, n.thisAnimationDuration && R(s, l) && !R(a, l) && (u.top - l.top) / (u.left - l.left) == (a.top - l.top) / (a.left - l.left) && (e = function (t, e, n, o) { return Math.sqrt(Math.pow(e.top - t.top, 2) + Math.pow(e.left - t.left, 2)) / Math.sqrt(Math.pow(e.top - n.top, 2) + Math.pow(e.left - n.left, 2)) * o.animation; }(u, s, c, o.options)), R(l, a) || (n.prevFromRect = a, n.prevToRect = l, e || (e = o.options.animation), o.animate(n, u, l, e)), e && (i = !0, r = Math.max(r, e), clearTimeout(n.animationResetTimer), n.animationResetTimer = setTimeout((function () { n.animationTime = 0, n.prevFromRect = null, n.fromRect = null, n.prevToRect = null, n.thisAnimationDuration = null; }), e), n.thisAnimationDuration = e); })), clearTimeout(t), i ? t = setTimeout((function () { "function" == typeof e && e(); }), r) : "function" == typeof e && e(), n = []; }, animate: function (t, e, n, o) { if (o) { - _(t, "transition", ""), _(t, "transform", ""); - var i = C(this.el), r = i && i.a, a = i && i.d, l = (e.left - n.left) / (r || 1), s = (e.top - n.top) / (a || 1); - t.animatingX = !!l, t.animatingY = !!s, _(t, "transform", "translate3d(" + l + "px," + s + "px,0)"), this.forRepaintDummy = function (t) { return t.offsetWidth; }(t), _(t, "transition", "transform " + o + "ms" + (this.options.easing ? " " + this.options.easing : "")), _(t, "transform", "translate3d(0,0,0)"), "number" == typeof t.animated && clearTimeout(t.animated), t.animated = setTimeout((function () { _(t, "transition", ""), _(t, "transform", ""), t.animated = !1, t.animatingX = !1, t.animatingY = !1; }), o); - } } }; } -var W = [], z = { initializeByDefault: !0 }, G = { mount: function (t) { for (var e in z) - z.hasOwnProperty(e) && !(e in t) && (t[e] = z[e]); W.forEach((function (e) { if (e.pluginName === t.pluginName) - throw "Sortable: Cannot mount plugin ".concat(t.pluginName, " more than once"); })), W.push(t); }, pluginEvent: function (t, n, o) { var i = this; this.eventCanceled = !1, o.cancel = function () { i.eventCanceled = !0; }; var r = t + "Global"; W.forEach((function (i) { n[i.pluginName] && (n[i.pluginName][r] && n[i.pluginName][r](e({ sortable: n }, o)), n.options[i.pluginName] && n[i.pluginName][t] && n[i.pluginName][t](e({ sortable: n }, o))); })); }, initializePlugins: function (t, e, n, o) { for (var r in W.forEach((function (o) { var r = o.pluginName; if (t.options[r] || o.initializeByDefault) { - var a = new o(t, e, t.options); - a.sortable = t, a.options = t.options, t[r] = a, i(n, a.defaults); - } })), t.options) - if (t.options.hasOwnProperty(r)) { - var a = this.modifyOption(t, r, t.options[r]); - void 0 !== a && (t.options[r] = a); - } }, getEventProperties: function (t, e) { var n = {}; return W.forEach((function (o) { "function" == typeof o.eventProperties && i(n, o.eventProperties.call(e[o.pluginName], t)); })), n; }, modifyOption: function (t, e, n) { var o; return W.forEach((function (i) { t[i.pluginName] && i.optionListeners && "function" == typeof i.optionListeners[e] && (o = i.optionListeners[e].call(t[i.pluginName], n)); })), o; } }; -function U(t) { var n = t.sortable, o = t.rootEl, i = t.name, r = t.targetEl, a = t.cloneEl, l = t.toEl, s = t.fromEl, d = t.oldIndex, h = t.newIndex, f = t.oldDraggableIndex, p = t.newDraggableIndex, g = t.originalEvent, v = t.putSortable, m = t.extraEventProperties; if (n = n || o && o[L]) { - var b, y = n.options, w = "on" + i.charAt(0).toUpperCase() + i.substr(1); - !window.CustomEvent || c || u ? (b = document.createEvent("Event")).initEvent(i, !0, !0) : b = new CustomEvent(i, { bubbles: !0, cancelable: !0 }), b.to = l || o, b.from = s || o, b.item = r || o, b.clone = a, b.oldIndex = d, b.newIndex = h, b.oldDraggableIndex = f, b.newDraggableIndex = p, b.originalEvent = g, b.pullMode = v ? v.lastPutMode : void 0; - var D = e(e({}, m), G.getEventProperties(i, n)); - for (var E in D) - b[E] = D[E]; - o && o.dispatchEvent(b), y[w] && y[w].call(n, b); -} } -var q = ["evt"], V = function (t, n) { var o = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}, i = o.evt, a = r(o, q); G.pluginEvent.bind(Ht)(t, n, e({ dragEl: $, parentEl: Q, ghostEl: J, rootEl: tt, nextEl: et, lastDownEl: nt, cloneEl: ot, cloneHidden: it, dragStarted: mt, putSortable: ut, activeSortable: Ht.active, originalEvent: i, oldIndex: rt, oldDraggableIndex: lt, newIndex: at, newDraggableIndex: st, hideGhostForTarget: Yt, unhideGhostForTarget: Bt, cloneNowHidden: function () { it = !0; }, cloneNowShown: function () { it = !1; }, dispatchSortableEvent: function (t) { Z({ sortable: n, name: t, originalEvent: i }); } }, a)); }; -function Z(t) { U(e({ putSortable: ut, cloneEl: ot, targetEl: $, rootEl: tt, oldIndex: rt, oldDraggableIndex: lt, newIndex: at, newDraggableIndex: st }, t)); } -var $, Q, J, tt, et, nt, ot, it, rt, at, lt, st, ct, ut, dt, ht, ft, pt, gt, vt, mt, bt, yt, wt, Dt, Et = !1, St = !1, _t = [], Ct = !1, Tt = !1, xt = [], Ot = !1, Mt = [], At = "undefined" != typeof document, Nt = f, It = u || c ? "cssFloat" : "float", Pt = At && !p && !f && "draggable" in document.createElement("div"), kt = function () { if (At) { - if (c) - return !1; - var t = document.createElement("x"); - return t.style.cssText = "pointer-events:auto", "auto" === t.style.pointerEvents; -} }(), Rt = function (t, e) { var n = _(t), o = parseInt(n.width) - parseInt(n.paddingLeft) - parseInt(n.paddingRight) - parseInt(n.borderLeftWidth) - parseInt(n.borderRightWidth), i = A(t, 0, e), r = A(t, 1, e), a = i && _(i), l = r && _(r), s = a && parseInt(a.marginLeft) + parseInt(a.marginRight) + O(i).width, c = l && parseInt(l.marginLeft) + parseInt(l.marginRight) + O(r).width; if ("flex" === n.display) - return "column" === n.flexDirection || "column-reverse" === n.flexDirection ? "vertical" : "horizontal"; if ("grid" === n.display) - return n.gridTemplateColumns.split(" ").length <= 1 ? "vertical" : "horizontal"; if (i && a.float && "none" !== a.float) { - var u = "left" === a.float ? "left" : "right"; - return !r || "both" !== l.clear && l.clear !== u ? "horizontal" : "vertical"; -} return i && ("block" === a.display || "flex" === a.display || "table" === a.display || "grid" === a.display || s >= o && "none" === n[It] || r && "none" === n[It] && s + c > o) ? "vertical" : "horizontal"; }, Xt = function (t) { function e(t, n) { return function (o, i, r, a) { var l = o.options.group.name && i.options.group.name && o.options.group.name === i.options.group.name; if (null == t && (n || l)) - return !0; if (null == t || !1 === t) - return !1; if (n && "clone" === t) - return t; if ("function" == typeof t) - return e(t(o, i, r, a), n)(o, i, r, a); var s = (n ? o : i).options.group.name; return !0 === t || "string" == typeof t && t === s || t.join && t.indexOf(s) > -1; }; } var o = {}, i = t.group; i && "object" == n(i) || (i = { name: i }), o.name = i.name, o.checkPull = e(i.pull, !0), o.checkPut = e(i.put), o.revertClone = i.revertClone, t.group = o; }, Yt = function () { !kt && J && _(J, "display", "none"); }, Bt = function () { !kt && J && _(J, "display", ""); }; -At && !p && document.addEventListener("click", (function (t) { if (St) - return t.preventDefault(), t.stopPropagation && t.stopPropagation(), t.stopImmediatePropagation && t.stopImmediatePropagation(), St = !1, !1; }), !0); -var Ft = function (t) { if ($) { - t = t.touches ? t.touches[0] : t; - var e = (i = t.clientX, r = t.clientY, _t.some((function (t) { var e = t[L].options.emptyInsertThreshold; if (e && !N(t)) { - var n = O(t), o = i >= n.left - e && i <= n.right + e, l = r >= n.top - e && r <= n.bottom + e; - return o && l ? a = t : void 0; - } })), a); - if (e) { - var n = {}; - for (var o in t) - t.hasOwnProperty(o) && (n[o] = t[o]); - n.target = n.rootEl = e, n.preventDefault = void 0, n.stopPropagation = void 0, e[L]._onDragOver(n); - } -} var i, r, a; }, jt = function (t) { $ && $.parentNode[L]._isOutsideThisEl(t.target); }; -function Ht(t, e) { if (!t || !t.nodeType || 1 !== t.nodeType) - throw "Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t)); this.el = t, this.options = e = i({}, e), t[L] = this; var n = { group: null, sort: !0, disabled: !1, store: null, handle: null, draggable: /^[uo]l$/i.test(t.nodeName) ? ">li" : ">*", swapThreshold: 1, invertSwap: !1, invertedSwapThreshold: null, removeCloneOnHide: !0, direction: function () { return Rt(t, this.options); }, ghostClass: "sortable-ghost", chosenClass: "sortable-chosen", dragClass: "sortable-drag", ignore: "a, img", filter: null, preventOnFilter: !0, animation: 0, easing: null, setData: function (t, e) { t.setData("Text", e.textContent); }, dropBubble: !1, dragoverBubble: !1, dataIdAttr: "data-id", delay: 0, delayOnTouchOnly: !1, touchStartThreshold: (Number.parseInt ? Number : window).parseInt(window.devicePixelRatio, 10) || 1, forceFallback: !1, fallbackClass: "sortable-fallback", fallbackOnBody: !1, fallbackTolerance: 0, fallbackOffset: { x: 0, y: 0 }, supportPointer: !1 !== Ht.supportPointer && "PointerEvent" in window && (!h || f), emptyInsertThreshold: 5 }; for (var o in G.initializePlugins(this, t, n), n) - !(o in e) && (e[o] = n[o]); for (var r in Xt(e), this) - "_" === r.charAt(0) && "function" == typeof this[r] && (this[r] = this[r].bind(this)); this.nativeDraggable = !e.forceFallback && Pt, this.nativeDraggable && (this.options.touchStartThreshold = 1), e.supportPointer ? v(t, "pointerdown", this._onTapStart) : (v(t, "mousedown", this._onTapStart), v(t, "touchstart", this._onTapStart)), this.nativeDraggable && (v(t, "dragover", this), v(t, "dragenter", this)), _t.push(this.el), e.store && e.store.get && this.sort(e.store.get(this) || []), i(this, K()); } -function Lt(t, e, n, o, i, r, a, l) { var s, d, h = t[L], f = h.options.onMove; return !window.CustomEvent || c || u ? (s = document.createEvent("Event")).initEvent("move", !0, !0) : s = new CustomEvent("move", { bubbles: !0, cancelable: !0 }), s.to = e, s.from = t, s.dragged = n, s.draggedRect = o, s.related = i || e, s.relatedRect = r || O(e), s.willInsertAfter = l, s.originalEvent = a, t.dispatchEvent(s), f && (d = f.call(h, s, a)), d; } -function Kt(t) { t.draggable = !1; } -function Wt() { Ot = !1; } -function zt(t) { for (var e = t.tagName + t.className + t.src + t.href + t.textContent, n = e.length, o = 0; n--;) - o += e.charCodeAt(n); return o.toString(36); } -function Gt(t) { return setTimeout(t, 0); } -function Ut(t) { return clearTimeout(t); } -Ht.prototype = { constructor: Ht, _isOutsideThisEl: function (t) { this.el.contains(t) || t === this.el || (bt = null); }, _getDirection: function (t, e) { return "function" == typeof this.options.direction ? this.options.direction.call(this, t, e, $) : this.options.direction; }, _onTapStart: function (t) { if (t.cancelable) { - var e = this, n = this.el, o = this.options, i = o.preventOnFilter, r = t.type, a = t.touches && t.touches[0] || t.pointerType && "touch" === t.pointerType && t, l = (a || t).target, s = t.target.shadowRoot && (t.path && t.path[0] || t.composedPath && t.composedPath()[0]) || l, c = o.filter; - if (function (t) { Mt.length = 0; var e = t.getElementsByTagName("input"), n = e.length; for (; n--;) { - var o = e[n]; - o.checked && Mt.push(o); - } }(n), !$ && !(/mousedown|pointerdown/.test(r) && 0 !== t.button || o.disabled) && !s.isContentEditable && (this.nativeDraggable || !h || !l || "SELECT" !== l.tagName.toUpperCase()) && !((l = w(l, o.draggable, n, !1)) && l.animated || nt === l)) { - if (rt = I(l), lt = I(l, o.draggable), "function" == typeof c) { - if (c.call(this, t, l, this)) - return Z({ sortable: e, rootEl: s, name: "filter", targetEl: l, toEl: n, fromEl: n }), V("filter", e, { evt: t }), void (i && t.preventDefault()); - } - else if (c && (c = c.split(",").some((function (o) { if (o = w(s, o.trim(), n, !1)) - return Z({ sortable: e, rootEl: o, name: "filter", targetEl: l, fromEl: n, toEl: n }), V("filter", e, { evt: t }), !0; })))) - return void (i && t.preventDefault()); - o.handle && !w(s, o.handle, n, !1) || this._prepareDragStart(t, a, l); - } - } }, _prepareDragStart: function (t, e, n) { var o, i = this, r = i.el, a = i.options, l = r.ownerDocument; if (n && !$ && n.parentNode === r) { - var s = O(n); - if (tt = r, Q = ($ = n).parentNode, et = $.nextSibling, nt = n, ct = a.group, Ht.dragged = $, dt = { target: $, clientX: (e || t).clientX, clientY: (e || t).clientY }, gt = dt.clientX - s.left, vt = dt.clientY - s.top, this._lastX = (e || t).clientX, this._lastY = (e || t).clientY, $.style["will-change"] = "all", o = function () { V("delayEnded", i, { evt: t }), Ht.eventCanceled ? i._onDrop() : (i._disableDelayedDragEvents(), !d && i.nativeDraggable && ($.draggable = !0), i._triggerDragStart(t, e), Z({ sortable: i, name: "choose", originalEvent: t }), S($, a.chosenClass, !0)); }, a.ignore.split(",").forEach((function (t) { T($, t.trim(), Kt); })), v(l, "dragover", Ft), v(l, "mousemove", Ft), v(l, "touchmove", Ft), a.supportPointer ? (v(l, "pointerup", i._onDrop), !this.nativeDraggable && v(l, "pointercancel", i._onDrop)) : (v(l, "mouseup", i._onDrop), v(l, "touchend", i._onDrop), v(l, "touchcancel", i._onDrop)), d && this.nativeDraggable && (this.options.touchStartThreshold = 4, $.draggable = !0), V("delayStart", this, { evt: t }), !a.delay || a.delayOnTouchOnly && !e || this.nativeDraggable && (u || c)) - o(); - else { - if (Ht.eventCanceled) - return void this._onDrop(); - a.supportPointer ? (v(l, "pointerup", i._disableDelayedDrag), v(l, "pointercancel", i._disableDelayedDrag)) : (v(l, "mouseup", i._disableDelayedDrag), v(l, "touchend", i._disableDelayedDrag), v(l, "touchcancel", i._disableDelayedDrag)), v(l, "mousemove", i._delayedDragTouchMoveHandler), v(l, "touchmove", i._delayedDragTouchMoveHandler), a.supportPointer && v(l, "pointermove", i._delayedDragTouchMoveHandler), i._dragStartTimer = setTimeout(o, a.delay); - } - } }, _delayedDragTouchMoveHandler: function (t) { var e = t.touches ? t.touches[0] : t; Math.max(Math.abs(e.clientX - this._lastX), Math.abs(e.clientY - this._lastY)) >= Math.floor(this.options.touchStartThreshold / (this.nativeDraggable && window.devicePixelRatio || 1)) && this._disableDelayedDrag(); }, _disableDelayedDrag: function () { $ && Kt($), clearTimeout(this._dragStartTimer), this._disableDelayedDragEvents(); }, _disableDelayedDragEvents: function () { var t = this.el.ownerDocument; m(t, "mouseup", this._disableDelayedDrag), m(t, "touchend", this._disableDelayedDrag), m(t, "touchcancel", this._disableDelayedDrag), m(t, "pointerup", this._disableDelayedDrag), m(t, "pointercancel", this._disableDelayedDrag), m(t, "mousemove", this._delayedDragTouchMoveHandler), m(t, "touchmove", this._delayedDragTouchMoveHandler), m(t, "pointermove", this._delayedDragTouchMoveHandler); }, _triggerDragStart: function (t, e) { e = e || "touch" == t.pointerType && t, !this.nativeDraggable || e ? this.options.supportPointer ? v(document, "pointermove", this._onTouchMove) : v(document, e ? "touchmove" : "mousemove", this._onTouchMove) : (v($, "dragend", this), v(tt, "dragstart", this._onDragStart)); try { - document.selection ? Gt((function () { document.selection.empty(); })) : window.getSelection().removeAllRanges(); - } - catch (t) { } }, _dragStarted: function (t, e) { if (Et = !1, tt && $) { - V("dragStarted", this, { evt: e }), this.nativeDraggable && v(document, "dragover", jt); - var n = this.options; - !t && S($, n.dragClass, !1), S($, n.ghostClass, !0), Ht.active = this, t && this._appendGhost(), Z({ sortable: this, name: "start", originalEvent: e }); - } - else - this._nulling(); }, _emulateDragOver: function () { if (ht) { - this._lastX = ht.clientX, this._lastY = ht.clientY, Yt(); - for (var t = document.elementFromPoint(ht.clientX, ht.clientY), e = t; t && t.shadowRoot && (t = t.shadowRoot.elementFromPoint(ht.clientX, ht.clientY)) !== e;) - e = t; - if ($.parentNode[L]._isOutsideThisEl(t), e) - do { - if (e[L]) { - if (e[L]._onDragOver({ clientX: ht.clientX, clientY: ht.clientY, target: t, rootEl: e }) && !this.options.dragoverBubble) - break; - } - t = e; - } while (e = y(e)); - Bt(); - } }, _onTouchMove: function (t) { if (dt) { - var e = this.options, n = e.fallbackTolerance, o = e.fallbackOffset, i = t.touches ? t.touches[0] : t, r = J && C(J, !0), a = J && r && r.a, l = J && r && r.d, s = Nt && Dt && P(Dt), c = (i.clientX - dt.clientX + o.x) / (a || 1) + (s ? s[0] - xt[0] : 0) / (a || 1), u = (i.clientY - dt.clientY + o.y) / (l || 1) + (s ? s[1] - xt[1] : 0) / (l || 1); - if (!Ht.active && !Et) { - if (n && Math.max(Math.abs(i.clientX - this._lastX), Math.abs(i.clientY - this._lastY)) < n) - return; - this._onDragStart(t, !0); - } - if (J) { - r ? (r.e += c - (ft || 0), r.f += u - (pt || 0)) : r = { a: 1, b: 0, c: 0, d: 1, e: c, f: u }; - var d = "matrix(".concat(r.a, ",").concat(r.b, ",").concat(r.c, ",").concat(r.d, ",").concat(r.e, ",").concat(r.f, ")"); - _(J, "webkitTransform", d), _(J, "mozTransform", d), _(J, "msTransform", d), _(J, "transform", d), ft = c, pt = u, ht = i; - } - t.cancelable && t.preventDefault(); - } }, _appendGhost: function () { if (!J) { - var t = this.options.fallbackOnBody ? document.body : tt, e = O($, !0, Nt, !0, t), n = this.options; - if (Nt) { - for (Dt = t; "static" === _(Dt, "position") && "none" === _(Dt, "transform") && Dt !== document;) - Dt = Dt.parentNode; - Dt !== document.body && Dt !== document.documentElement ? (Dt === document && (Dt = x()), e.top += Dt.scrollTop, e.left += Dt.scrollLeft) : Dt = x(), xt = P(Dt); - } - S(J = $.cloneNode(!0), n.ghostClass, !1), S(J, n.fallbackClass, !0), S(J, n.dragClass, !0), _(J, "transition", ""), _(J, "transform", ""), _(J, "box-sizing", "border-box"), _(J, "margin", 0), _(J, "top", e.top), _(J, "left", e.left), _(J, "width", e.width), _(J, "height", e.height), _(J, "opacity", "0.8"), _(J, "position", Nt ? "absolute" : "fixed"), _(J, "zIndex", "100000"), _(J, "pointerEvents", "none"), Ht.ghost = J, t.appendChild(J), _(J, "transform-origin", gt / parseInt(J.style.width) * 100 + "% " + vt / parseInt(J.style.height) * 100 + "%"); - } }, _onDragStart: function (t, e) { var n = this, o = t.dataTransfer, i = n.options; V("dragStart", this, { evt: t }), Ht.eventCanceled ? this._onDrop() : (V("setupClone", this), Ht.eventCanceled || ((ot = B($)).removeAttribute("id"), ot.draggable = !1, ot.style["will-change"] = "", this._hideClone(), S(ot, this.options.chosenClass, !1), Ht.clone = ot), n.cloneId = Gt((function () { V("clone", n), Ht.eventCanceled || (n.options.removeCloneOnHide || tt.insertBefore(ot, $), n._hideClone(), Z({ sortable: n, name: "clone" })); })), !e && S($, i.dragClass, !0), e ? (St = !0, n._loopId = setInterval(n._emulateDragOver, 50)) : (m(document, "mouseup", n._onDrop), m(document, "touchend", n._onDrop), m(document, "touchcancel", n._onDrop), o && (o.effectAllowed = "move", i.setData && i.setData.call(n, o, $)), v(document, "drop", n), _($, "transform", "translateZ(0)")), Et = !0, n._dragStartId = Gt(n._dragStarted.bind(n, e, t)), v(document, "selectstart", n), mt = !0, window.getSelection().removeAllRanges(), h && _(document.body, "user-select", "none")); }, _onDragOver: function (t) { var n, o, i, r, a = this.el, l = t.target, s = this.options, c = s.group, u = Ht.active, d = ct === c, h = s.sort, f = ut || u, p = this, g = !1; if (!Ot) { - if (void 0 !== t.preventDefault && t.cancelable && t.preventDefault(), l = w(l, s.draggable, a, !0), F("dragOver"), Ht.eventCanceled) - return g; - if ($.contains(t.target) || l.animated && l.animatingX && l.animatingY || p._ignoreWhileAnimating === l) - return K(!1); - if (St = !1, u && !s.disabled && (d ? h || (i = Q !== tt) : ut === this || (this.lastPutMode = ct.checkPull(this, u, $, t)) && c.checkPut(this, u, $, t))) { - if (r = "vertical" === this._getDirection(t, l), n = O($), F("dragOverValid"), Ht.eventCanceled) - return g; - if (i) - return Q = tt, j(), this._hideClone(), F("revert"), Ht.eventCanceled || (et ? tt.insertBefore($, et) : tt.appendChild($)), K(!0); - var v = N(a, s.draggable); - if (!v || function (t, e, n) { var o = O(N(n.el, n.options.draggable)), i = H(n.el, n.options, J), r = 10; return e ? t.clientX > i.right + r || t.clientY > o.bottom && t.clientX > o.left : t.clientY > i.bottom + r || t.clientX > o.right && t.clientY > o.top; }(t, r, this) && !v.animated) { - if (v === $) - return K(!1); - if (v && a === t.target && (l = v), l && (o = O(l)), !1 !== Lt(tt, a, $, n, l, o, t, !!l)) - return j(), v && v.nextSibling ? a.insertBefore($, v.nextSibling) : a.appendChild($), Q = a, W(), K(!0); - } - else if (v && function (t, e, n) { var o = O(A(n.el, 0, n.options, !0)), i = H(n.el, n.options, J), r = 10; return e ? t.clientX < i.left - r || t.clientY < o.top && t.clientX < o.right : t.clientY < i.top - r || t.clientY < o.bottom && t.clientX < o.left; }(t, r, this)) { - var m = A(a, 0, s, !0); - if (m === $) - return K(!1); - if (o = O(l = m), !1 !== Lt(tt, a, $, n, l, o, t, !1)) - return j(), a.insertBefore($, m), Q = a, W(), K(!0); - } - else if (l.parentNode === a) { - o = O(l); - var b, y, D, E = $.parentNode !== a, C = !function (t, e, n) { var o = n ? t.left : t.top, i = n ? t.right : t.bottom, r = n ? t.width : t.height, a = n ? e.left : e.top, l = n ? e.right : e.bottom, s = n ? e.width : e.height; return o === a || i === l || o + r / 2 === a + s / 2; }($.animated && $.toRect || n, l.animated && l.toRect || o, r), T = r ? "top" : "left", x = M(l, "top", "top") || M($, "top", "top"), P = x ? x.scrollTop : void 0; - if (bt !== l && (y = o[T], Ct = !1, Tt = !C && s.invertSwap || E), b = function (t, e, n, o, i, r, a, l) { var s = o ? t.clientY : t.clientX, c = o ? n.height : n.width, u = o ? n.top : n.left, d = o ? n.bottom : n.right, h = !1; if (!a) - if (l && wt < c * i) { - if (!Ct && (1 === yt ? s > u + c * r / 2 : s < d - c * r / 2) && (Ct = !0), Ct) - h = !0; - else if (1 === yt ? s < u + wt : s > d - wt) - return -yt; - } - else if (s > u + c * (1 - i) / 2 && s < d - c * (1 - i) / 2) - return function (t) { return I($) < I(t) ? 1 : -1; }(e); if ((h = h || a) && (s < u + c * r / 2 || s > d - c * r / 2)) - return s > u + c / 2 ? 1 : -1; return 0; }(t, l, o, r, C ? 1 : s.swapThreshold, null == s.invertedSwapThreshold ? s.swapThreshold : s.invertedSwapThreshold, Tt, bt === l), 0 !== b) { - var k = I($); - do { - k -= b, D = Q.children[k]; - } while (D && ("none" === _(D, "display") || D === J)); - } - if (0 === b || D === l) - return K(!1); - bt = l, yt = b; - var R = l.nextElementSibling, X = !1, B = Lt(tt, a, $, n, l, o, t, X = 1 === b); - if (!1 !== B) - return 1 !== B && -1 !== B || (X = 1 === B), Ot = !0, setTimeout(Wt, 30), j(), X && !R ? a.appendChild($) : l.parentNode.insertBefore($, X ? R : l), x && Y(x, 0, P - x.scrollTop), Q = $.parentNode, void 0 === y || Tt || (wt = Math.abs(y - O(l)[T])), W(), K(!0); - } - if (a.contains($)) - return K(!1); - } - return !1; - } function F(s, c) { V(s, p, e({ evt: t, isOwner: d, axis: r ? "vertical" : "horizontal", revert: i, dragRect: n, targetRect: o, canSort: h, fromSortable: f, target: l, completed: K, onMove: function (e, o) { return Lt(tt, a, $, n, e, O(e), t, o); }, changed: W }, c)); } function j() { F("dragOverAnimationCapture"), p.captureAnimationState(), p !== f && f.captureAnimationState(); } function K(e) { return F("dragOverCompleted", { insertion: e }), e && (d ? u._hideClone() : u._showClone(p), p !== f && (S($, ut ? ut.options.ghostClass : u.options.ghostClass, !1), S($, s.ghostClass, !0)), ut !== p && p !== Ht.active ? ut = p : p === Ht.active && ut && (ut = null), f === p && (p._ignoreWhileAnimating = l), p.animateAll((function () { F("dragOverAnimationComplete"), p._ignoreWhileAnimating = null; })), p !== f && (f.animateAll(), f._ignoreWhileAnimating = null)), (l === $ && !$.animated || l === a && !l.animated) && (bt = null), s.dragoverBubble || t.rootEl || l === document || ($.parentNode[L]._isOutsideThisEl(t.target), !e && Ft(t)), !s.dragoverBubble && t.stopPropagation && t.stopPropagation(), g = !0; } function W() { at = I($), st = I($, s.draggable), Z({ sortable: p, name: "change", toEl: a, newIndex: at, newDraggableIndex: st, originalEvent: t }); } }, _ignoreWhileAnimating: null, _offMoveEvents: function () { m(document, "mousemove", this._onTouchMove), m(document, "touchmove", this._onTouchMove), m(document, "pointermove", this._onTouchMove), m(document, "dragover", Ft), m(document, "mousemove", Ft), m(document, "touchmove", Ft); }, _offUpEvents: function () { var t = this.el.ownerDocument; m(t, "mouseup", this._onDrop), m(t, "touchend", this._onDrop), m(t, "pointerup", this._onDrop), m(t, "pointercancel", this._onDrop), m(t, "touchcancel", this._onDrop), m(document, "selectstart", this); }, _onDrop: function (t) { var e = this.el, n = this.options; at = I($), st = I($, n.draggable), V("drop", this, { evt: t }), Q = $ && $.parentNode, at = I($), st = I($, n.draggable), Ht.eventCanceled || (Et = !1, Tt = !1, Ct = !1, clearInterval(this._loopId), clearTimeout(this._dragStartTimer), Ut(this.cloneId), Ut(this._dragStartId), this.nativeDraggable && (m(document, "drop", this), m(e, "dragstart", this._onDragStart)), this._offMoveEvents(), this._offUpEvents(), h && _(document.body, "user-select", ""), _($, "transform", ""), t && (mt && (t.cancelable && t.preventDefault(), !n.dropBubble && t.stopPropagation()), J && J.parentNode && J.parentNode.removeChild(J), (tt === Q || ut && "clone" !== ut.lastPutMode) && ot && ot.parentNode && ot.parentNode.removeChild(ot), $ && (this.nativeDraggable && m($, "dragend", this), Kt($), $.style["will-change"] = "", mt && !Et && S($, ut ? ut.options.ghostClass : this.options.ghostClass, !1), S($, this.options.chosenClass, !1), Z({ sortable: this, name: "unchoose", toEl: Q, newIndex: null, newDraggableIndex: null, originalEvent: t }), tt !== Q ? (at >= 0 && (Z({ rootEl: Q, name: "add", toEl: Q, fromEl: tt, originalEvent: t }), Z({ sortable: this, name: "remove", toEl: Q, originalEvent: t }), Z({ rootEl: Q, name: "sort", toEl: Q, fromEl: tt, originalEvent: t }), Z({ sortable: this, name: "sort", toEl: Q, originalEvent: t })), ut && ut.save()) : at !== rt && at >= 0 && (Z({ sortable: this, name: "update", toEl: Q, originalEvent: t }), Z({ sortable: this, name: "sort", toEl: Q, originalEvent: t })), Ht.active && (null != at && -1 !== at || (at = rt, st = lt), Z({ sortable: this, name: "end", toEl: Q, originalEvent: t }), this.save())))), this._nulling(); }, _nulling: function () { V("nulling", this), tt = $ = Q = J = et = ot = nt = it = dt = ht = mt = at = st = rt = lt = bt = yt = ut = ct = Ht.dragged = Ht.ghost = Ht.clone = Ht.active = null, Mt.forEach((function (t) { t.checked = !0; })), Mt.length = ft = pt = 0; }, handleEvent: function (t) { switch (t.type) { - case "drop": - case "dragend": - this._onDrop(t); - break; - case "dragenter": - case "dragover": - $ && (this._onDragOver(t), function (t) { t.dataTransfer && (t.dataTransfer.dropEffect = "move"); t.cancelable && t.preventDefault(); }(t)); - break; - case "selectstart": t.preventDefault(); - } }, toArray: function () { for (var t, e = [], n = this.el.children, o = 0, i = n.length, r = this.options; o < i; o++) - w(t = n[o], r.draggable, this.el, !1) && e.push(t.getAttribute(r.dataIdAttr) || zt(t)); return e; }, sort: function (t, e) { var n = {}, o = this.el; this.toArray().forEach((function (t, e) { var i = o.children[e]; w(i, this.options.draggable, o, !1) && (n[t] = i); }), this), e && this.captureAnimationState(), t.forEach((function (t) { n[t] && (o.removeChild(n[t]), o.appendChild(n[t])); })), e && this.animateAll(); }, save: function () { var t = this.options.store; t && t.set && t.set(this); }, closest: function (t, e) { return w(t, e || this.options.draggable, this.el, !1); }, option: function (t, e) { var n = this.options; if (void 0 === e) - return n[t]; var o = G.modifyOption(this, t, e); n[t] = void 0 !== o ? o : e, "group" === t && Xt(n); }, destroy: function () { V("destroy", this); var t = this.el; t[L] = null, m(t, "mousedown", this._onTapStart), m(t, "touchstart", this._onTapStart), m(t, "pointerdown", this._onTapStart), this.nativeDraggable && (m(t, "dragover", this), m(t, "dragenter", this)), Array.prototype.forEach.call(t.querySelectorAll("[draggable]"), (function (t) { t.removeAttribute("draggable"); })), this._onDrop(), this._disableDelayedDragEvents(), _t.splice(_t.indexOf(this.el), 1), this.el = t = null; }, _hideClone: function () { if (!it) { - if (V("hideClone", this), Ht.eventCanceled) - return; - _(ot, "display", "none"), this.options.removeCloneOnHide && ot.parentNode && ot.parentNode.removeChild(ot), it = !0; - } }, _showClone: function (t) { if ("clone" === t.lastPutMode) { - if (it) { - if (V("showClone", this), Ht.eventCanceled) - return; - $.parentNode != tt || this.options.group.revertClone ? et ? tt.insertBefore(ot, et) : tt.appendChild(ot) : tt.insertBefore(ot, $), this.options.group.revertClone && this.animate($, ot), _(ot, "display", ""), it = !1; - } - } - else - this._hideClone(); } }, At && v(document, "touchmove", (function (t) { (Ht.active || Et) && t.cancelable && t.preventDefault(); })), Ht.utils = { on: v, off: m, css: _, find: T, is: function (t, e) { return !!w(t, e, t, !1); }, extend: function (t, e) { if (t && e) - for (var n in e) - e.hasOwnProperty(n) && (t[n] = e[n]); return t; }, throttle: X, closest: w, toggleClass: S, clone: B, index: I, nextTick: Gt, cancelNextTick: Ut, detectDirection: Rt, getChild: A, expando: L }, Ht.get = function (t) { return t[L]; }, Ht.mount = function () { for (var t = arguments.length, n = new Array(t), o = 0; o < t; o++) - n[o] = arguments[o]; n[0].constructor === Array && (n = n[0]), n.forEach((function (t) { if (!t.prototype || !t.prototype.constructor) - throw "Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(t)); t.utils && (Ht.utils = e(e({}, Ht.utils), t.utils)), G.mount(t); })); }, Ht.create = function (t, e) { return new Ht(t, e); }, Ht.version = "1.15.6"; -var qt, Vt, Zt, $t, Qt, Jt, te = [], ee = !1; -function ne() { te.forEach((function (t) { clearInterval(t.pid); })), te = []; } -function oe() { clearInterval(Jt); } -var ie, re = X((function (t, e, n, o) { if (e.scroll) { - var i, r = (t.touches ? t.touches[0] : t).clientX, a = (t.touches ? t.touches[0] : t).clientY, l = e.scrollSensitivity, s = e.scrollSpeed, c = x(), u = !1; - Vt !== n && (Vt = n, ne(), qt = e.scroll, i = e.scrollFn, !0 === qt && (qt = k(n, !0))); - var d = 0, h = qt; - do { - var f = h, p = O(f), g = p.top, v = p.bottom, m = p.left, b = p.right, y = p.width, w = p.height, D = void 0, E = void 0, S = f.scrollWidth, C = f.scrollHeight, T = _(f), M = f.scrollLeft, A = f.scrollTop; - f === c ? (D = y < S && ("auto" === T.overflowX || "scroll" === T.overflowX || "visible" === T.overflowX), E = w < C && ("auto" === T.overflowY || "scroll" === T.overflowY || "visible" === T.overflowY)) : (D = y < S && ("auto" === T.overflowX || "scroll" === T.overflowX), E = w < C && ("auto" === T.overflowY || "scroll" === T.overflowY)); - var N = D && (Math.abs(b - r) <= l && M + y < S) - (Math.abs(m - r) <= l && !!M), I = E && (Math.abs(v - a) <= l && A + w < C) - (Math.abs(g - a) <= l && !!A); - if (!te[d]) - for (var P = 0; P <= d; P++) - te[P] || (te[P] = {}); - te[d].vx == N && te[d].vy == I && te[d].el === f || (te[d].el = f, te[d].vx = N, te[d].vy = I, clearInterval(te[d].pid), 0 == N && 0 == I || (u = !0, te[d].pid = setInterval(function () { o && 0 === this.layer && Ht.active._onTouchMove(Qt); var e = te[this.layer].vy ? te[this.layer].vy * s : 0, n = te[this.layer].vx ? te[this.layer].vx * s : 0; "function" == typeof i && "continue" !== i.call(Ht.dragged.parentNode[L], n, e, t, Qt, te[this.layer].el) || Y(te[this.layer].el, n, e); }.bind({ layer: d }), 24))), d++; - } while (e.bubbleScroll && h !== c && (h = k(h, !1))); - ee = u; -} }), 30), ae = function (t) { var e = t.originalEvent, n = t.putSortable, o = t.dragEl, i = t.activeSortable, r = t.dispatchSortableEvent, a = t.hideGhostForTarget, l = t.unhideGhostForTarget; if (e) { - var s = n || i; - a(); - var c = e.changedTouches && e.changedTouches.length ? e.changedTouches[0] : e, u = document.elementFromPoint(c.clientX, c.clientY); - l(), s && !s.el.contains(u) && (r("spill"), this.onSpill({ dragEl: o, putSortable: n })); -} }; -function le() { } -function se() { } -function ce() { function t() { this.defaults = { swapClass: "sortable-swap-highlight" }; } return t.prototype = { dragStart: function (t) { var e = t.dragEl; ie = e; }, dragOverValid: function (t) { var e = t.completed, n = t.target, o = t.onMove, i = t.activeSortable, r = t.changed, a = t.cancel; if (i.options.swap) { - var l = this.sortable.el, s = this.options; - if (n && n !== l) { - var c = ie; - !1 !== o(n) ? (S(n, s.swapClass, !0), ie = n) : ie = null, c && c !== ie && S(c, s.swapClass, !1); - } - r(), e(!0), a(); - } }, drop: function (t) { var e = t.activeSortable, n = t.putSortable, o = t.dragEl, i = n || this.sortable, r = this.options; ie && S(ie, r.swapClass, !1), ie && (r.swap || n && n.options.swap) && o !== ie && (i.captureAnimationState(), i !== e && e.captureAnimationState(), function (t, e) { var n, o, i = t.parentNode, r = e.parentNode; if (!i || !r || i.isEqualNode(e) || r.isEqualNode(t)) - return; n = I(t), o = I(e), i.isEqualNode(r) && n < o && o++; i.insertBefore(e, i.children[n]), r.insertBefore(t, r.children[o]); }(o, ie), i.animateAll(), i !== e && e.animateAll()); }, nulling: function () { ie = null; } }, i(t, { pluginName: "swap", eventProperties: function () { return { swapItem: ie }; } }); } -le.prototype = { startIndex: null, dragStart: function (t) { var e = t.oldDraggableIndex; this.startIndex = e; }, onSpill: function (t) { var e = t.dragEl, n = t.putSortable; this.sortable.captureAnimationState(), n && n.captureAnimationState(); var o = A(this.sortable.el, this.startIndex, this.options); o ? this.sortable.el.insertBefore(e, o) : this.sortable.el.appendChild(e), this.sortable.animateAll(), n && n.animateAll(); }, drop: ae }, i(le, { pluginName: "revertOnSpill" }), se.prototype = { onSpill: function (t) { var e = t.dragEl, n = t.putSortable || this.sortable; n.captureAnimationState(), e.parentNode && e.parentNode.removeChild(e), n.animateAll(); }, drop: ae }, i(se, { pluginName: "removeOnSpill" }); -var ue, de, he, fe, pe, ge = [], ve = [], me = !1, be = !1, ye = !1; -function we() { function t(t) { for (var e in this) - "_" === e.charAt(0) && "function" == typeof this[e] && (this[e] = this[e].bind(this)); t.options.avoidImplicitDeselect || (t.options.supportPointer ? v(document, "pointerup", this._deselectMultiDrag) : (v(document, "mouseup", this._deselectMultiDrag), v(document, "touchend", this._deselectMultiDrag))), v(document, "keydown", this._checkKeyDown), v(document, "keyup", this._checkKeyUp), this.defaults = { selectedClass: "sortable-selected", multiDragKey: null, avoidImplicitDeselect: !1, setData: function (e, n) { var o = ""; ge.length && de === t ? ge.forEach((function (t, e) { o += (e ? ", " : "") + t.textContent; })) : o = n.textContent, e.setData("Text", o); } }; } return t.prototype = { multiDragKeyDown: !1, isMultiDrag: !1, delayStartGlobal: function (t) { var e = t.dragEl; he = e; }, delayEnded: function () { this.isMultiDrag = ~ge.indexOf(he); }, setupClone: function (t) { var e = t.sortable, n = t.cancel; if (this.isMultiDrag) { - for (var o = 0; o < ge.length; o++) - ve.push(B(ge[o])), ve[o].sortableIndex = ge[o].sortableIndex, ve[o].draggable = !1, ve[o].style["will-change"] = "", S(ve[o], this.options.selectedClass, !1), ge[o] === he && S(ve[o], this.options.chosenClass, !1); - e._hideClone(), n(); - } }, clone: function (t) { var e = t.sortable, n = t.rootEl, o = t.dispatchSortableEvent, i = t.cancel; this.isMultiDrag && (this.options.removeCloneOnHide || ge.length && de === e && (De(!0, n), o("clone"), i())); }, showClone: function (t) { var e = t.cloneNowShown, n = t.rootEl, o = t.cancel; this.isMultiDrag && (De(!1, n), ve.forEach((function (t) { _(t, "display", ""); })), e(), pe = !1, o()); }, hideClone: function (t) { var e = this; t.sortable; var n = t.cloneNowHidden, o = t.cancel; this.isMultiDrag && (ve.forEach((function (t) { _(t, "display", "none"), e.options.removeCloneOnHide && t.parentNode && t.parentNode.removeChild(t); })), n(), pe = !0, o()); }, dragStartGlobal: function (t) { t.sortable, !this.isMultiDrag && de && de.multiDrag._deselectMultiDrag(), ge.forEach((function (t) { t.sortableIndex = I(t); })), ge = ge.sort((function (t, e) { return t.sortableIndex - e.sortableIndex; })), ye = !0; }, dragStarted: function (t) { var e = this, n = t.sortable; if (this.isMultiDrag) { - if (this.options.sort && (n.captureAnimationState(), this.options.animation)) { - ge.forEach((function (t) { t !== he && _(t, "position", "absolute"); })); - var o = O(he, !1, !0, !0); - ge.forEach((function (t) { t !== he && F(t, o); })), be = !0, me = !0; - } - n.animateAll((function () { be = !1, me = !1, e.options.animation && ge.forEach((function (t) { j(t); })), e.options.sort && Ee(); })); - } }, dragOver: function (t) { var e = t.target, n = t.completed, o = t.cancel; be && ~ge.indexOf(e) && (n(!1), o()); }, revert: function (t) { var e = t.fromSortable, n = t.rootEl, o = t.sortable, i = t.dragRect; ge.length > 1 && (ge.forEach((function (t) { o.addAnimationState({ target: t, rect: be ? O(t) : i }), j(t), t.fromRect = i, e.removeAnimationState(t); })), be = !1, function (t, e) { ge.forEach((function (n, o) { var i = e.children[n.sortableIndex + (t ? Number(o) : 0)]; i ? e.insertBefore(n, i) : e.appendChild(n); })); }(!this.options.removeCloneOnHide, n)); }, dragOverCompleted: function (t) { var e = t.sortable, n = t.isOwner, o = t.insertion, i = t.activeSortable, r = t.parentEl, a = t.putSortable, l = this.options; if (o) { - if (n && i._hideClone(), me = !1, l.animation && ge.length > 1 && (be || !n && !i.options.sort && !a)) { - var s = O(he, !1, !0, !0); - ge.forEach((function (t) { t !== he && (F(t, s), r.appendChild(t)); })), be = !0; - } - if (!n) - if (be || Ee(), ge.length > 1) { - var c = pe; - i._showClone(e), i.options.animation && !pe && c && ve.forEach((function (t) { i.addAnimationState({ target: t, rect: fe }), t.fromRect = fe, t.thisAnimationDuration = null; })); - } - else - i._showClone(e); - } }, dragOverAnimationCapture: function (t) { var e = t.dragRect, n = t.isOwner, o = t.activeSortable; if (ge.forEach((function (t) { t.thisAnimationDuration = null; })), o.options.animation && !n && o.multiDrag.isMultiDrag) { - fe = i({}, e); - var r = C(he, !0); - fe.top -= r.f, fe.left -= r.e; - } }, dragOverAnimationComplete: function () { be && (be = !1, Ee()); }, drop: function (t) { var e = t.originalEvent, n = t.rootEl, o = t.parentEl, i = t.sortable, r = t.dispatchSortableEvent, a = t.oldIndex, l = t.putSortable, s = l || this.sortable; if (e) { - var c = this.options, u = o.children; - if (!ye) - if (c.multiDragKey && !this.multiDragKeyDown && this._deselectMultiDrag(), S(he, c.selectedClass, !~ge.indexOf(he)), ~ge.indexOf(he)) - ge.splice(ge.indexOf(he), 1), ue = null, U({ sortable: i, rootEl: n, name: "deselect", targetEl: he, originalEvent: e }); - else { - if (ge.push(he), U({ sortable: i, rootEl: n, name: "select", targetEl: he, originalEvent: e }), e.shiftKey && ue && i.el.contains(ue)) { - var d = I(ue), h = I(he); - ~d && ~h && d !== h && function () { var t, r; h > d ? (r = d, t = h) : (r = h, t = d + 1); for (var a = c.filter; r < t; r++) { - if (!~ge.indexOf(u[r])) - if (w(u[r], c.draggable, o, !1)) - a && ("function" == typeof a ? a.call(i, e, u[r], i) : a.split(",").some((function (t) { return w(u[r], t.trim(), o, !1); }))) || (S(u[r], c.selectedClass, !0), ge.push(u[r]), U({ sortable: i, rootEl: n, name: "select", targetEl: u[r], originalEvent: e })); - } }(); - } - else - ue = he; - de = s; - } - if (ye && this.isMultiDrag) { - if (be = !1, (o[L].options.sort || o !== n) && ge.length > 1) { - var f = O(he), p = I(he, ":not(." + this.options.selectedClass + ")"); - if (!me && c.animation && (he.thisAnimationDuration = null), s.captureAnimationState(), !me && (c.animation && (he.fromRect = f, ge.forEach((function (t) { if (t.thisAnimationDuration = null, t !== he) { - var e = be ? O(t) : f; - t.fromRect = e, s.addAnimationState({ target: t, rect: e }); - } }))), Ee(), ge.forEach((function (t) { u[p] ? o.insertBefore(t, u[p]) : o.appendChild(t), p++; })), a === I(he))) { - var g = !1; - ge.forEach((function (t) { t.sortableIndex === I(t) || (g = !0); })), g && (r("update"), r("sort")); - } - ge.forEach((function (t) { j(t); })), s.animateAll(); - } - de = s; - } - (n === o || l && "clone" !== l.lastPutMode) && ve.forEach((function (t) { t.parentNode && t.parentNode.removeChild(t); })); - } }, nullingGlobal: function () { this.isMultiDrag = ye = !1, ve.length = 0; }, destroyGlobal: function () { this._deselectMultiDrag(), m(document, "pointerup", this._deselectMultiDrag), m(document, "mouseup", this._deselectMultiDrag), m(document, "touchend", this._deselectMultiDrag), m(document, "keydown", this._checkKeyDown), m(document, "keyup", this._checkKeyUp); }, _deselectMultiDrag: function (t) { if (!(void 0 !== ye && ye || de !== this.sortable || t && w(t.target, this.options.draggable, this.sortable.el, !1) || t && 0 !== t.button)) - for (; ge.length;) { - var e = ge[0]; - S(e, this.options.selectedClass, !1), ge.shift(), U({ sortable: this.sortable, rootEl: this.sortable.el, name: "deselect", targetEl: e, originalEvent: t }); - } }, _checkKeyDown: function (t) { t.key === this.options.multiDragKey && (this.multiDragKeyDown = !0); }, _checkKeyUp: function (t) { t.key === this.options.multiDragKey && (this.multiDragKeyDown = !1); } }, i(t, { pluginName: "multiDrag", utils: { select: function (t) { var e = t.parentNode[L]; e && e.options.multiDrag && !~ge.indexOf(t) && (de && de !== e && (de.multiDrag._deselectMultiDrag(), de = e), S(t, e.options.selectedClass, !0), ge.push(t)); }, deselect: function (t) { var e = t.parentNode[L], n = ge.indexOf(t); e && e.options.multiDrag && ~n && (S(t, e.options.selectedClass, !1), ge.splice(n, 1)); } }, eventProperties: function () { var t = this, e = [], n = []; return ge.forEach((function (o) { var i; e.push({ multiDragElement: o, index: o.sortableIndex }), i = be && o !== he ? -1 : be ? I(o, ":not(." + t.options.selectedClass + ")") : I(o), n.push({ multiDragElement: o, index: i }); })), { items: a(ge), clones: [].concat(ve), oldIndicies: e, newIndicies: n }; }, optionListeners: { multiDragKey: function (t) { return "ctrl" === (t = t.toLowerCase()) ? t = "Control" : t.length > 1 && (t = t.charAt(0).toUpperCase() + t.substr(1)), t; } } }); } -function De(t, e) { ve.forEach((function (n, o) { var i = e.children[n.sortableIndex + (t ? Number(o) : 0)]; i ? e.insertBefore(n, i) : e.appendChild(n); })); } -function Ee() { ge.forEach((function (t) { t !== he && t.parentNode && t.parentNode.removeChild(t); })); } -Ht.mount(new function () { function t() { for (var t in this.defaults = { scroll: !0, forceAutoScrollFallback: !1, scrollSensitivity: 30, scrollSpeed: 10, bubbleScroll: !0 }, this) - "_" === t.charAt(0) && "function" == typeof this[t] && (this[t] = this[t].bind(this)); } return t.prototype = { dragStarted: function (t) { var e = t.originalEvent; this.sortable.nativeDraggable ? v(document, "dragover", this._handleAutoScroll) : this.options.supportPointer ? v(document, "pointermove", this._handleFallbackAutoScroll) : e.touches ? v(document, "touchmove", this._handleFallbackAutoScroll) : v(document, "mousemove", this._handleFallbackAutoScroll); }, dragOverCompleted: function (t) { var e = t.originalEvent; this.options.dragOverBubble || e.rootEl || this._handleAutoScroll(e); }, drop: function () { this.sortable.nativeDraggable ? m(document, "dragover", this._handleAutoScroll) : (m(document, "pointermove", this._handleFallbackAutoScroll), m(document, "touchmove", this._handleFallbackAutoScroll), m(document, "mousemove", this._handleFallbackAutoScroll)), oe(), ne(), clearTimeout(D), D = void 0; }, nulling: function () { Qt = Vt = qt = ee = Jt = Zt = $t = null, te.length = 0; }, _handleFallbackAutoScroll: function (t) { this._handleAutoScroll(t, !0); }, _handleAutoScroll: function (t, e) { var n = this, o = (t.touches ? t.touches[0] : t).clientX, i = (t.touches ? t.touches[0] : t).clientY, r = document.elementFromPoint(o, i); if (Qt = t, e || this.options.forceAutoScrollFallback || u || c || h) { - re(t, this.options, r, e); - var a = k(r, !0); - !ee || Jt && o === Zt && i === $t || (Jt && oe(), Jt = setInterval((function () { var r = k(document.elementFromPoint(o, i), !0); r !== a && (a = r, ne()), re(t, n.options, r, e); }), 10), Zt = o, $t = i); - } - else { - if (!this.options.bubbleScroll || k(r, !0) === x()) - return void ne(); - re(t, this.options, k(r, !1), !1); - } } }, i(t, { pluginName: "scroll", initializeByDefault: !0 }); }), Ht.mount(se, le); -export { we as MultiDrag, Ht as Sortable, ce as Swap, Ht as default }; -//# sourceMappingURL=/sm/5d7e5cf4455b72a57c7259b1d7c4fa1fdb9f4cd69f516cb0361cb58f3f33668c.map diff --git a/modules/ui-module/src/main/resources/manager/js/manager-globals.d.ts b/modules/ui-module/src/main/resources/manager/js/manager-globals.d.ts new file mode 100644 index 000000000..b0099043b --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/js/manager-globals.d.ts @@ -0,0 +1,38 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +declare function executeScriptAction(action: any): Promise; +declare function executeHookAction(action: any): Promise; +/** + * Patches a relative path so that it's correctly prefixed with the given manager base path. + * + * @param {string} relativePath e.g. "/manager/module" + * @param {string} managerBasePath e.g. "/manager" or "/de/manager" + * @returns {string} e.g. "/de/manager/module" + */ +declare function patchManagerPath(relativePath: string, managerBasePath: string): string; +/** + * Patches a path with the context path, if not already present. + * + * @param {string} path - The original path (e.g. "/assets/images/test.jpg"). + * @returns {string} - The patched path with context prefix if needed. + */ +declare function patchPathWithContext(path: string): string; diff --git a/modules/ui-module/src/main/resources/manager/js/manager-inject-init.d.ts b/modules/ui-module/src/main/resources/manager/js/manager-inject-init.d.ts new file mode 100644 index 000000000..274b55400 --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/js/manager-inject-init.d.ts @@ -0,0 +1,23 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +export function initIframe(): void; +export function isSectionPublishedExpired(section: any): boolean; diff --git a/modules/example-module/src/main/resources/com/condation/cms/modules/example/example.js b/modules/ui-module/src/main/resources/manager/js/manager-inject.d.ts similarity index 87% rename from modules/example-module/src/main/resources/com/condation/cms/modules/example/example.js rename to modules/ui-module/src/main/resources/manager/js/manager-inject.d.ts index c1b3f93f6..3b06342ad 100644 --- a/modules/example-module/src/main/resources/com/condation/cms/modules/example/example.js +++ b/modules/ui-module/src/main/resources/manager/js/manager-inject.d.ts @@ -1,6 +1,6 @@ /*- * #%L - * example-module + * ui-module * %% * Copyright (C) 2023 - 2025 CondationCMS * %% @@ -19,6 +19,3 @@ * . * #L% */ -export async function runAction(parameters) { - console.log("This is an example action"); -} diff --git a/modules/ui-module/src/main/resources/manager/js/manager.d.ts b/modules/ui-module/src/main/resources/manager/js/manager.d.ts new file mode 100644 index 000000000..4e9fd1670 --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/js/manager.d.ts @@ -0,0 +1,22 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +export {}; diff --git a/modules/ui-module/src/main/resources/manager/js/manager/media-inject.js b/modules/ui-module/src/main/resources/manager/js/manager/media-inject.js deleted file mode 100644 index 6d5979a22..000000000 --- a/modules/ui-module/src/main/resources/manager/js/manager/media-inject.js +++ /dev/null @@ -1,141 +0,0 @@ -/*- - * #%L - * ui-module - * %% - * Copyright (C) 2023 - 2025 CondationCMS - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program. If not, see - * . - * #L% - */ -export const initMediaUploadOverlay = (img) => { - if (!isSameDomainImage(img)) { - return; - } - // Overlay erstellen - const overlay = document.createElement('div'); - overlay.classList.add("cms-ui-overlay-bottom"); - overlay.innerText = "Bild austauschen…"; - document.body.appendChild(overlay); - const positionOverlay = () => { - const rect = img.getBoundingClientRect(); - const overlayHeight = rect.height / 3; // unteres Drittel - overlay.style.top = `${window.scrollY + rect.top + rect.height - overlayHeight}px`; - overlay.style.left = `${window.scrollX + rect.left}px`; - overlay.style.width = `${rect.width}px`; - overlay.style.height = `${overlayHeight}px`; - }; - img.addEventListener('mouseenter', () => { - positionOverlay(); - overlay.classList.add('visible'); - }); - img.addEventListener('mouseleave', (event) => { - if (!event.relatedTarget || !overlay.contains(event.relatedTarget)) { - overlay.classList.remove('visible'); - } - }); - overlay.addEventListener('mouseleave', (event) => { - if (!event.relatedTarget || event.relatedTarget !== img) { - overlay.classList.remove('visible'); - } - }); - overlay.addEventListener('click', (e) => { - selectMedia(e); - }); - window.addEventListener('scroll', () => { - if (overlay.classList.contains('visible')) - positionOverlay(); - }); - window.addEventListener('resize', () => { - if (overlay.classList.contains('visible')) - positionOverlay(); - }); - positionOverlay(); -}; -export const initMediaToolbar = (img) => { - if (!isSameDomainImage(img)) { - return; - } - const toolbar = document.createElement('div'); - toolbar.classList.add("cms-ui-toolbar"); - toolbar.classList.add("cms-ui-toolbar-tl"); - const button = document.createElement('button'); - button.setAttribute('data-cms-action', 'editMediaForm'); - button.setAttribute('data-cms-media-form', 'meta'); - button.innerHTML = EDIT_ATTRIBUTES_ICON; - button.setAttribute("title", "Edit attributes"); - button.addEventListener('click', (event) => { - editMediaForm(event, "meta", img.src); - }); - toolbar.appendChild(button); - document.body.appendChild(toolbar); - const positionToolbar = () => { - const rect = img.getBoundingClientRect(); - toolbar.style.top = `${window.scrollY + rect.top}px`; - toolbar.style.left = `${window.scrollX + rect.left}px`; - }; - img.addEventListener('mouseenter', () => { - positionToolbar(); - //toolbar.style.display = 'block'; - toolbar.classList.add('visible'); - }); - img.addEventListener('mouseleave', (event) => { - // nur ausblenden, wenn die Maus nicht gerade über der Toolbar ist - if (!event.relatedTarget || !toolbar.contains(event.relatedTarget)) { - //toolbar.style.display = 'none'; - toolbar.classList.remove('visible'); - } - }); - toolbar.addEventListener('mouseleave', (event) => { - if (!event.relatedTarget || event.relatedTarget !== img) { - //toolbar.style.display = 'none'; - toolbar.classList.remove('visible'); - } - }); - window.addEventListener('scroll', () => { - if (toolbar.style.visibility === 'visible') - positionToolbar(); - }); - window.addEventListener('resize', () => { - if (toolbar.style.visibility === 'visible') - positionToolbar(); - }); -}; -const selectMedia = (event) => { - var command = { - type: 'edit', - payload: { - editor: "select", - element: "image", - options: { - metaElement: event.target.dataset.cmsMetaElement, - } - } - }; - frameMessenger.send(window.parent, command); -}; -const editMediaForm = (event, form, image) => { - var command = { - type: 'edit', - payload: { - editor: "form", - element: "image", - options: { - form: form, - image: image - } - } - }; - frameMessenger.send(window.parent, command); -}; diff --git a/modules/ui-module/src/main/resources/manager/js/modules/filebrowser.template.js b/modules/ui-module/src/main/resources/manager/js/modules/filebrowser.template.js index 33a744356..5370f0482 100644 --- a/modules/ui-module/src/main/resources/manager/js/modules/filebrowser.template.js +++ b/modules/ui-module/src/main/resources/manager/js/modules/filebrowser.template.js @@ -19,7 +19,7 @@ * . * #L% */ -import Handlebars from '@cms/libs/handlebars.min.js'; +import Handlebars from 'https://cdn.jsdelivr.net/npm/handlebars@4.7.8/+esm'; Handlebars.registerHelper("patchPathWithContext", patchPathWithContext); Handlebars.registerHelper('concat', function (...args) { args.pop(); diff --git a/modules/ui-module/src/main/resources/manager/js/modules/manager/media-inject.js b/modules/ui-module/src/main/resources/manager/js/modules/manager/media-inject.js deleted file mode 100644 index 595841ffd..000000000 --- a/modules/ui-module/src/main/resources/manager/js/modules/manager/media-inject.js +++ /dev/null @@ -1,171 +0,0 @@ -/*- - * #%L - * ui-module - * %% - * Copyright (C) 2023 - 2025 CondationCMS - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program. If not, see - * . - * #L% - */ -import { EDIT_ATTRIBUTES_ICON, IMAGE_ICON } from "./toolbar-icons"; -import frameMessenger from '../frameMessenger.js'; -const isSameDomainImage = (imgElement) => { - if (!(imgElement instanceof HTMLImageElement)) { - return false; // ist kein - } - if (!imgElement.src) { - return false; - } - try { - const imgUrl = new URL(imgElement.src, window.location.href); - return imgUrl.hostname === window.location.hostname; - } - catch (e) { - return false; - } -}; -export const initMediaUploadOverlay = (img) => { - if (!isSameDomainImage(img)) { - return; - } - // Overlay erstellen - const overlay = document.createElement('div'); - overlay.classList.add("cms-ui-overlay-bottom"); - overlay.innerHTML = IMAGE_ICON; - document.body.appendChild(overlay); - const positionOverlay = () => { - const rect = img.getBoundingClientRect(); - const overlayHeight = rect.height / 3; // unteres Drittel - overlay.style.top = `${window.scrollY + rect.top + rect.height - overlayHeight}px`; - overlay.style.left = `${window.scrollX + rect.left}px`; - overlay.style.width = `${rect.width}px`; - overlay.style.height = `${overlayHeight}px`; - }; - img.addEventListener('mouseenter', () => { - positionOverlay(); - overlay.classList.add('visible'); - }); - img.addEventListener('mouseleave', (event) => { - if (!event.relatedTarget || !(event.relatedTarget instanceof Node) || !overlay.contains(event.relatedTarget)) { - overlay.classList.remove('visible'); - } - }); - overlay.addEventListener('mouseleave', (event) => { - if (!event.relatedTarget || event.relatedTarget !== img) { - overlay.classList.remove('visible'); - } - }); - overlay.addEventListener('click', (e) => { - selectMedia(img.dataset.cmsMetaElement, img.dataset.cmsNodeUri); - }); - window.addEventListener('scroll', () => { - if (overlay.classList.contains('visible')) - positionOverlay(); - }); - window.addEventListener('resize', () => { - if (overlay.classList.contains('visible')) - positionOverlay(); - }); - positionOverlay(); -}; -export const initMediaToolbar = (img) => { - if (!isSameDomainImage(img)) { - return; - } - const toolbar = document.createElement('div'); - toolbar.classList.add("cms-ui-toolbar"); - toolbar.classList.add("cms-ui-toolbar-tl"); - var toolbarDefinition = JSON.parse(img.dataset.cmsMediaToolbar); - if (toolbarDefinition.actions.includes('select')) { - const selectButton = document.createElement('button'); - selectButton.innerHTML = IMAGE_ICON; - selectButton.setAttribute("title", "Select media"); - selectButton.addEventListener('click', (event) => { - selectMedia(toolbarDefinition.options.element, toolbarDefinition.options.uri); - }); - toolbar.appendChild(selectButton); - } - if (toolbarDefinition.actions.includes('meta')) { - const metaButton = document.createElement('button'); - metaButton.setAttribute('data-cms-action', 'editMediaForm'); - metaButton.setAttribute('data-cms-media-form', 'meta'); - metaButton.innerHTML = EDIT_ATTRIBUTES_ICON; - metaButton.setAttribute("title", "Edit attributes"); - metaButton.addEventListener('click', (event) => { - editMediaForm("meta", img.src); - }); - toolbar.appendChild(metaButton); - } - document.body.appendChild(toolbar); - const positionToolbar = () => { - const rect = img.getBoundingClientRect(); - toolbar.style.top = `${window.scrollY + rect.top}px`; - toolbar.style.left = `${window.scrollX + rect.left}px`; - }; - img.addEventListener('mouseenter', () => { - positionToolbar(); - //toolbar.style.display = 'block'; - toolbar.classList.add('visible'); - }); - img.addEventListener('mouseleave', (event) => { - // nur ausblenden, wenn die Maus nicht gerade über der Toolbar ist - if (!event.relatedTarget || !toolbar.contains(event.relatedTarget)) { - //toolbar.style.display = 'none'; - toolbar.classList.remove('visible'); - } - }); - toolbar.addEventListener('mouseleave', (event) => { - if (!event.relatedTarget || event.relatedTarget !== img) { - //toolbar.style.display = 'none'; - toolbar.classList.remove('visible'); - } - }); - window.addEventListener('scroll', () => { - if (toolbar.style.visibility === 'visible') - positionToolbar(); - }); - window.addEventListener('resize', () => { - if (toolbar.style.visibility === 'visible') - positionToolbar(); - }); -}; -const selectMedia = (metaElement, uri) => { - var command = { - type: 'edit', - payload: { - editor: "select", - element: "image", - options: { - metaElement: metaElement, - uri: uri - } - } - }; - frameMessenger.send(window.parent, command); -}; -const editMediaForm = (form, image) => { - var command = { - type: 'edit', - payload: { - editor: "form", - element: "image", - options: { - form: form, - image: image - } - } - }; - frameMessenger.send(window.parent, command); -}; diff --git a/modules/ui-module/src/main/resources/manager/js/ui-actions.d.ts b/modules/ui-module/src/main/resources/manager/js/ui-actions.d.ts new file mode 100644 index 000000000..4e9fd1670 --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/js/ui-actions.d.ts @@ -0,0 +1,22 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +export {}; diff --git a/modules/ui-module/src/main/ts/dist/actions/media/edit-focal-point.d.ts b/modules/ui-module/src/main/ts/dist/actions/media/edit-focal-point.d.ts new file mode 100644 index 000000000..85620d3ab --- /dev/null +++ b/modules/ui-module/src/main/ts/dist/actions/media/edit-focal-point.d.ts @@ -0,0 +1 @@ +export declare function runAction(params: any): Promise; diff --git a/modules/ui-module/src/main/ts/dist/actions/media/edit-focal-point.js b/modules/ui-module/src/main/ts/dist/actions/media/edit-focal-point.js index da7732ef6..2d9576112 100644 --- a/modules/ui-module/src/main/ts/dist/actions/media/edit-focal-point.js +++ b/modules/ui-module/src/main/ts/dist/actions/media/edit-focal-point.js @@ -19,11 +19,11 @@ * . * #L% */ -import { i18n } from "../../js/modules/localization.js"; -import { openModal } from "../../js/modules/modal.js"; -import { reloadPreview } from "../../js/modules/preview.utils.js"; -import { getMediaMetaData, setMediaMetaData } from "../../js/modules/rpc/rpc-media.js"; -import { showToast } from "../../js/modules/toast.js"; +import { i18n } from "@cms/modules/localization.js"; +import { openModal } from "@cms/modules/modal.js"; +import { reloadPreview } from "@cms/modules/preview.utils.js"; +import { getMediaMetaData, setMediaMetaData } from "@cms/modules/rpc/rpc-media.js"; +import { showToast } from "@cms/modules/toast.js"; export async function runAction(params) { var uri = params.options.uri || null; var mediaUrl = removeFormatParamFromUrl(uri); diff --git a/modules/ui-module/src/main/ts/dist/actions/media/edit-media-form.d.ts b/modules/ui-module/src/main/ts/dist/actions/media/edit-media-form.d.ts new file mode 100644 index 000000000..6abc321a1 --- /dev/null +++ b/modules/ui-module/src/main/ts/dist/actions/media/edit-media-form.d.ts @@ -0,0 +1 @@ +export function runAction(params: any): Promise; diff --git a/modules/ui-module/src/main/ts/dist/actions/media/edit-media-form.js b/modules/ui-module/src/main/ts/dist/actions/media/edit-media-form.js index 1ac188040..38f7c2d81 100644 --- a/modules/ui-module/src/main/ts/dist/actions/media/edit-media-form.js +++ b/modules/ui-module/src/main/ts/dist/actions/media/edit-media-form.js @@ -19,14 +19,14 @@ * . * #L% */ -import { openSidebar } from '../../js/modules/sidebar.js'; -import { createForm } from '../../js/modules/form/forms.js'; -import { showToast } from '../../js/modules/toast.js'; -import { setMeta } from '../../js/modules/rpc/rpc-content.js'; -import { reloadPreview } from '../../js/modules/preview.utils.js'; -import { i18n } from '../../js/modules/localization.js'; -import { getMediaForm } from '../../js/modules/rpc/rpc-manager.js'; -import { getMediaMetaData, setMediaMetaData } from '../../js/modules/rpc/rpc-media.js'; +import { openSidebar } from '@cms/modules/sidebar.js'; +import { createForm } from '@cms/modules/form/forms.js'; +import { showToast } from '@cms/modules/toast.js'; +import { setMeta } from '@cms/modules/rpc/rpc-content.js'; +import { reloadPreview } from '@cms/modules/preview.utils.js'; +import { i18n } from '@cms/modules/localization.js'; +import { getMediaForm } from '@cms/modules/rpc/rpc-manager.js'; +import { getMediaMetaData, setMediaMetaData } from '@cms/modules/rpc/rpc-media.js'; export async function runAction(params) { var mediaForm = (await getMediaForm({ form: params.options.form || 'meta' diff --git a/modules/ui-module/src/main/ts/dist/actions/media/select-media.d.ts b/modules/ui-module/src/main/ts/dist/actions/media/select-media.d.ts new file mode 100644 index 000000000..85620d3ab --- /dev/null +++ b/modules/ui-module/src/main/ts/dist/actions/media/select-media.d.ts @@ -0,0 +1 @@ +export declare function runAction(params: any): Promise; diff --git a/modules/ui-module/src/main/ts/dist/actions/media/select-media.js b/modules/ui-module/src/main/ts/dist/actions/media/select-media.js index 7fa55de49..9d3135268 100644 --- a/modules/ui-module/src/main/ts/dist/actions/media/select-media.js +++ b/modules/ui-module/src/main/ts/dist/actions/media/select-media.js @@ -19,11 +19,11 @@ * . * #L% */ -import { openFileBrowser } from "../../js/modules/filebrowser.js"; -import { i18n } from "../../js/modules/localization.js"; -import { getPreviewUrl, reloadPreview } from "../../js/modules/preview.utils.js"; -import { getContentNode, setMeta } from "../../js/modules/rpc/rpc-content.js"; -import { showToast } from "../../js/modules/toast.js"; +import { openFileBrowser } from "@cms/modules/filebrowser.js"; +import { i18n } from "@cms/modules/localization.js"; +import { getPreviewUrl, reloadPreview } from "@cms/modules/preview.utils.js"; +import { getContentNode, setMeta } from "@cms/modules/rpc/rpc-content.js"; +import { showToast } from "@cms/modules/toast.js"; export async function runAction(params) { var uri = null; if (params.options.uri) { diff --git a/modules/ui-module/src/main/ts/dist/actions/page/add-section.d.ts b/modules/ui-module/src/main/ts/dist/actions/page/add-section.d.ts new file mode 100644 index 000000000..6abc321a1 --- /dev/null +++ b/modules/ui-module/src/main/ts/dist/actions/page/add-section.d.ts @@ -0,0 +1 @@ +export function runAction(params: any): Promise; diff --git a/modules/ui-module/src/main/ts/dist/actions/page/add-section.js b/modules/ui-module/src/main/ts/dist/actions/page/add-section.js index c4458c927..ba633716a 100644 --- a/modules/ui-module/src/main/ts/dist/actions/page/add-section.js +++ b/modules/ui-module/src/main/ts/dist/actions/page/add-section.js @@ -19,13 +19,13 @@ * . * #L% */ -import { openModal } from '../../js/modules/modal.js'; -import { showToast } from '../../js/modules/toast.js'; -import { addSection, getContentNode } from '../../js/modules/rpc/rpc-content.js'; -import { getPreviewUrl, reloadPreview } from '../../js/modules/preview.utils.js'; -import Handlebars from '../../js/libs/handlebars.min.js'; -import { i18n } from '../../js/modules/localization.js'; -import { getSectionTemplates } from '../../js/modules/rpc/rpc-manager.js'; +import { openModal } from '@cms/modules/modal.js'; +import { showToast } from '@cms/modules/toast.js'; +import { addSection, getContentNode } from '@cms/modules/rpc/rpc-content.js'; +import { getPreviewUrl, reloadPreview } from '@cms/modules/preview.utils.js'; +import Handlebars from 'https://cdn.jsdelivr.net/npm/handlebars@4.7.8/+esm'; +import { i18n } from '@cms/modules/localization.js'; +import { getSectionTemplates } from '@cms/modules/rpc/rpc-manager.js'; export async function runAction(params) { const contentNode = await getContentNode({ url: getPreviewUrl() diff --git a/modules/ui-module/src/main/ts/dist/actions/page/create-page.d.ts b/modules/ui-module/src/main/ts/dist/actions/page/create-page.d.ts new file mode 100644 index 000000000..6abc321a1 --- /dev/null +++ b/modules/ui-module/src/main/ts/dist/actions/page/create-page.d.ts @@ -0,0 +1 @@ +export function runAction(params: any): Promise; diff --git a/modules/ui-module/src/main/ts/dist/actions/page/create-page.js b/modules/ui-module/src/main/ts/dist/actions/page/create-page.js index d744915fa..58863c147 100644 --- a/modules/ui-module/src/main/ts/dist/actions/page/create-page.js +++ b/modules/ui-module/src/main/ts/dist/actions/page/create-page.js @@ -19,7 +19,7 @@ * . * #L% */ -import { openFileBrowser } from '../../js/modules/filebrowser.js'; +import { openFileBrowser } from '@cms/modules/filebrowser.js'; // hook.js export async function runAction(params) { openFileBrowser({ diff --git a/modules/ui-module/src/main/ts/dist/actions/page/delete-section.d.ts b/modules/ui-module/src/main/ts/dist/actions/page/delete-section.d.ts new file mode 100644 index 000000000..6abc321a1 --- /dev/null +++ b/modules/ui-module/src/main/ts/dist/actions/page/delete-section.d.ts @@ -0,0 +1 @@ +export function runAction(params: any): Promise; diff --git a/modules/ui-module/src/main/ts/dist/actions/page/delete-section.js b/modules/ui-module/src/main/ts/dist/actions/page/delete-section.js index bb3bbb595..9b8d83b69 100644 --- a/modules/ui-module/src/main/ts/dist/actions/page/delete-section.js +++ b/modules/ui-module/src/main/ts/dist/actions/page/delete-section.js @@ -19,11 +19,11 @@ * . * #L% */ -import { i18n } from '../../js/modules/localization.js'; -import { alertConfirm } from '../../js/modules/alerts.js'; -import { deleteSection } from '../../js/modules/rpc/rpc-content.js'; -import { showToast } from '../../js/modules/toast.js'; -import { reloadPreview } from '../../js/modules/preview.utils.js'; +import { i18n } from '@cms/modules/localization.js'; +import { alertConfirm } from '@cms/modules/alerts.js'; +import { deleteSection } from '@cms/modules/rpc/rpc-content.js'; +import { showToast } from '@cms/modules/toast.js'; +import { reloadPreview } from '@cms/modules/preview.utils.js'; export async function runAction(params) { var confimred = await alertConfirm({ title: i18n.t("filebrowser.delete.confirm.title", "Are you sure?"), diff --git a/modules/ui-module/src/main/ts/dist/actions/page/edit-content.d.ts b/modules/ui-module/src/main/ts/dist/actions/page/edit-content.d.ts new file mode 100644 index 000000000..6abc321a1 --- /dev/null +++ b/modules/ui-module/src/main/ts/dist/actions/page/edit-content.d.ts @@ -0,0 +1 @@ +export function runAction(params: any): Promise; diff --git a/modules/ui-module/src/main/ts/dist/actions/page/edit-content.js b/modules/ui-module/src/main/ts/dist/actions/page/edit-content.js index 96d97b90b..0ba9dff58 100644 --- a/modules/ui-module/src/main/ts/dist/actions/page/edit-content.js +++ b/modules/ui-module/src/main/ts/dist/actions/page/edit-content.js @@ -19,12 +19,12 @@ * . * #L% */ -import { openModal } from '../../js/modules/modal.js'; -import { createForm } from '../../js/modules/form/forms.js'; -import { getPreviewUrl, reloadPreview } from '../../js/modules/preview.utils.js'; -import { getContentNode, getContent, setContent } from '../../js/modules/rpc/rpc-content.js'; -import { i18n } from '../../js/modules/localization.js'; -import { showToast } from '../../js/modules/toast.js'; +import { openModal } from '@cms/modules/modal.js'; +import { createForm } from '@cms/modules/form/forms.js'; +import { getPreviewUrl, reloadPreview } from '@cms/modules/preview.utils.js'; +import { getContentNode, getContent, setContent } from '@cms/modules/rpc/rpc-content.js'; +import { i18n } from '@cms/modules/localization.js'; +import { showToast } from '@cms/modules/toast.js'; // hook.js export async function runAction(params) { var uri = null; diff --git a/modules/ui-module/src/main/ts/dist/actions/page/edit-metaattribute-list.d.ts b/modules/ui-module/src/main/ts/dist/actions/page/edit-metaattribute-list.d.ts new file mode 100644 index 000000000..6abc321a1 --- /dev/null +++ b/modules/ui-module/src/main/ts/dist/actions/page/edit-metaattribute-list.d.ts @@ -0,0 +1 @@ +export function runAction(params: any): Promise; diff --git a/modules/ui-module/src/main/ts/dist/actions/page/edit-metaattribute-list.js b/modules/ui-module/src/main/ts/dist/actions/page/edit-metaattribute-list.js index f214138a6..5734a66c0 100644 --- a/modules/ui-module/src/main/ts/dist/actions/page/edit-metaattribute-list.js +++ b/modules/ui-module/src/main/ts/dist/actions/page/edit-metaattribute-list.js @@ -19,13 +19,13 @@ * . * #L% */ -import { createForm } from '../../js/modules/form/forms.js'; -import { showToast } from '../../js/modules/toast.js'; -import { getPreviewUrl, reloadPreview } from '../../js/modules/preview.utils.js'; -import { getValueByPath } from '../../js/modules/node.js'; -import { getContentNode, getContent, setMeta } from '../../js/modules/rpc/rpc-content.js'; -import { i18n } from '../../js/modules/localization.js'; -import { openSidebar } from '../../js/modules/sidebar.js'; +import { createForm } from '@cms/modules/form/forms.js'; +import { showToast } from '@cms/modules/toast.js'; +import { getPreviewUrl, reloadPreview } from '@cms/modules/preview.utils.js'; +import { getValueByPath } from '@cms/modules/node.js'; +import { getContentNode, getContent, setMeta } from '@cms/modules/rpc/rpc-content.js'; +import { i18n } from '@cms/modules/localization.js'; +import { openSidebar } from '@cms/modules/sidebar.js'; // hook.js export async function runAction(params) { var uri = null; diff --git a/modules/ui-module/src/main/ts/dist/actions/page/edit-metaattribute.d.ts b/modules/ui-module/src/main/ts/dist/actions/page/edit-metaattribute.d.ts new file mode 100644 index 000000000..6abc321a1 --- /dev/null +++ b/modules/ui-module/src/main/ts/dist/actions/page/edit-metaattribute.d.ts @@ -0,0 +1 @@ +export function runAction(params: any): Promise; diff --git a/modules/ui-module/src/main/ts/dist/actions/page/edit-metaattribute.js b/modules/ui-module/src/main/ts/dist/actions/page/edit-metaattribute.js index 001169192..39b1eb2f7 100644 --- a/modules/ui-module/src/main/ts/dist/actions/page/edit-metaattribute.js +++ b/modules/ui-module/src/main/ts/dist/actions/page/edit-metaattribute.js @@ -19,13 +19,13 @@ * . * #L% */ -import { createForm } from '../../js/modules/form/forms.js'; -import { showToast } from '../../js/modules/toast.js'; -import { getPreviewUrl, reloadPreview } from '../../js/modules/preview.utils.js'; -import { getValueByPath } from '../../js/modules/node.js'; -import { getContentNode, setMeta, getContent } from '../../js/modules/rpc/rpc-content.js'; -import { i18n } from '../../js/modules/localization.js'; -import { openSidebar } from '../../js/modules/sidebar.js'; +import { createForm } from '@cms/modules/form/forms.js'; +import { showToast } from '@cms/modules/toast.js'; +import { getPreviewUrl, reloadPreview } from '@cms/modules/preview.utils.js'; +import { getValueByPath } from '@cms/modules/node.js'; +import { getContentNode, setMeta, getContent } from '@cms/modules/rpc/rpc-content.js'; +import { i18n } from '@cms/modules/localization.js'; +import { openSidebar } from '@cms/modules/sidebar.js'; // hook.js export async function runAction(params) { var uri = null; diff --git a/modules/ui-module/src/main/ts/dist/actions/page/edit-page-settings.d.ts b/modules/ui-module/src/main/ts/dist/actions/page/edit-page-settings.d.ts new file mode 100644 index 000000000..6abc321a1 --- /dev/null +++ b/modules/ui-module/src/main/ts/dist/actions/page/edit-page-settings.d.ts @@ -0,0 +1 @@ +export function runAction(params: any): Promise; diff --git a/modules/ui-module/src/main/ts/dist/actions/page/edit-page-settings.js b/modules/ui-module/src/main/ts/dist/actions/page/edit-page-settings.js index bb8d7961a..137b52462 100644 --- a/modules/ui-module/src/main/ts/dist/actions/page/edit-page-settings.js +++ b/modules/ui-module/src/main/ts/dist/actions/page/edit-page-settings.js @@ -19,14 +19,14 @@ * . * #L% */ -import { openSidebar } from '../../js/modules/sidebar.js'; -import { createForm } from '../../js/modules/form/forms.js'; -import { showToast } from '../../js/modules/toast.js'; -import { getContentNode, setMeta, getContent } from '../../js/modules/rpc/rpc-content.js'; -import { getPreviewUrl, reloadPreview } from '../../js/modules/preview.utils.js'; -import { i18n } from '../../js/modules/localization.js'; -import { getPageTemplates } from '../../js/modules/rpc/rpc-manager.js'; -import { buildValuesFromFields } from '../../js/modules/node.js'; +import { openSidebar } from '@cms/modules/sidebar.js'; +import { createForm } from '@cms/modules/form/forms.js'; +import { showToast } from '@cms/modules/toast.js'; +import { getContentNode, setMeta, getContent } from '@cms/modules/rpc/rpc-content.js'; +import { getPreviewUrl, reloadPreview } from '@cms/modules/preview.utils.js'; +import { i18n } from '@cms/modules/localization.js'; +import { getPageTemplates } from '@cms/modules/rpc/rpc-manager.js'; +import { buildValuesFromFields } from '@cms/modules/node.js'; const DEFAULT_FIELDS = [ { type: 'text', diff --git a/modules/ui-module/src/main/ts/dist/actions/page/edit-sections.d.ts b/modules/ui-module/src/main/ts/dist/actions/page/edit-sections.d.ts new file mode 100644 index 000000000..6abc321a1 --- /dev/null +++ b/modules/ui-module/src/main/ts/dist/actions/page/edit-sections.d.ts @@ -0,0 +1 @@ +export function runAction(params: any): Promise; diff --git a/modules/ui-module/src/main/ts/dist/actions/page/edit-sections.js b/modules/ui-module/src/main/ts/dist/actions/page/edit-sections.js index 7087b5cb2..1872e9228 100644 --- a/modules/ui-module/src/main/ts/dist/actions/page/edit-sections.js +++ b/modules/ui-module/src/main/ts/dist/actions/page/edit-sections.js @@ -19,12 +19,12 @@ * . * #L% */ -import { openModal } from '../../js/modules/modal.js'; -import { showToast } from '../../js/modules/toast.js'; -import { getPreviewUrl, reloadPreview } from '../../js/modules/preview.utils.js'; -import { Sortable } from '../../js/libs/sortablejs.min.js'; -import Handlebars from '../../js/libs/handlebars.min.js'; -import { getContentNode, setMetaBatch } from '../../js/modules/rpc/rpc-content.js'; +import { openModal } from '@cms/modules/modal.js'; +import { showToast } from '@cms/modules/toast.js'; +import { getPreviewUrl, reloadPreview } from '@cms/modules/preview.utils.js'; +import Sortable from 'https://cdn.jsdelivr.net/npm/sortablejs@1.15.6/+esm'; +import Handlebars from 'https://cdn.jsdelivr.net/npm/handlebars@4.7.8/+esm'; +import { getContentNode, setMetaBatch } from '@cms/modules/rpc/rpc-content.js'; // hook.js export async function runAction(params) { const contentNode = await getContentNode({ diff --git a/modules/ui-module/src/main/ts/dist/actions/page/manage-assets.d.ts b/modules/ui-module/src/main/ts/dist/actions/page/manage-assets.d.ts new file mode 100644 index 000000000..6abc321a1 --- /dev/null +++ b/modules/ui-module/src/main/ts/dist/actions/page/manage-assets.d.ts @@ -0,0 +1 @@ +export function runAction(params: any): Promise; diff --git a/modules/ui-module/src/main/ts/dist/actions/page/manage-assets.js b/modules/ui-module/src/main/ts/dist/actions/page/manage-assets.js index 304c50623..849f3063b 100644 --- a/modules/ui-module/src/main/ts/dist/actions/page/manage-assets.js +++ b/modules/ui-module/src/main/ts/dist/actions/page/manage-assets.js @@ -19,7 +19,7 @@ * . * #L% */ -import { openFileBrowser } from '../../js/modules/filebrowser.js'; +import { openFileBrowser } from '@cms/modules/filebrowser.js'; // hook.js export async function runAction(params) { openFileBrowser({ diff --git a/modules/ui-module/src/main/ts/dist/actions/page/section-set-published.d.ts b/modules/ui-module/src/main/ts/dist/actions/page/section-set-published.d.ts new file mode 100644 index 000000000..85620d3ab --- /dev/null +++ b/modules/ui-module/src/main/ts/dist/actions/page/section-set-published.d.ts @@ -0,0 +1 @@ +export declare function runAction(params: any): Promise; diff --git a/modules/ui-module/src/main/ts/dist/actions/page/section-set-published.js b/modules/ui-module/src/main/ts/dist/actions/page/section-set-published.js index b2e8df77c..f8fed62c3 100644 --- a/modules/ui-module/src/main/ts/dist/actions/page/section-set-published.js +++ b/modules/ui-module/src/main/ts/dist/actions/page/section-set-published.js @@ -19,8 +19,8 @@ * . * #L% */ -import { reloadPreview } from "../../js/modules/preview.utils"; -import { setMeta } from "../../js/modules/rpc/rpc-content"; +import { reloadPreview } from "@cms/modules/preview.utils"; +import { setMeta } from "@cms/modules/rpc/rpc-content"; export async function runAction(params) { var request = { uri: params.sectionUri, diff --git a/modules/ui-module/src/main/ts/dist/actions/page/translations.d.ts b/modules/ui-module/src/main/ts/dist/actions/page/translations.d.ts new file mode 100644 index 000000000..85620d3ab --- /dev/null +++ b/modules/ui-module/src/main/ts/dist/actions/page/translations.d.ts @@ -0,0 +1 @@ +export declare function runAction(params: any): Promise; diff --git a/modules/ui-module/src/main/ts/dist/actions/page/translations.js b/modules/ui-module/src/main/ts/dist/actions/page/translations.js index 19b11e6fb..39d24b579 100644 --- a/modules/ui-module/src/main/ts/dist/actions/page/translations.js +++ b/modules/ui-module/src/main/ts/dist/actions/page/translations.js @@ -19,13 +19,13 @@ * . * #L% */ -import { openFileBrowser } from '../../js/modules/filebrowser.js'; -import { i18n } from '../../js/modules/localization.js'; -import { openModal } from '../../js/modules/modal.js'; -import { getPreviewUrl } from '../../js/modules/preview.utils.js'; -import { getContentNode } from '../../js/modules/rpc/rpc-content.js'; -import { addTranslation, getTranslations } from '../../js/modules/rpc/rpc-translation.js'; -import { showToast } from '../../js/modules/toast.js'; +import { openFileBrowser } from '@cms/modules/filebrowser.js'; +import { i18n } from '@cms/modules/localization.js'; +import { openModal } from '@cms/modules/modal.js'; +import { getPreviewUrl } from '@cms/modules/preview.utils.js'; +import { getContentNode } from '@cms/modules/rpc/rpc-content.js'; +import { addTranslation, getTranslations } from '@cms/modules/rpc/rpc-translation.js'; +import { showToast } from '@cms/modules/toast.js'; // hook.js export async function runAction(params) { const contentNode = await getContentNode({ diff --git a/modules/ui-module/src/main/ts/dist/actions/reload-preview.d.ts b/modules/ui-module/src/main/ts/dist/actions/reload-preview.d.ts new file mode 100644 index 000000000..85620d3ab --- /dev/null +++ b/modules/ui-module/src/main/ts/dist/actions/reload-preview.d.ts @@ -0,0 +1 @@ +export declare function runAction(params: any): Promise; diff --git a/modules/ui-module/src/main/ts/dist/actions/site-change.d.ts b/modules/ui-module/src/main/ts/dist/actions/site-change.d.ts new file mode 100644 index 000000000..ba8a4fff2 --- /dev/null +++ b/modules/ui-module/src/main/ts/dist/actions/site-change.d.ts @@ -0,0 +1 @@ +export function runAction(parameters: any): Promise; diff --git a/modules/ui-module/src/main/ts/dist/actions/test-command.d.ts b/modules/ui-module/src/main/ts/dist/actions/test-command.d.ts new file mode 100644 index 000000000..6abc321a1 --- /dev/null +++ b/modules/ui-module/src/main/ts/dist/actions/test-command.d.ts @@ -0,0 +1 @@ +export function runAction(params: any): Promise; diff --git a/modules/ui-module/src/main/ts/dist/actions/test-command.js b/modules/ui-module/src/main/ts/dist/actions/test-command.js index 92cc3a2c3..8b3c24377 100644 --- a/modules/ui-module/src/main/ts/dist/actions/test-command.js +++ b/modules/ui-module/src/main/ts/dist/actions/test-command.js @@ -19,8 +19,8 @@ * . * #L% */ -import { executeCommand } from '../../js/modules/system-commands.js'; -import { getPreviewUrl } from '../../js/modules/preview.utils.js'; +import { executeCommand } from '@cms/modules/system-commands.js'; +import { getPreviewUrl } from '@cms/modules/preview.utils.js'; // hook.js export async function runAction(params) { var contentNode = await executeCommand({ diff --git a/modules/ui-module/src/main/ts/dist/js/libs/handlebars.min.js b/modules/ui-module/src/main/ts/dist/js/libs/handlebars.min.js deleted file mode 100644 index 7c1004ce7..000000000 --- a/modules/ui-module/src/main/ts/dist/js/libs/handlebars.min.js +++ /dev/null @@ -1,579 +0,0 @@ -/** - * Bundled by jsDelivr using Rollup v2.79.2 and Terser v5.39.0. - * Original file: /npm/handlebars@4.7.8/dist/cjs/handlebars.js - * - * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files - */ -var t = { exports: {} }, e = { exports: {} }, r = {}, s = { __esModule: !0 }; -s.extend = l, s.indexOf = function (t, e) { for (var r = 0, s = t.length; r < s; r++) - if (t[r] === e) - return r; return -1; }, s.escapeExpression = function (t) { if ("string" != typeof t) { - if (t && t.toHTML) - return t.toHTML(); - if (null == t) - return ""; - if (!t) - return t + ""; - t = "" + t; -} if (!o.test(t)) - return t; return t.replace(n, a); }, s.isEmpty = function (t) { return !t && 0 !== t || !(!h(t) || 0 !== t.length); }, s.createFrame = function (t) { var e = l({}, t); return e._parent = t, e; }, s.blockParams = function (t, e) { return t.path = e, t; }, s.appendContextPath = function (t, e) { return (t ? t + "." : "") + e; }; -var i = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'", "`": "`", "=": "=" }, n = /[&<>"'`=]/g, o = /[&<>"'`=]/; -function a(t) { return i[t]; } -function l(t) { for (var e = 1; e < arguments.length; e++) - for (var r in arguments[e]) - Object.prototype.hasOwnProperty.call(arguments[e], r) && (t[r] = arguments[e][r]); return t; } -var c = Object.prototype.toString; -s.toString = c; -var p = function (t) { return "function" == typeof t; }; -p(/x/) && (s.isFunction = p = function (t) { return "function" == typeof t && "[object Function]" === c.call(t); }), s.isFunction = p; -var h = Array.isArray || function (t) { return !(!t || "object" != typeof t) && "[object Array]" === c.call(t); }; -s.isArray = h; -var u = { exports: {} }; -!function (t, e) { e.__esModule = !0; var r = ["description", "fileName", "lineNumber", "endLineNumber", "message", "name", "number", "stack"]; function s(t, e) { var i = e && e.loc, n = void 0, o = void 0, a = void 0, l = void 0; i && (n = i.start.line, o = i.end.line, a = i.start.column, l = i.end.column, t += " - " + n + ":" + a); for (var c = Error.prototype.constructor.call(this, t), p = 0; p < r.length; p++) - this[r[p]] = c[r[p]]; Error.captureStackTrace && Error.captureStackTrace(this, s); try { - i && (this.lineNumber = n, this.endLineNumber = o, Object.defineProperty ? (Object.defineProperty(this, "column", { value: a, enumerable: !0 }), Object.defineProperty(this, "endColumn", { value: l, enumerable: !0 })) : (this.column = a, this.endColumn = l)); -} -catch (t) { } } s.prototype = new Error, e.default = s, t.exports = e.default; }(u, u.exports); -var f = {}, d = { exports: {} }; -!function (t, e) { e.__esModule = !0; var r = s; e.default = function (t) { t.registerHelper("blockHelperMissing", (function (e, s) { var i = s.inverse, n = s.fn; if (!0 === e) - return n(this); if (!1 === e || null == e) - return i(this); if (r.isArray(e)) - return e.length > 0 ? (s.ids && (s.ids = [s.name]), t.helpers.each(e, s)) : i(this); if (s.data && s.ids) { - var o = r.createFrame(s.data); - o.contextPath = r.appendContextPath(s.data.contextPath, s.name), s = { data: o }; -} return n(e, s); })); }, t.exports = e.default; }(d, d.exports); -var m = { exports: {} }; -!function (t, e) { e.__esModule = !0; var r, i = s, n = (r = u.exports) && r.__esModule ? r : { default: r }; e.default = function (t) { t.registerHelper("each", (function (t, e) { if (!e) - throw new n.default("Must pass iterator to #each"); var r, s = e.fn, o = e.inverse, a = 0, l = "", c = void 0, p = void 0; function h(e, r, n) { c && (c.key = e, c.index = r, c.first = 0 === r, c.last = !!n, p && (c.contextPath = p + e)), l += s(t[e], { data: c, blockParams: i.blockParams([t[e], e], [p + e, null]) }); } if (e.data && e.ids && (p = i.appendContextPath(e.data.contextPath, e.ids[0]) + "."), i.isFunction(t) && (t = t.call(this)), e.data && (c = i.createFrame(e.data)), t && "object" == typeof t) - if (i.isArray(t)) - for (var u = t.length; a < u; a++) - a in t && h(a, a, a === t.length - 1); - else if ("function" == typeof Symbol && t[Symbol.iterator]) { - for (var f = [], d = t[Symbol.iterator](), m = d.next(); !m.done; m = d.next()) - f.push(m.value); - for (u = (t = f).length; a < u; a++) - h(a, a, a === t.length - 1); - } - else - r = void 0, Object.keys(t).forEach((function (t) { void 0 !== r && h(r, a - 1), r = t, a++; })), void 0 !== r && h(r, a - 1, !0); return 0 === a && (l = o(this)), l; })); }, t.exports = e.default; }(m, m.exports); -var g = { exports: {} }; -!function (t, e) { e.__esModule = !0; var r, s = (r = u.exports) && r.__esModule ? r : { default: r }; e.default = function (t) { t.registerHelper("helperMissing", (function () { if (1 !== arguments.length) - throw new s.default('Missing helper: "' + arguments[arguments.length - 1].name + '"'); })); }, t.exports = e.default; }(g, g.exports); -var v = { exports: {} }; -!function (t, e) { e.__esModule = !0; var r, i = s, n = (r = u.exports) && r.__esModule ? r : { default: r }; e.default = function (t) { t.registerHelper("if", (function (t, e) { if (2 != arguments.length) - throw new n.default("#if requires exactly one argument"); return i.isFunction(t) && (t = t.call(this)), !e.hash.includeZero && !t || i.isEmpty(t) ? e.inverse(this) : e.fn(this); })), t.registerHelper("unless", (function (e, r) { if (2 != arguments.length) - throw new n.default("#unless requires exactly one argument"); return t.helpers.if.call(this, e, { fn: r.inverse, inverse: r.fn, hash: r.hash }); })); }, t.exports = e.default; }(v, v.exports); -var y, k, _ = { exports: {} }; -y = _, (k = _.exports).__esModule = !0, k.default = function (t) { t.registerHelper("log", (function () { for (var e = [void 0], r = arguments[arguments.length - 1], s = 0; s < arguments.length - 1; s++) - e.push(arguments[s]); var i = 1; null != r.hash.level ? i = r.hash.level : r.data && null != r.data.level && (i = r.data.level), e[0] = i, t.log.apply(t, e); })); }, y.exports = k.default; -var S = { exports: {} }; -!function (t, e) { e.__esModule = !0, e.default = function (t) { t.registerHelper("lookup", (function (t, e, r) { return t ? r.lookupProperty(t, e) : t; })); }, t.exports = e.default; }(S, S.exports); -var x = { exports: {} }; -function P(t) { return t && t.__esModule ? t : { default: t }; } -!function (t, e) { e.__esModule = !0; var r, i = s, n = (r = u.exports) && r.__esModule ? r : { default: r }; e.default = function (t) { t.registerHelper("with", (function (t, e) { if (2 != arguments.length) - throw new n.default("#with requires exactly one argument"); i.isFunction(t) && (t = t.call(this)); var r = e.fn; if (i.isEmpty(t)) - return e.inverse(this); var s = e.data; return e.data && e.ids && ((s = i.createFrame(e.data)).contextPath = i.appendContextPath(e.data.contextPath, e.ids[0])), r(t, { data: s, blockParams: i.blockParams([t], [s && s.contextPath]) }); })); }, t.exports = e.default; }(x, x.exports), f.__esModule = !0, f.registerDefaultHelpers = function (t) { b.default(t), w.default(t), E.default(t), L.default(t), C.default(t), I.default(t), O.default(t); }, f.moveHelperToHooks = function (t, e, r) { t.helpers[e] && (t.hooks[e] = t.helpers[e], r || delete t.helpers[e]); }; -var b = P(d.exports), w = P(m.exports), E = P(g.exports), L = P(v.exports), C = P(_.exports), I = P(S.exports), O = P(x.exports); -var N = {}, A = { exports: {} }; -!function (t, e) { e.__esModule = !0; var r = s; e.default = function (t) { t.registerDecorator("inline", (function (t, e, s, i) { var n = t; return e.partials || (e.partials = {}, n = function (i, n) { var o = s.partials; s.partials = r.extend({}, o, e.partials); var a = t(i, n); return s.partials = o, a; }), e.partials[i.args[0]] = i.fn, n; })); }, t.exports = e.default; }(A, A.exports), N.__esModule = !0, N.registerDefaultDecorators = function (t) { B.default(t); }; -var M, B = (M = A.exports) && M.__esModule ? M : { default: M }; -var D = { exports: {} }; -!function (t, e) { e.__esModule = !0; var r = s, i = { methodMap: ["debug", "info", "warn", "error"], level: "info", lookupLevel: function (t) { if ("string" == typeof t) { - var e = r.indexOf(i.methodMap, t.toLowerCase()); - t = e >= 0 ? e : parseInt(t, 10); - } return t; }, log: function (t) { if (t = i.lookupLevel(t), "undefined" != typeof console && i.lookupLevel(i.level) <= t) { - var e = i.methodMap[t]; - console[e] || (e = "log"); - for (var r = arguments.length, s = Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++) - s[n - 1] = arguments[n]; - console[e].apply(console, s); - } } }; e.default = i, t.exports = e.default; }(D, D.exports); -var H = {}, $ = { __esModule: !0, createNewLookupObject: function () { for (var t = arguments.length, e = Array(t), r = 0; r < t; r++) - e[r] = arguments[r]; return R.extend.apply(void 0, [Object.create(null)].concat(e)); } }, R = s; -H.__esModule = !0, H.createProtoAccessControl = function (t) { var e = Object.create(null); e.constructor = !1, e.__defineGetter__ = !1, e.__defineSetter__ = !1, e.__lookupGetter__ = !1; var r = Object.create(null); return r.__proto__ = !1, { properties: { whitelist: j.createNewLookupObject(r, t.allowedProtoProperties), defaultValue: t.allowProtoPropertiesByDefault }, methods: { whitelist: j.createNewLookupObject(e, t.allowedProtoMethods), defaultValue: t.allowProtoMethodsByDefault } }; }, H.resultIsAllowed = function (t, e, r) { return V("function" == typeof t ? e.methods : e.properties, r); }, H.resetLoggedProperties = function () { Object.keys(F).forEach((function (t) { delete F[t]; })); }; -var j = $, T = function (t) { return t && t.__esModule ? t : { default: t }; }(D.exports), F = Object.create(null); -function V(t, e) { return void 0 !== t.whitelist[e] ? !0 === t.whitelist[e] : void 0 !== t.defaultValue ? t.defaultValue : (function (t) { !0 !== F[t] && (F[t] = !0, T.default.log("error", 'Handlebars: Access has been denied to resolve the property "' + t + '" because it is not an "own property" of its parent.\nYou can add a runtime option to disable the check or this warning:\nSee https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details')); }(e), !1); } -function K(t) { return t && t.__esModule ? t : { default: t }; } -r.__esModule = !0, r.HandlebarsEnvironment = X; -var U = s, q = K(u.exports), W = f, J = N, G = K(D.exports), z = H; -r.VERSION = "4.7.8"; -r.COMPILER_REVISION = 8; -r.LAST_COMPATIBLE_COMPILER_REVISION = 7; -r.REVISION_CHANGES = { 1: "<= 1.0.rc.2", 2: "== 1.0.0-rc.3", 3: "== 1.0.0-rc.4", 4: "== 1.x.x", 5: "== 2.0.0-alpha.x", 6: ">= 2.0.0-beta.1", 7: ">= 4.0.0 <4.3.0", 8: ">= 4.3.0" }; -var Y = "[object Object]"; -function X(t, e, r) { this.helpers = t || {}, this.partials = e || {}, this.decorators = r || {}, W.registerDefaultHelpers(this), J.registerDefaultDecorators(this); } -X.prototype = { constructor: X, logger: G.default, log: G.default.log, registerHelper: function (t, e) { if (U.toString.call(t) === Y) { - if (e) - throw new q.default("Arg not supported with multiple helpers"); - U.extend(this.helpers, t); - } - else - this.helpers[t] = e; }, unregisterHelper: function (t) { delete this.helpers[t]; }, registerPartial: function (t, e) { if (U.toString.call(t) === Y) - U.extend(this.partials, t); - else { - if (void 0 === e) - throw new q.default('Attempting to register a partial called "' + t + '" as undefined'); - this.partials[t] = e; - } }, unregisterPartial: function (t) { delete this.partials[t]; }, registerDecorator: function (t, e) { if (U.toString.call(t) === Y) { - if (e) - throw new q.default("Arg not supported with multiple decorators"); - U.extend(this.decorators, t); - } - else - this.decorators[t] = e; }, unregisterDecorator: function (t) { delete this.decorators[t]; }, resetLoggedPropertyAccesses: function () { z.resetLoggedProperties(); } }; -var Z = G.default.log; -r.log = Z, r.createFrame = U.createFrame, r.logger = G.default; -var Q = { exports: {} }; -!function (t, e) { function r(t) { this.string = t; } e.__esModule = !0, r.prototype.toString = r.prototype.toHTML = function () { return "" + this.string; }, e.default = r, t.exports = e.default; }(Q, Q.exports); -var tt = {}, et = {}; -et.__esModule = !0, et.wrapHelper = function (t, e) { if ("function" != typeof t) - return t; return function () { return arguments[arguments.length - 1] = e(arguments[arguments.length - 1]), t.apply(this, arguments); }; }, tt.__esModule = !0, tt.checkRevision = function (t) { var e = t && t[0] || 1, r = it.COMPILER_REVISION; if (e >= it.LAST_COMPATIBLE_COMPILER_REVISION && e <= it.COMPILER_REVISION) - return; if (e < it.LAST_COMPATIBLE_COMPILER_REVISION) { - var s = it.REVISION_CHANGES[r], i = it.REVISION_CHANGES[e]; - throw new st.default("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version (" + s + ") or downgrade your runtime to an older version (" + i + ")."); -} throw new st.default("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version (" + t[1] + ")."); }, tt.template = function (t, e) { if (!e) - throw new st.default("No environment passed to template"); if (!t || !t.main) - throw new st.default("Unknown template object: " + typeof t); t.main.decorator = t.main_d, e.VM.checkRevision(t.compiler); var r = t.compiler && 7 === t.compiler[0]; var s = { strict: function (t, e, r) { if (!t || !(e in t)) - throw new st.default('"' + e + '" not defined in ' + t, { loc: r }); return s.lookupProperty(t, e); }, lookupProperty: function (t, e) { var r = t[e]; return null == r || Object.prototype.hasOwnProperty.call(t, e) || at.resultIsAllowed(r, s.protoAccessControl, e) ? r : void 0; }, lookup: function (t, e) { for (var r = t.length, i = 0; i < r; i++) { - if (null != (t[i] && s.lookupProperty(t[i], e))) - return t[i][e]; - } }, lambda: function (t, e) { return "function" == typeof t ? t.call(e) : t; }, escapeExpression: rt.escapeExpression, invokePartial: function (r, s, i) { i.hash && (s = rt.extend({}, s, i.hash), i.ids && (i.ids[0] = !0)), r = e.VM.resolvePartial.call(this, r, s, i); var n = rt.extend({}, i, { hooks: this.hooks, protoAccessControl: this.protoAccessControl }), o = e.VM.invokePartial.call(this, r, s, n); if (null == o && e.compile && (i.partials[i.name] = e.compile(r, t.compilerOptions, e), o = i.partials[i.name](s, n)), null != o) { - if (i.indent) { - for (var a = o.split("\n"), l = 0, c = a.length; l < c && (a[l] || l + 1 !== c); l++) - a[l] = i.indent + a[l]; - o = a.join("\n"); - } - return o; - } throw new st.default("The partial " + i.name + " could not be compiled when running in runtime-only mode"); }, fn: function (e) { var r = t[e]; return r.decorator = t[e + "_d"], r; }, programs: [], program: function (t, e, r, s, i) { var n = this.programs[t], o = this.fn(t); return e || i || s || r ? n = lt(this, t, o, e, r, s, i) : n || (n = this.programs[t] = lt(this, t, o)), n; }, data: function (t, e) { for (; t && e--;) - t = t._parent; return t; }, mergeIfNeeded: function (t, e) { var r = t || e; return t && e && t !== e && (r = rt.extend({}, e, t)), r; }, nullContext: Object.seal({}), noop: e.VM.noop, compilerInfo: t.compiler }; function i(e) { var r = arguments.length <= 1 || void 0 === arguments[1] ? {} : arguments[1], n = r.data; i._setup(r), !r.partial && t.useData && (n = function (t, e) { e && "root" in e || ((e = e ? it.createFrame(e) : {}).root = t); return e; }(e, n)); var o = void 0, a = t.useBlockParams ? [] : void 0; function l(e) { return "" + t.main(s, e, s.helpers, s.partials, n, a, o); } return t.useDepths && (o = r.depths ? e != r.depths[0] ? [e].concat(r.depths) : r.depths : [e]), (l = pt(t.main, l, s, r.depths || [], n, a))(e, r); } return i.isTop = !0, i._setup = function (i) { if (i.partial) - s.protoAccessControl = i.protoAccessControl, s.helpers = i.helpers, s.partials = i.partials, s.decorators = i.decorators, s.hooks = i.hooks; -else { - var n = rt.extend({}, e.helpers, i.helpers); - !function (t, e) { Object.keys(t).forEach((function (r) { var s = t[r]; t[r] = function (t, e) { var r = e.lookupProperty; return ot.wrapHelper(t, (function (t) { return rt.extend({ lookupProperty: r }, t); })); }(s, e); })); }(n, s), s.helpers = n, t.usePartial && (s.partials = s.mergeIfNeeded(i.partials, e.partials)), (t.usePartial || t.useDecorators) && (s.decorators = rt.extend({}, e.decorators, i.decorators)), s.hooks = {}, s.protoAccessControl = at.createProtoAccessControl(i); - var o = i.allowCallsToHelperMissing || r; - nt.moveHelperToHooks(s, "helperMissing", o), nt.moveHelperToHooks(s, "blockHelperMissing", o); -} }, i._child = function (e, r, i, n) { if (t.useBlockParams && !i) - throw new st.default("must pass block params"); if (t.useDepths && !n) - throw new st.default("must pass parent depths"); return lt(s, e, t[e], r, 0, i, n); }, i; }, tt.wrapProgram = lt, tt.resolvePartial = function (t, e, r) { t ? t.call || r.name || (r.name = t, t = r.partials[t]) : t = "@partial-block" === r.name ? r.data["partial-block"] : r.partials[r.name]; return t; }, tt.invokePartial = function (t, e, r) { var s = r.data && r.data["partial-block"]; r.partial = !0, r.ids && (r.data.contextPath = r.ids[0] || r.data.contextPath); var i = void 0; r.fn && r.fn !== ct && function () { r.data = it.createFrame(r.data); var t = r.fn; i = r.data["partial-block"] = function (e) { var r = arguments.length <= 1 || void 0 === arguments[1] ? {} : arguments[1]; return r.data = it.createFrame(r.data), r.data["partial-block"] = s, t(e, r); }, t.partials && (r.partials = rt.extend({}, r.partials, t.partials)); }(); void 0 === t && i && (t = i); if (void 0 === t) - throw new st.default("The partial " + r.name + " could not be found"); if (t instanceof Function) - return t(e, r); }, tt.noop = ct; -var rt = function (t) { if (t && t.__esModule) - return t; var e = {}; if (null != t) - for (var r in t) - Object.prototype.hasOwnProperty.call(t, r) && (e[r] = t[r]); return e.default = t, e; }(s), st = function (t) { return t && t.__esModule ? t : { default: t }; }(u.exports), it = r, nt = f, ot = et, at = H; -function lt(t, e, r, s, i, n, o) { function a(e) { var i = arguments.length <= 1 || void 0 === arguments[1] ? {} : arguments[1], a = o; return !o || e == o[0] || e === t.nullContext && null === o[0] || (a = [e].concat(o)), r(t, e, t.helpers, t.partials, i.data || s, n && [i.blockParams].concat(n), a); } return (a = pt(r, a, t, o, s, n)).program = e, a.depth = o ? o.length : 0, a.blockParams = i || 0, a; } -function ct() { return ""; } -function pt(t, e, r, s, i, n) { if (t.decorator) { - var o = {}; - e = t.decorator(e, o, r, s && s[0], i, n, s), rt.extend(e, o); -} return e; } -var ht = { exports: {} }; -!function (t, e) { e.__esModule = !0, e.default = function (t) { "object" != typeof globalThis && (Object.prototype.__defineGetter__("__magic__", (function () { return this; })), __magic__.globalThis = __magic__, delete Object.prototype.__magic__); var e = globalThis.Handlebars; t.noConflict = function () { return globalThis.Handlebars === t && (globalThis.Handlebars = e), t; }; }, t.exports = e.default; }(ht, ht.exports), function (t, e) { function i(t) { return t && t.__esModule ? t : { default: t }; } function n(t) { if (t && t.__esModule) - return t; var e = {}; if (null != t) - for (var r in t) - Object.prototype.hasOwnProperty.call(t, r) && (e[r] = t[r]); return e.default = t, e; } e.__esModule = !0; var o = n(r), a = i(Q.exports), l = i(u.exports), c = n(s), p = n(tt), h = i(ht.exports); function f() { var t = new o.HandlebarsEnvironment; return c.extend(t, o), t.SafeString = a.default, t.Exception = l.default, t.Utils = c, t.escapeExpression = c.escapeExpression, t.VM = p, t.template = function (e) { return p.template(e, t); }, t; } var d = f(); d.create = f, h.default(d), d.default = d, e.default = d, t.exports = e.default; }(e, e.exports); -var ut = { exports: {} }; -!function (t, e) { e.__esModule = !0; var r = { helpers: { helperExpression: function (t) { return "SubExpression" === t.type || ("MustacheStatement" === t.type || "BlockStatement" === t.type) && !!(t.params && t.params.length || t.hash); }, scopedId: function (t) { return /^\.|this\b/.test(t.original); }, simpleId: function (t) { return 1 === t.parts.length && !r.helpers.scopedId(t) && !t.depth; } } }; e.default = r, t.exports = e.default; }(ut, ut.exports); -var ft = {}, dt = { exports: {} }; -!function (t, e) { e.__esModule = !0; var r = function () { var t = { trace: function () { }, yy: {}, symbols_: { error: 2, root: 3, program: 4, EOF: 5, program_repetition0: 6, statement: 7, mustache: 8, block: 9, rawBlock: 10, partial: 11, partialBlock: 12, content: 13, COMMENT: 14, CONTENT: 15, openRawBlock: 16, rawBlock_repetition0: 17, END_RAW_BLOCK: 18, OPEN_RAW_BLOCK: 19, helperName: 20, openRawBlock_repetition0: 21, openRawBlock_option0: 22, CLOSE_RAW_BLOCK: 23, openBlock: 24, block_option0: 25, closeBlock: 26, openInverse: 27, block_option1: 28, OPEN_BLOCK: 29, openBlock_repetition0: 30, openBlock_option0: 31, openBlock_option1: 32, CLOSE: 33, OPEN_INVERSE: 34, openInverse_repetition0: 35, openInverse_option0: 36, openInverse_option1: 37, openInverseChain: 38, OPEN_INVERSE_CHAIN: 39, openInverseChain_repetition0: 40, openInverseChain_option0: 41, openInverseChain_option1: 42, inverseAndProgram: 43, INVERSE: 44, inverseChain: 45, inverseChain_option0: 46, OPEN_ENDBLOCK: 47, OPEN: 48, mustache_repetition0: 49, mustache_option0: 50, OPEN_UNESCAPED: 51, mustache_repetition1: 52, mustache_option1: 53, CLOSE_UNESCAPED: 54, OPEN_PARTIAL: 55, partialName: 56, partial_repetition0: 57, partial_option0: 58, openPartialBlock: 59, OPEN_PARTIAL_BLOCK: 60, openPartialBlock_repetition0: 61, openPartialBlock_option0: 62, param: 63, sexpr: 64, OPEN_SEXPR: 65, sexpr_repetition0: 66, sexpr_option0: 67, CLOSE_SEXPR: 68, hash: 69, hash_repetition_plus0: 70, hashSegment: 71, ID: 72, EQUALS: 73, blockParams: 74, OPEN_BLOCK_PARAMS: 75, blockParams_repetition_plus0: 76, CLOSE_BLOCK_PARAMS: 77, path: 78, dataName: 79, STRING: 80, NUMBER: 81, BOOLEAN: 82, UNDEFINED: 83, NULL: 84, DATA: 85, pathSegments: 86, SEP: 87, $accept: 0, $end: 1 }, terminals_: { 2: "error", 5: "EOF", 14: "COMMENT", 15: "CONTENT", 18: "END_RAW_BLOCK", 19: "OPEN_RAW_BLOCK", 23: "CLOSE_RAW_BLOCK", 29: "OPEN_BLOCK", 33: "CLOSE", 34: "OPEN_INVERSE", 39: "OPEN_INVERSE_CHAIN", 44: "INVERSE", 47: "OPEN_ENDBLOCK", 48: "OPEN", 51: "OPEN_UNESCAPED", 54: "CLOSE_UNESCAPED", 55: "OPEN_PARTIAL", 60: "OPEN_PARTIAL_BLOCK", 65: "OPEN_SEXPR", 68: "CLOSE_SEXPR", 72: "ID", 73: "EQUALS", 75: "OPEN_BLOCK_PARAMS", 77: "CLOSE_BLOCK_PARAMS", 80: "STRING", 81: "NUMBER", 82: "BOOLEAN", 83: "UNDEFINED", 84: "NULL", 85: "DATA", 87: "SEP" }, productions_: [0, [3, 2], [4, 1], [7, 1], [7, 1], [7, 1], [7, 1], [7, 1], [7, 1], [7, 1], [13, 1], [10, 3], [16, 5], [9, 4], [9, 4], [24, 6], [27, 6], [38, 6], [43, 2], [45, 3], [45, 1], [26, 3], [8, 5], [8, 5], [11, 5], [12, 3], [59, 5], [63, 1], [63, 1], [64, 5], [69, 1], [71, 3], [74, 3], [20, 1], [20, 1], [20, 1], [20, 1], [20, 1], [20, 1], [20, 1], [56, 1], [56, 1], [79, 2], [78, 1], [86, 3], [86, 1], [6, 0], [6, 2], [17, 0], [17, 2], [21, 0], [21, 2], [22, 0], [22, 1], [25, 0], [25, 1], [28, 0], [28, 1], [30, 0], [30, 2], [31, 0], [31, 1], [32, 0], [32, 1], [35, 0], [35, 2], [36, 0], [36, 1], [37, 0], [37, 1], [40, 0], [40, 2], [41, 0], [41, 1], [42, 0], [42, 1], [46, 0], [46, 1], [49, 0], [49, 2], [50, 0], [50, 1], [52, 0], [52, 2], [53, 0], [53, 1], [57, 0], [57, 2], [58, 0], [58, 1], [61, 0], [61, 2], [62, 0], [62, 1], [66, 0], [66, 2], [67, 0], [67, 1], [70, 1], [70, 2], [76, 1], [76, 2]], performAction: function (t, e, r, s, i, n, o) { var a = n.length - 1; switch (i) { - case 1: return n[a - 1]; - case 2: - this.$ = s.prepareProgram(n[a]); - break; - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 20: - case 27: - case 28: - case 33: - case 34: - case 40: - case 41: - this.$ = n[a]; - break; - case 9: - this.$ = { type: "CommentStatement", value: s.stripComment(n[a]), strip: s.stripFlags(n[a], n[a]), loc: s.locInfo(this._$) }; - break; - case 10: - this.$ = { type: "ContentStatement", original: n[a], value: n[a], loc: s.locInfo(this._$) }; - break; - case 11: - this.$ = s.prepareRawBlock(n[a - 2], n[a - 1], n[a], this._$); - break; - case 12: - this.$ = { path: n[a - 3], params: n[a - 2], hash: n[a - 1] }; - break; - case 13: - this.$ = s.prepareBlock(n[a - 3], n[a - 2], n[a - 1], n[a], !1, this._$); - break; - case 14: - this.$ = s.prepareBlock(n[a - 3], n[a - 2], n[a - 1], n[a], !0, this._$); - break; - case 15: - this.$ = { open: n[a - 5], path: n[a - 4], params: n[a - 3], hash: n[a - 2], blockParams: n[a - 1], strip: s.stripFlags(n[a - 5], n[a]) }; - break; - case 16: - case 17: - this.$ = { path: n[a - 4], params: n[a - 3], hash: n[a - 2], blockParams: n[a - 1], strip: s.stripFlags(n[a - 5], n[a]) }; - break; - case 18: - this.$ = { strip: s.stripFlags(n[a - 1], n[a - 1]), program: n[a] }; - break; - case 19: - var l = s.prepareBlock(n[a - 2], n[a - 1], n[a], n[a], !1, this._$), c = s.prepareProgram([l], n[a - 1].loc); - c.chained = !0, this.$ = { strip: n[a - 2].strip, program: c, chain: !0 }; - break; - case 21: - this.$ = { path: n[a - 1], strip: s.stripFlags(n[a - 2], n[a]) }; - break; - case 22: - case 23: - this.$ = s.prepareMustache(n[a - 3], n[a - 2], n[a - 1], n[a - 4], s.stripFlags(n[a - 4], n[a]), this._$); - break; - case 24: - this.$ = { type: "PartialStatement", name: n[a - 3], params: n[a - 2], hash: n[a - 1], indent: "", strip: s.stripFlags(n[a - 4], n[a]), loc: s.locInfo(this._$) }; - break; - case 25: - this.$ = s.preparePartialBlock(n[a - 2], n[a - 1], n[a], this._$); - break; - case 26: - this.$ = { path: n[a - 3], params: n[a - 2], hash: n[a - 1], strip: s.stripFlags(n[a - 4], n[a]) }; - break; - case 29: - this.$ = { type: "SubExpression", path: n[a - 3], params: n[a - 2], hash: n[a - 1], loc: s.locInfo(this._$) }; - break; - case 30: - this.$ = { type: "Hash", pairs: n[a], loc: s.locInfo(this._$) }; - break; - case 31: - this.$ = { type: "HashPair", key: s.id(n[a - 2]), value: n[a], loc: s.locInfo(this._$) }; - break; - case 32: - this.$ = s.id(n[a - 1]); - break; - case 35: - this.$ = { type: "StringLiteral", value: n[a], original: n[a], loc: s.locInfo(this._$) }; - break; - case 36: - this.$ = { type: "NumberLiteral", value: Number(n[a]), original: Number(n[a]), loc: s.locInfo(this._$) }; - break; - case 37: - this.$ = { type: "BooleanLiteral", value: "true" === n[a], original: "true" === n[a], loc: s.locInfo(this._$) }; - break; - case 38: - this.$ = { type: "UndefinedLiteral", original: void 0, value: void 0, loc: s.locInfo(this._$) }; - break; - case 39: - this.$ = { type: "NullLiteral", original: null, value: null, loc: s.locInfo(this._$) }; - break; - case 42: - this.$ = s.preparePath(!0, n[a], this._$); - break; - case 43: - this.$ = s.preparePath(!1, n[a], this._$); - break; - case 44: - n[a - 2].push({ part: s.id(n[a]), original: n[a], separator: n[a - 1] }), this.$ = n[a - 2]; - break; - case 45: - this.$ = [{ part: s.id(n[a]), original: n[a] }]; - break; - case 46: - case 48: - case 50: - case 58: - case 64: - case 70: - case 78: - case 82: - case 86: - case 90: - case 94: - this.$ = []; - break; - case 47: - case 49: - case 51: - case 59: - case 65: - case 71: - case 79: - case 83: - case 87: - case 91: - case 95: - case 99: - case 101: - n[a - 1].push(n[a]); - break; - case 98: - case 100: this.$ = [n[a]]; - } }, table: [{ 3: 1, 4: 2, 5: [2, 46], 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 1: [3] }, { 5: [1, 4] }, { 5: [2, 2], 7: 5, 8: 6, 9: 7, 10: 8, 11: 9, 12: 10, 13: 11, 14: [1, 12], 15: [1, 20], 16: 17, 19: [1, 23], 24: 15, 27: 16, 29: [1, 21], 34: [1, 22], 39: [2, 2], 44: [2, 2], 47: [2, 2], 48: [1, 13], 51: [1, 14], 55: [1, 18], 59: 19, 60: [1, 24] }, { 1: [2, 1] }, { 5: [2, 47], 14: [2, 47], 15: [2, 47], 19: [2, 47], 29: [2, 47], 34: [2, 47], 39: [2, 47], 44: [2, 47], 47: [2, 47], 48: [2, 47], 51: [2, 47], 55: [2, 47], 60: [2, 47] }, { 5: [2, 3], 14: [2, 3], 15: [2, 3], 19: [2, 3], 29: [2, 3], 34: [2, 3], 39: [2, 3], 44: [2, 3], 47: [2, 3], 48: [2, 3], 51: [2, 3], 55: [2, 3], 60: [2, 3] }, { 5: [2, 4], 14: [2, 4], 15: [2, 4], 19: [2, 4], 29: [2, 4], 34: [2, 4], 39: [2, 4], 44: [2, 4], 47: [2, 4], 48: [2, 4], 51: [2, 4], 55: [2, 4], 60: [2, 4] }, { 5: [2, 5], 14: [2, 5], 15: [2, 5], 19: [2, 5], 29: [2, 5], 34: [2, 5], 39: [2, 5], 44: [2, 5], 47: [2, 5], 48: [2, 5], 51: [2, 5], 55: [2, 5], 60: [2, 5] }, { 5: [2, 6], 14: [2, 6], 15: [2, 6], 19: [2, 6], 29: [2, 6], 34: [2, 6], 39: [2, 6], 44: [2, 6], 47: [2, 6], 48: [2, 6], 51: [2, 6], 55: [2, 6], 60: [2, 6] }, { 5: [2, 7], 14: [2, 7], 15: [2, 7], 19: [2, 7], 29: [2, 7], 34: [2, 7], 39: [2, 7], 44: [2, 7], 47: [2, 7], 48: [2, 7], 51: [2, 7], 55: [2, 7], 60: [2, 7] }, { 5: [2, 8], 14: [2, 8], 15: [2, 8], 19: [2, 8], 29: [2, 8], 34: [2, 8], 39: [2, 8], 44: [2, 8], 47: [2, 8], 48: [2, 8], 51: [2, 8], 55: [2, 8], 60: [2, 8] }, { 5: [2, 9], 14: [2, 9], 15: [2, 9], 19: [2, 9], 29: [2, 9], 34: [2, 9], 39: [2, 9], 44: [2, 9], 47: [2, 9], 48: [2, 9], 51: [2, 9], 55: [2, 9], 60: [2, 9] }, { 20: 25, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 36, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 4: 37, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 39: [2, 46], 44: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 4: 38, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 44: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 15: [2, 48], 17: 39, 18: [2, 48] }, { 20: 41, 56: 40, 64: 42, 65: [1, 43], 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 4: 44, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 5: [2, 10], 14: [2, 10], 15: [2, 10], 18: [2, 10], 19: [2, 10], 29: [2, 10], 34: [2, 10], 39: [2, 10], 44: [2, 10], 47: [2, 10], 48: [2, 10], 51: [2, 10], 55: [2, 10], 60: [2, 10] }, { 20: 45, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 46, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 47, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 41, 56: 48, 64: 42, 65: [1, 43], 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 33: [2, 78], 49: 49, 65: [2, 78], 72: [2, 78], 80: [2, 78], 81: [2, 78], 82: [2, 78], 83: [2, 78], 84: [2, 78], 85: [2, 78] }, { 23: [2, 33], 33: [2, 33], 54: [2, 33], 65: [2, 33], 68: [2, 33], 72: [2, 33], 75: [2, 33], 80: [2, 33], 81: [2, 33], 82: [2, 33], 83: [2, 33], 84: [2, 33], 85: [2, 33] }, { 23: [2, 34], 33: [2, 34], 54: [2, 34], 65: [2, 34], 68: [2, 34], 72: [2, 34], 75: [2, 34], 80: [2, 34], 81: [2, 34], 82: [2, 34], 83: [2, 34], 84: [2, 34], 85: [2, 34] }, { 23: [2, 35], 33: [2, 35], 54: [2, 35], 65: [2, 35], 68: [2, 35], 72: [2, 35], 75: [2, 35], 80: [2, 35], 81: [2, 35], 82: [2, 35], 83: [2, 35], 84: [2, 35], 85: [2, 35] }, { 23: [2, 36], 33: [2, 36], 54: [2, 36], 65: [2, 36], 68: [2, 36], 72: [2, 36], 75: [2, 36], 80: [2, 36], 81: [2, 36], 82: [2, 36], 83: [2, 36], 84: [2, 36], 85: [2, 36] }, { 23: [2, 37], 33: [2, 37], 54: [2, 37], 65: [2, 37], 68: [2, 37], 72: [2, 37], 75: [2, 37], 80: [2, 37], 81: [2, 37], 82: [2, 37], 83: [2, 37], 84: [2, 37], 85: [2, 37] }, { 23: [2, 38], 33: [2, 38], 54: [2, 38], 65: [2, 38], 68: [2, 38], 72: [2, 38], 75: [2, 38], 80: [2, 38], 81: [2, 38], 82: [2, 38], 83: [2, 38], 84: [2, 38], 85: [2, 38] }, { 23: [2, 39], 33: [2, 39], 54: [2, 39], 65: [2, 39], 68: [2, 39], 72: [2, 39], 75: [2, 39], 80: [2, 39], 81: [2, 39], 82: [2, 39], 83: [2, 39], 84: [2, 39], 85: [2, 39] }, { 23: [2, 43], 33: [2, 43], 54: [2, 43], 65: [2, 43], 68: [2, 43], 72: [2, 43], 75: [2, 43], 80: [2, 43], 81: [2, 43], 82: [2, 43], 83: [2, 43], 84: [2, 43], 85: [2, 43], 87: [1, 50] }, { 72: [1, 35], 86: 51 }, { 23: [2, 45], 33: [2, 45], 54: [2, 45], 65: [2, 45], 68: [2, 45], 72: [2, 45], 75: [2, 45], 80: [2, 45], 81: [2, 45], 82: [2, 45], 83: [2, 45], 84: [2, 45], 85: [2, 45], 87: [2, 45] }, { 52: 52, 54: [2, 82], 65: [2, 82], 72: [2, 82], 80: [2, 82], 81: [2, 82], 82: [2, 82], 83: [2, 82], 84: [2, 82], 85: [2, 82] }, { 25: 53, 38: 55, 39: [1, 57], 43: 56, 44: [1, 58], 45: 54, 47: [2, 54] }, { 28: 59, 43: 60, 44: [1, 58], 47: [2, 56] }, { 13: 62, 15: [1, 20], 18: [1, 61] }, { 33: [2, 86], 57: 63, 65: [2, 86], 72: [2, 86], 80: [2, 86], 81: [2, 86], 82: [2, 86], 83: [2, 86], 84: [2, 86], 85: [2, 86] }, { 33: [2, 40], 65: [2, 40], 72: [2, 40], 80: [2, 40], 81: [2, 40], 82: [2, 40], 83: [2, 40], 84: [2, 40], 85: [2, 40] }, { 33: [2, 41], 65: [2, 41], 72: [2, 41], 80: [2, 41], 81: [2, 41], 82: [2, 41], 83: [2, 41], 84: [2, 41], 85: [2, 41] }, { 20: 64, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 26: 65, 47: [1, 66] }, { 30: 67, 33: [2, 58], 65: [2, 58], 72: [2, 58], 75: [2, 58], 80: [2, 58], 81: [2, 58], 82: [2, 58], 83: [2, 58], 84: [2, 58], 85: [2, 58] }, { 33: [2, 64], 35: 68, 65: [2, 64], 72: [2, 64], 75: [2, 64], 80: [2, 64], 81: [2, 64], 82: [2, 64], 83: [2, 64], 84: [2, 64], 85: [2, 64] }, { 21: 69, 23: [2, 50], 65: [2, 50], 72: [2, 50], 80: [2, 50], 81: [2, 50], 82: [2, 50], 83: [2, 50], 84: [2, 50], 85: [2, 50] }, { 33: [2, 90], 61: 70, 65: [2, 90], 72: [2, 90], 80: [2, 90], 81: [2, 90], 82: [2, 90], 83: [2, 90], 84: [2, 90], 85: [2, 90] }, { 20: 74, 33: [2, 80], 50: 71, 63: 72, 64: 75, 65: [1, 43], 69: 73, 70: 76, 71: 77, 72: [1, 78], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 72: [1, 79] }, { 23: [2, 42], 33: [2, 42], 54: [2, 42], 65: [2, 42], 68: [2, 42], 72: [2, 42], 75: [2, 42], 80: [2, 42], 81: [2, 42], 82: [2, 42], 83: [2, 42], 84: [2, 42], 85: [2, 42], 87: [1, 50] }, { 20: 74, 53: 80, 54: [2, 84], 63: 81, 64: 75, 65: [1, 43], 69: 82, 70: 76, 71: 77, 72: [1, 78], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 26: 83, 47: [1, 66] }, { 47: [2, 55] }, { 4: 84, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 39: [2, 46], 44: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 47: [2, 20] }, { 20: 85, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 4: 86, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 26: 87, 47: [1, 66] }, { 47: [2, 57] }, { 5: [2, 11], 14: [2, 11], 15: [2, 11], 19: [2, 11], 29: [2, 11], 34: [2, 11], 39: [2, 11], 44: [2, 11], 47: [2, 11], 48: [2, 11], 51: [2, 11], 55: [2, 11], 60: [2, 11] }, { 15: [2, 49], 18: [2, 49] }, { 20: 74, 33: [2, 88], 58: 88, 63: 89, 64: 75, 65: [1, 43], 69: 90, 70: 76, 71: 77, 72: [1, 78], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 65: [2, 94], 66: 91, 68: [2, 94], 72: [2, 94], 80: [2, 94], 81: [2, 94], 82: [2, 94], 83: [2, 94], 84: [2, 94], 85: [2, 94] }, { 5: [2, 25], 14: [2, 25], 15: [2, 25], 19: [2, 25], 29: [2, 25], 34: [2, 25], 39: [2, 25], 44: [2, 25], 47: [2, 25], 48: [2, 25], 51: [2, 25], 55: [2, 25], 60: [2, 25] }, { 20: 92, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 74, 31: 93, 33: [2, 60], 63: 94, 64: 75, 65: [1, 43], 69: 95, 70: 76, 71: 77, 72: [1, 78], 75: [2, 60], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 74, 33: [2, 66], 36: 96, 63: 97, 64: 75, 65: [1, 43], 69: 98, 70: 76, 71: 77, 72: [1, 78], 75: [2, 66], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 74, 22: 99, 23: [2, 52], 63: 100, 64: 75, 65: [1, 43], 69: 101, 70: 76, 71: 77, 72: [1, 78], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 74, 33: [2, 92], 62: 102, 63: 103, 64: 75, 65: [1, 43], 69: 104, 70: 76, 71: 77, 72: [1, 78], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 33: [1, 105] }, { 33: [2, 79], 65: [2, 79], 72: [2, 79], 80: [2, 79], 81: [2, 79], 82: [2, 79], 83: [2, 79], 84: [2, 79], 85: [2, 79] }, { 33: [2, 81] }, { 23: [2, 27], 33: [2, 27], 54: [2, 27], 65: [2, 27], 68: [2, 27], 72: [2, 27], 75: [2, 27], 80: [2, 27], 81: [2, 27], 82: [2, 27], 83: [2, 27], 84: [2, 27], 85: [2, 27] }, { 23: [2, 28], 33: [2, 28], 54: [2, 28], 65: [2, 28], 68: [2, 28], 72: [2, 28], 75: [2, 28], 80: [2, 28], 81: [2, 28], 82: [2, 28], 83: [2, 28], 84: [2, 28], 85: [2, 28] }, { 23: [2, 30], 33: [2, 30], 54: [2, 30], 68: [2, 30], 71: 106, 72: [1, 107], 75: [2, 30] }, { 23: [2, 98], 33: [2, 98], 54: [2, 98], 68: [2, 98], 72: [2, 98], 75: [2, 98] }, { 23: [2, 45], 33: [2, 45], 54: [2, 45], 65: [2, 45], 68: [2, 45], 72: [2, 45], 73: [1, 108], 75: [2, 45], 80: [2, 45], 81: [2, 45], 82: [2, 45], 83: [2, 45], 84: [2, 45], 85: [2, 45], 87: [2, 45] }, { 23: [2, 44], 33: [2, 44], 54: [2, 44], 65: [2, 44], 68: [2, 44], 72: [2, 44], 75: [2, 44], 80: [2, 44], 81: [2, 44], 82: [2, 44], 83: [2, 44], 84: [2, 44], 85: [2, 44], 87: [2, 44] }, { 54: [1, 109] }, { 54: [2, 83], 65: [2, 83], 72: [2, 83], 80: [2, 83], 81: [2, 83], 82: [2, 83], 83: [2, 83], 84: [2, 83], 85: [2, 83] }, { 54: [2, 85] }, { 5: [2, 13], 14: [2, 13], 15: [2, 13], 19: [2, 13], 29: [2, 13], 34: [2, 13], 39: [2, 13], 44: [2, 13], 47: [2, 13], 48: [2, 13], 51: [2, 13], 55: [2, 13], 60: [2, 13] }, { 38: 55, 39: [1, 57], 43: 56, 44: [1, 58], 45: 111, 46: 110, 47: [2, 76] }, { 33: [2, 70], 40: 112, 65: [2, 70], 72: [2, 70], 75: [2, 70], 80: [2, 70], 81: [2, 70], 82: [2, 70], 83: [2, 70], 84: [2, 70], 85: [2, 70] }, { 47: [2, 18] }, { 5: [2, 14], 14: [2, 14], 15: [2, 14], 19: [2, 14], 29: [2, 14], 34: [2, 14], 39: [2, 14], 44: [2, 14], 47: [2, 14], 48: [2, 14], 51: [2, 14], 55: [2, 14], 60: [2, 14] }, { 33: [1, 113] }, { 33: [2, 87], 65: [2, 87], 72: [2, 87], 80: [2, 87], 81: [2, 87], 82: [2, 87], 83: [2, 87], 84: [2, 87], 85: [2, 87] }, { 33: [2, 89] }, { 20: 74, 63: 115, 64: 75, 65: [1, 43], 67: 114, 68: [2, 96], 69: 116, 70: 76, 71: 77, 72: [1, 78], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 33: [1, 117] }, { 32: 118, 33: [2, 62], 74: 119, 75: [1, 120] }, { 33: [2, 59], 65: [2, 59], 72: [2, 59], 75: [2, 59], 80: [2, 59], 81: [2, 59], 82: [2, 59], 83: [2, 59], 84: [2, 59], 85: [2, 59] }, { 33: [2, 61], 75: [2, 61] }, { 33: [2, 68], 37: 121, 74: 122, 75: [1, 120] }, { 33: [2, 65], 65: [2, 65], 72: [2, 65], 75: [2, 65], 80: [2, 65], 81: [2, 65], 82: [2, 65], 83: [2, 65], 84: [2, 65], 85: [2, 65] }, { 33: [2, 67], 75: [2, 67] }, { 23: [1, 123] }, { 23: [2, 51], 65: [2, 51], 72: [2, 51], 80: [2, 51], 81: [2, 51], 82: [2, 51], 83: [2, 51], 84: [2, 51], 85: [2, 51] }, { 23: [2, 53] }, { 33: [1, 124] }, { 33: [2, 91], 65: [2, 91], 72: [2, 91], 80: [2, 91], 81: [2, 91], 82: [2, 91], 83: [2, 91], 84: [2, 91], 85: [2, 91] }, { 33: [2, 93] }, { 5: [2, 22], 14: [2, 22], 15: [2, 22], 19: [2, 22], 29: [2, 22], 34: [2, 22], 39: [2, 22], 44: [2, 22], 47: [2, 22], 48: [2, 22], 51: [2, 22], 55: [2, 22], 60: [2, 22] }, { 23: [2, 99], 33: [2, 99], 54: [2, 99], 68: [2, 99], 72: [2, 99], 75: [2, 99] }, { 73: [1, 108] }, { 20: 74, 63: 125, 64: 75, 65: [1, 43], 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 5: [2, 23], 14: [2, 23], 15: [2, 23], 19: [2, 23], 29: [2, 23], 34: [2, 23], 39: [2, 23], 44: [2, 23], 47: [2, 23], 48: [2, 23], 51: [2, 23], 55: [2, 23], 60: [2, 23] }, { 47: [2, 19] }, { 47: [2, 77] }, { 20: 74, 33: [2, 72], 41: 126, 63: 127, 64: 75, 65: [1, 43], 69: 128, 70: 76, 71: 77, 72: [1, 78], 75: [2, 72], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 5: [2, 24], 14: [2, 24], 15: [2, 24], 19: [2, 24], 29: [2, 24], 34: [2, 24], 39: [2, 24], 44: [2, 24], 47: [2, 24], 48: [2, 24], 51: [2, 24], 55: [2, 24], 60: [2, 24] }, { 68: [1, 129] }, { 65: [2, 95], 68: [2, 95], 72: [2, 95], 80: [2, 95], 81: [2, 95], 82: [2, 95], 83: [2, 95], 84: [2, 95], 85: [2, 95] }, { 68: [2, 97] }, { 5: [2, 21], 14: [2, 21], 15: [2, 21], 19: [2, 21], 29: [2, 21], 34: [2, 21], 39: [2, 21], 44: [2, 21], 47: [2, 21], 48: [2, 21], 51: [2, 21], 55: [2, 21], 60: [2, 21] }, { 33: [1, 130] }, { 33: [2, 63] }, { 72: [1, 132], 76: 131 }, { 33: [1, 133] }, { 33: [2, 69] }, { 15: [2, 12], 18: [2, 12] }, { 14: [2, 26], 15: [2, 26], 19: [2, 26], 29: [2, 26], 34: [2, 26], 47: [2, 26], 48: [2, 26], 51: [2, 26], 55: [2, 26], 60: [2, 26] }, { 23: [2, 31], 33: [2, 31], 54: [2, 31], 68: [2, 31], 72: [2, 31], 75: [2, 31] }, { 33: [2, 74], 42: 134, 74: 135, 75: [1, 120] }, { 33: [2, 71], 65: [2, 71], 72: [2, 71], 75: [2, 71], 80: [2, 71], 81: [2, 71], 82: [2, 71], 83: [2, 71], 84: [2, 71], 85: [2, 71] }, { 33: [2, 73], 75: [2, 73] }, { 23: [2, 29], 33: [2, 29], 54: [2, 29], 65: [2, 29], 68: [2, 29], 72: [2, 29], 75: [2, 29], 80: [2, 29], 81: [2, 29], 82: [2, 29], 83: [2, 29], 84: [2, 29], 85: [2, 29] }, { 14: [2, 15], 15: [2, 15], 19: [2, 15], 29: [2, 15], 34: [2, 15], 39: [2, 15], 44: [2, 15], 47: [2, 15], 48: [2, 15], 51: [2, 15], 55: [2, 15], 60: [2, 15] }, { 72: [1, 137], 77: [1, 136] }, { 72: [2, 100], 77: [2, 100] }, { 14: [2, 16], 15: [2, 16], 19: [2, 16], 29: [2, 16], 34: [2, 16], 44: [2, 16], 47: [2, 16], 48: [2, 16], 51: [2, 16], 55: [2, 16], 60: [2, 16] }, { 33: [1, 138] }, { 33: [2, 75] }, { 33: [2, 32] }, { 72: [2, 101], 77: [2, 101] }, { 14: [2, 17], 15: [2, 17], 19: [2, 17], 29: [2, 17], 34: [2, 17], 39: [2, 17], 44: [2, 17], 47: [2, 17], 48: [2, 17], 51: [2, 17], 55: [2, 17], 60: [2, 17] }], defaultActions: { 4: [2, 1], 54: [2, 55], 56: [2, 20], 60: [2, 57], 73: [2, 81], 82: [2, 85], 86: [2, 18], 90: [2, 89], 101: [2, 53], 104: [2, 93], 110: [2, 19], 111: [2, 77], 116: [2, 97], 119: [2, 63], 122: [2, 69], 135: [2, 75], 136: [2, 32] }, parseError: function (t, e) { throw new Error(t); }, parse: function (t) { var e = this, r = [0], s = [null], i = [], n = this.table, o = "", a = 0, l = 0; this.lexer.setInput(t), this.lexer.yy = this.yy, this.yy.lexer = this.lexer, this.yy.parser = this, void 0 === this.lexer.yylloc && (this.lexer.yylloc = {}); var c = this.lexer.yylloc; i.push(c); var p = this.lexer.options && this.lexer.options.ranges; "function" == typeof this.yy.parseError && (this.parseError = this.yy.parseError); for (var h, u, f, d, m, g, v, y, k, _ = {};;) { - if (u = r[r.length - 1], this.defaultActions[u] ? f = this.defaultActions[u] : (null == h && (k = void 0, "number" != typeof (k = e.lexer.lex() || 1) && (k = e.symbols_[k] || k), h = k), f = n[u] && n[u][h]), void 0 === f || !f.length || !f[0]) { - var S = ""; - for (m in y = [], n[u]) - this.terminals_[m] && m > 2 && y.push("'" + this.terminals_[m] + "'"); - S = this.lexer.showPosition ? "Parse error on line " + (a + 1) + ":\n" + this.lexer.showPosition() + "\nExpecting " + y.join(", ") + ", got '" + (this.terminals_[h] || h) + "'" : "Parse error on line " + (a + 1) + ": Unexpected " + (1 == h ? "end of input" : "'" + (this.terminals_[h] || h) + "'"), this.parseError(S, { text: this.lexer.match, token: this.terminals_[h] || h, line: this.lexer.yylineno, loc: c, expected: y }); - } - if (f[0] instanceof Array && f.length > 1) - throw new Error("Parse Error: multiple actions possible at state: " + u + ", token: " + h); - switch (f[0]) { - case 1: - r.push(h), s.push(this.lexer.yytext), i.push(this.lexer.yylloc), r.push(f[1]), h = null, l = this.lexer.yyleng, o = this.lexer.yytext, a = this.lexer.yylineno, c = this.lexer.yylloc; - break; - case 2: - if (g = this.productions_[f[1]][1], _.$ = s[s.length - g], _._$ = { first_line: i[i.length - (g || 1)].first_line, last_line: i[i.length - 1].last_line, first_column: i[i.length - (g || 1)].first_column, last_column: i[i.length - 1].last_column }, p && (_._$.range = [i[i.length - (g || 1)].range[0], i[i.length - 1].range[1]]), void 0 !== (d = this.performAction.call(_, o, l, a, this.yy, f[1], s, i))) - return d; - g && (r = r.slice(0, -1 * g * 2), s = s.slice(0, -1 * g), i = i.slice(0, -1 * g)), r.push(this.productions_[f[1]][0]), s.push(_.$), i.push(_._$), v = n[r[r.length - 2]][r[r.length - 1]], r.push(v); - break; - case 3: return !0; - } - } return !0; } }, e = function () { var t = { EOF: 1, parseError: function (t, e) { if (!this.yy.parser) - throw new Error(t); this.yy.parser.parseError(t, e); }, setInput: function (t) { return this._input = t, this._more = this._less = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = { first_line: 1, first_column: 0, last_line: 1, last_column: 0 }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this; }, input: function () { var t = this._input[0]; return this.yytext += t, this.yyleng++, this.offset++, this.match += t, this.matched += t, t.match(/(?:\r\n?|\n).*/g) ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), t; }, unput: function (t) { var e = t.length, r = t.split(/(?:\r\n?|\n)/g); this._input = t + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - e - 1), this.offset -= e; var s = this.match.split(/(?:\r\n?|\n)/g); this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), r.length - 1 && (this.yylineno -= r.length - 1); var i = this.yylloc.range; return this.yylloc = { first_line: this.yylloc.first_line, last_line: this.yylineno + 1, first_column: this.yylloc.first_column, last_column: r ? (r.length === s.length ? this.yylloc.first_column : 0) + s[s.length - r.length].length - r[0].length : this.yylloc.first_column - e }, this.options.ranges && (this.yylloc.range = [i[0], i[0] + this.yyleng - e]), this; }, more: function () { return this._more = !0, this; }, less: function (t) { this.unput(this.match.slice(t)); }, pastInput: function () { var t = this.matched.substr(0, this.matched.length - this.match.length); return (t.length > 20 ? "..." : "") + t.substr(-20).replace(/\n/g, ""); }, upcomingInput: function () { var t = this.match; return t.length < 20 && (t += this._input.substr(0, 20 - t.length)), (t.substr(0, 20) + (t.length > 20 ? "..." : "")).replace(/\n/g, ""); }, showPosition: function () { var t = this.pastInput(), e = new Array(t.length + 1).join("-"); return t + this.upcomingInput() + "\n" + e + "^"; }, next: function () { if (this.done) - return this.EOF; var t, e, r, s, i; this._input || (this.done = !0), this._more || (this.yytext = "", this.match = ""); for (var n = this._currentRules(), o = 0; o < n.length && (!(r = this._input.match(this.rules[n[o]])) || e && !(r[0].length > e[0].length) || (e = r, s = o, this.options.flex)); o++) - ; return e ? ((i = e[0].match(/(?:\r\n?|\n).*/g)) && (this.yylineno += i.length), this.yylloc = { first_line: this.yylloc.last_line, last_line: this.yylineno + 1, first_column: this.yylloc.last_column, last_column: i ? i[i.length - 1].length - i[i.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + e[0].length }, this.yytext += e[0], this.match += e[0], this.matches = e, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = !1, this._input = this._input.slice(e[0].length), this.matched += e[0], t = this.performAction.call(this, this.yy, this, n[s], this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), t || void 0) : "" === this._input ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), { text: "", token: null, line: this.yylineno }); }, lex: function () { var t = this.next(); return void 0 !== t ? t : this.lex(); }, begin: function (t) { this.conditionStack.push(t); }, popState: function () { return this.conditionStack.pop(); }, _currentRules: function () { return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; }, topState: function () { return this.conditionStack[this.conditionStack.length - 2]; }, pushState: function (t) { this.begin(t); }, options: {}, performAction: function (t, e, r, s) { function i(t, r) { return e.yytext = e.yytext.substring(t, e.yyleng - r + t); } switch (r) { - case 0: - if ("\\\\" === e.yytext.slice(-2) ? (i(0, 1), this.begin("mu")) : "\\" === e.yytext.slice(-1) ? (i(0, 1), this.begin("emu")) : this.begin("mu"), e.yytext) - return 15; - break; - case 1: - case 5: return 15; - case 2: return this.popState(), 15; - case 3: return this.begin("raw"), 15; - case 4: return this.popState(), "raw" === this.conditionStack[this.conditionStack.length - 1] ? 15 : (i(5, 9), "END_RAW_BLOCK"); - case 6: - case 22: return this.popState(), 14; - case 7: return 65; - case 8: return 68; - case 9: return 19; - case 10: return this.popState(), this.begin("raw"), 23; - case 11: return 55; - case 12: return 60; - case 13: return 29; - case 14: return 47; - case 15: - case 16: return this.popState(), 44; - case 17: return 34; - case 18: return 39; - case 19: return 51; - case 20: - case 23: return 48; - case 21: - this.unput(e.yytext), this.popState(), this.begin("com"); - break; - case 24: return 73; - case 25: - case 26: - case 41: return 72; - case 27: return 87; - case 28: break; - case 29: return this.popState(), 54; - case 30: return this.popState(), 33; - case 31: return e.yytext = i(1, 2).replace(/\\"/g, '"'), 80; - case 32: return e.yytext = i(1, 2).replace(/\\'/g, "'"), 80; - case 33: return 85; - case 34: - case 35: return 82; - case 36: return 83; - case 37: return 84; - case 38: return 81; - case 39: return 75; - case 40: return 77; - case 42: return e.yytext = e.yytext.replace(/\\([\\\]])/g, "$1"), 72; - case 43: return "INVALID"; - case 44: return 5; - } }, rules: [/^(?:[^\x00]*?(?=(\{\{)))/, /^(?:[^\x00]+)/, /^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/, /^(?:\{\{\{\{(?=[^/]))/, /^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/, /^(?:[^\x00]+?(?=(\{\{\{\{)))/, /^(?:[\s\S]*?--(~)?\}\})/, /^(?:\()/, /^(?:\))/, /^(?:\{\{\{\{)/, /^(?:\}\}\}\})/, /^(?:\{\{(~)?>)/, /^(?:\{\{(~)?#>)/, /^(?:\{\{(~)?#\*?)/, /^(?:\{\{(~)?\/)/, /^(?:\{\{(~)?\^\s*(~)?\}\})/, /^(?:\{\{(~)?\s*else\s*(~)?\}\})/, /^(?:\{\{(~)?\^)/, /^(?:\{\{(~)?\s*else\b)/, /^(?:\{\{(~)?\{)/, /^(?:\{\{(~)?&)/, /^(?:\{\{(~)?!--)/, /^(?:\{\{(~)?![\s\S]*?\}\})/, /^(?:\{\{(~)?\*?)/, /^(?:=)/, /^(?:\.\.)/, /^(?:\.(?=([=~}\s\/.)|])))/, /^(?:[\/.])/, /^(?:\s+)/, /^(?:\}(~)?\}\})/, /^(?:(~)?\}\})/, /^(?:"(\\["]|[^"])*")/, /^(?:'(\\[']|[^'])*')/, /^(?:@)/, /^(?:true(?=([~}\s)])))/, /^(?:false(?=([~}\s)])))/, /^(?:undefined(?=([~}\s)])))/, /^(?:null(?=([~}\s)])))/, /^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/, /^(?:as\s+\|)/, /^(?:\|)/, /^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/, /^(?:\[(\\\]|[^\]])*\])/, /^(?:.)/, /^(?:$)/], conditions: { mu: { rules: [7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44], inclusive: !1 }, emu: { rules: [2], inclusive: !1 }, com: { rules: [6], inclusive: !1 }, raw: { rules: [3, 4, 5], inclusive: !1 }, INITIAL: { rules: [0, 1, 44], inclusive: !0 } } }; return t; }(); function r() { this.yy = {}; } return t.lexer = e, r.prototype = t, t.Parser = r, new r; }(); e.default = r, t.exports = e.default; }(dt, dt.exports); -var mt = { exports: {} }, gt = { exports: {} }; -!function (t, e) { e.__esModule = !0; var r = function (t) { return t && t.__esModule ? t : { default: t }; }(u.exports); function s() { this.parents = []; } function i(t) { this.acceptRequired(t, "path"), this.acceptArray(t.params), this.acceptKey(t, "hash"); } function n(t) { i.call(this, t), this.acceptKey(t, "program"), this.acceptKey(t, "inverse"); } function o(t) { this.acceptRequired(t, "name"), this.acceptArray(t.params), this.acceptKey(t, "hash"); } s.prototype = { constructor: s, mutating: !1, acceptKey: function (t, e) { var i = this.accept(t[e]); if (this.mutating) { - if (i && !s.prototype[i.type]) - throw new r.default('Unexpected node type "' + i.type + '" found when accepting ' + e + " on " + t.type); - t[e] = i; - } }, acceptRequired: function (t, e) { if (this.acceptKey(t, e), !t[e]) - throw new r.default(t.type + " requires " + e); }, acceptArray: function (t) { for (var e = 0, r = t.length; e < r; e++) - this.acceptKey(t, e), t[e] || (t.splice(e, 1), e--, r--); }, accept: function (t) { if (t) { - if (!this[t.type]) - throw new r.default("Unknown type: " + t.type, t); - this.current && this.parents.unshift(this.current), this.current = t; - var e = this[t.type](t); - return this.current = this.parents.shift(), !this.mutating || e ? e : !1 !== e ? t : void 0; - } }, Program: function (t) { this.acceptArray(t.body); }, MustacheStatement: i, Decorator: i, BlockStatement: n, DecoratorBlock: n, PartialStatement: o, PartialBlockStatement: function (t) { o.call(this, t), this.acceptKey(t, "program"); }, ContentStatement: function () { }, CommentStatement: function () { }, SubExpression: i, PathExpression: function () { }, StringLiteral: function () { }, NumberLiteral: function () { }, BooleanLiteral: function () { }, UndefinedLiteral: function () { }, NullLiteral: function () { }, Hash: function (t) { this.acceptArray(t.pairs); }, HashPair: function (t) { this.acceptRequired(t, "value"); } }, e.default = s, t.exports = e.default; }(gt, gt.exports), function (t, e) { e.__esModule = !0; var r = function (t) { return t && t.__esModule ? t : { default: t }; }(gt.exports); function s() { var t = arguments.length <= 0 || void 0 === arguments[0] ? {} : arguments[0]; this.options = t; } function i(t, e, r) { void 0 === e && (e = t.length); var s = t[e - 1], i = t[e - 2]; return s ? "ContentStatement" === s.type ? (i || !r ? /\r?\n\s*?$/ : /(^|\r?\n)\s*?$/).test(s.original) : void 0 : r; } function n(t, e, r) { void 0 === e && (e = -1); var s = t[e + 1], i = t[e + 2]; return s ? "ContentStatement" === s.type ? (i || !r ? /^\s*?\r?\n/ : /^\s*?(\r?\n|$)/).test(s.original) : void 0 : r; } function o(t, e, r) { var s = t[null == e ? 0 : e + 1]; if (s && "ContentStatement" === s.type && (r || !s.rightStripped)) { - var i = s.value; - s.value = s.value.replace(r ? /^\s+/ : /^[ \t]*\r?\n?/, ""), s.rightStripped = s.value !== i; -} } function a(t, e, r) { var s = t[null == e ? t.length - 1 : e - 1]; if (s && "ContentStatement" === s.type && (r || !s.leftStripped)) { - var i = s.value; - return s.value = s.value.replace(r ? /\s+$/ : /[ \t]+$/, ""), s.leftStripped = s.value !== i, s.leftStripped; -} } s.prototype = new r.default, s.prototype.Program = function (t) { var e = !this.options.ignoreStandalone, r = !this.isRootSeen; this.isRootSeen = !0; for (var s = t.body, l = 0, c = s.length; l < c; l++) { - var p = s[l], h = this.accept(p); - if (h) { - var u = i(s, l, r), f = n(s, l, r), d = h.openStandalone && u, m = h.closeStandalone && f, g = h.inlineStandalone && u && f; - h.close && o(s, l, !0), h.open && a(s, l, !0), e && g && (o(s, l), a(s, l) && "PartialStatement" === p.type && (p.indent = /([ \t]+$)/.exec(s[l - 1].original)[1])), e && d && (o((p.program || p.inverse).body), a(s, l)), e && m && (o(s, l), a((p.inverse || p.program).body)); - } -} return t; }, s.prototype.BlockStatement = s.prototype.DecoratorBlock = s.prototype.PartialBlockStatement = function (t) { this.accept(t.program), this.accept(t.inverse); var e = t.program || t.inverse, r = t.program && t.inverse, s = r, l = r; if (r && r.chained) - for (s = r.body[0].program; l.chained;) - l = l.body[l.body.length - 1].program; var c = { open: t.openStrip.open, close: t.closeStrip.close, openStandalone: n(e.body), closeStandalone: i((s || e).body) }; if (t.openStrip.close && o(e.body, null, !0), r) { - var p = t.inverseStrip; - p.open && a(e.body, null, !0), p.close && o(s.body, null, !0), t.closeStrip.open && a(l.body, null, !0), !this.options.ignoreStandalone && i(e.body) && n(s.body) && (a(e.body), o(s.body)); -} -else - t.closeStrip.open && a(e.body, null, !0); return c; }, s.prototype.Decorator = s.prototype.MustacheStatement = function (t) { return t.strip; }, s.prototype.PartialStatement = s.prototype.CommentStatement = function (t) { var e = t.strip || {}; return { inlineStandalone: !0, open: e.open, close: e.close }; }, e.default = s, t.exports = e.default; }(mt, mt.exports); -var vt = {}; -vt.__esModule = !0, vt.SourceLocation = function (t, e) { this.source = t, this.start = { line: e.first_line, column: e.first_column }, this.end = { line: e.last_line, column: e.last_column }; }, vt.id = function (t) { return /^\[.*\]$/.test(t) ? t.substring(1, t.length - 1) : t; }, vt.stripFlags = function (t, e) { return { open: "~" === t.charAt(2), close: "~" === e.charAt(e.length - 3) }; }, vt.stripComment = function (t) { return t.replace(/^\{\{~?!-?-?/, "").replace(/-?-?~?\}\}$/, ""); }, vt.preparePath = function (t, e, r) { r = this.locInfo(r); for (var s = t ? "@" : "", i = [], n = 0, o = 0, a = e.length; o < a; o++) { - var l = e[o].part, c = e[o].original !== l; - if (s += (e[o].separator || "") + l, c || ".." !== l && "." !== l && "this" !== l) - i.push(l); - else { - if (i.length > 0) - throw new yt.default("Invalid path: " + s, { loc: r }); - ".." === l && n++; - } -} return { type: "PathExpression", data: t, depth: n, parts: i, original: s, loc: r }; }, vt.prepareMustache = function (t, e, r, s, i, n) { var o = s.charAt(3) || s.charAt(2), a = "{" !== o && "&" !== o; return { type: /\*/.test(s) ? "Decorator" : "MustacheStatement", path: t, params: e, hash: r, escaped: a, strip: i, loc: this.locInfo(n) }; }, vt.prepareRawBlock = function (t, e, r, s) { kt(t, r), s = this.locInfo(s); var i = { type: "Program", body: e, strip: {}, loc: s }; return { type: "BlockStatement", path: t.path, params: t.params, hash: t.hash, program: i, openStrip: {}, inverseStrip: {}, closeStrip: {}, loc: s }; }, vt.prepareBlock = function (t, e, r, s, i, n) { s && s.path && kt(t, s); var o = /\*/.test(t.open); e.blockParams = t.blockParams; var a = void 0, l = void 0; if (r) { - if (o) - throw new yt.default("Unexpected inverse block on decorator", r); - r.chain && (r.program.body[0].closeStrip = s.strip), l = r.strip, a = r.program; -} i && (i = a, a = e, e = i); return { type: o ? "DecoratorBlock" : "BlockStatement", path: t.path, params: t.params, hash: t.hash, program: e, inverse: a, openStrip: t.strip, inverseStrip: l, closeStrip: s && s.strip, loc: this.locInfo(n) }; }, vt.prepareProgram = function (t, e) { if (!e && t.length) { - var r = t[0].loc, s = t[t.length - 1].loc; - r && s && (e = { source: r.source, start: { line: r.start.line, column: r.start.column }, end: { line: s.end.line, column: s.end.column } }); -} return { type: "Program", body: t, strip: {}, loc: e }; }, vt.preparePartialBlock = function (t, e, r, s) { return kt(t, r), { type: "PartialBlockStatement", name: t.path, params: t.params, hash: t.hash, program: e, openStrip: t.strip, closeStrip: r && r.strip, loc: this.locInfo(s) }; }; -var yt = function (t) { return t && t.__esModule ? t : { default: t }; }(u.exports); -function kt(t, e) { if (e = e.path ? e.path.original : e, t.path.original !== e) { - var r = { loc: t.path.loc }; - throw new yt.default(t.path.original + " doesn't match " + e, r); -} } -function _t(t) { return t && t.__esModule ? t : { default: t }; } -ft.__esModule = !0, ft.parseWithoutProcessing = Et, ft.parse = function (t, e) { var r = Et(t, e); return new xt.default(e).accept(r); }; -var St = _t(dt.exports), xt = _t(mt.exports), Pt = function (t) { if (t && t.__esModule) - return t; var e = {}; if (null != t) - for (var r in t) - Object.prototype.hasOwnProperty.call(t, r) && (e[r] = t[r]); return e.default = t, e; }(vt), bt = s; -ft.parser = St.default; -var wt = {}; -function Et(t, e) { return "Program" === t.type ? t : (St.default.yy = wt, wt.locInfo = function (t) { return new wt.SourceLocation(e && e.srcName, t); }, St.default.parse(t)); } -bt.extend(wt, Pt); -var Lt = {}; -function Ct(t) { return t && t.__esModule ? t : { default: t }; } -Lt.__esModule = !0, Lt.Compiler = Mt, Lt.precompile = function (t, e, r) { if (null == t || "string" != typeof t && "Program" !== t.type) - throw new It.default("You must pass a string or Handlebars AST to Handlebars.precompile. You passed " + t); "data" in (e = e || {}) || (e.data = !0); e.compat && (e.useDepths = !0); var s = r.parse(t, e), i = (new r.Compiler).compile(s, e); return (new r.JavaScriptCompiler).compile(i, e); }, Lt.compile = function (t, e, r) { void 0 === e && (e = {}); if (null == t || "string" != typeof t && "Program" !== t.type) - throw new It.default("You must pass a string or Handlebars AST to Handlebars.compile. You passed " + t); "data" in (e = Ot.extend({}, e)) || (e.data = !0); e.compat && (e.useDepths = !0); var s = void 0; function i() { var s = r.parse(t, e), i = (new r.Compiler).compile(s, e), n = (new r.JavaScriptCompiler).compile(i, e, void 0, !0); return r.template(n); } function n(t, e) { return s || (s = i()), s.call(this, t, e); } return n._setup = function (t) { return s || (s = i()), s._setup(t); }, n._child = function (t, e, r, n) { return s || (s = i()), s._child(t, e, r, n); }, n; }; -var It = Ct(u.exports), Ot = s, Nt = Ct(ut.exports), At = [].slice; -function Mt() { } -function Bt(t, e) { if (t === e) - return !0; if (Ot.isArray(t) && Ot.isArray(e) && t.length === e.length) { - for (var r = 0; r < t.length; r++) - if (!Bt(t[r], e[r])) - return !1; - return !0; -} } -function Dt(t) { if (!t.path.parts) { - var e = t.path; - t.path = { type: "PathExpression", data: !1, depth: 0, parts: [e.original + ""], original: e.original + "", loc: e.loc }; -} } -Mt.prototype = { compiler: Mt, equals: function (t) { var e = this.opcodes.length; if (t.opcodes.length !== e) - return !1; for (var r = 0; r < e; r++) { - var s = this.opcodes[r], i = t.opcodes[r]; - if (s.opcode !== i.opcode || !Bt(s.args, i.args)) - return !1; - } e = this.children.length; for (r = 0; r < e; r++) - if (!this.children[r].equals(t.children[r])) - return !1; return !0; }, guid: 0, compile: function (t, e) { return this.sourceNode = [], this.opcodes = [], this.children = [], this.options = e, this.stringParams = e.stringParams, this.trackIds = e.trackIds, e.blockParams = e.blockParams || [], e.knownHelpers = Ot.extend(Object.create(null), { helperMissing: !0, blockHelperMissing: !0, each: !0, if: !0, unless: !0, with: !0, log: !0, lookup: !0 }, e.knownHelpers), this.accept(t); }, compileProgram: function (t) { var e = (new this.compiler).compile(t, this.options), r = this.guid++; return this.usePartial = this.usePartial || e.usePartial, this.children[r] = e, this.useDepths = this.useDepths || e.useDepths, r; }, accept: function (t) { if (!this[t.type]) - throw new It.default("Unknown type: " + t.type, t); this.sourceNode.unshift(t); var e = this[t.type](t); return this.sourceNode.shift(), e; }, Program: function (t) { this.options.blockParams.unshift(t.blockParams); for (var e = t.body, r = e.length, s = 0; s < r; s++) - this.accept(e[s]); return this.options.blockParams.shift(), this.isSimple = 1 === r, this.blockParams = t.blockParams ? t.blockParams.length : 0, this; }, BlockStatement: function (t) { Dt(t); var e = t.program, r = t.inverse; e = e && this.compileProgram(e), r = r && this.compileProgram(r); var s = this.classifySexpr(t); "helper" === s ? this.helperSexpr(t, e, r) : "simple" === s ? (this.simpleSexpr(t), this.opcode("pushProgram", e), this.opcode("pushProgram", r), this.opcode("emptyHash"), this.opcode("blockValue", t.path.original)) : (this.ambiguousSexpr(t, e, r), this.opcode("pushProgram", e), this.opcode("pushProgram", r), this.opcode("emptyHash"), this.opcode("ambiguousBlockValue")), this.opcode("append"); }, DecoratorBlock: function (t) { var e = t.program && this.compileProgram(t.program), r = this.setupFullMustacheParams(t, e, void 0), s = t.path; this.useDecorators = !0, this.opcode("registerDecorator", r.length, s.original); }, PartialStatement: function (t) { this.usePartial = !0; var e = t.program; e && (e = this.compileProgram(t.program)); var r = t.params; if (r.length > 1) - throw new It.default("Unsupported number of partial arguments: " + r.length, t); r.length || (this.options.explicitPartialContext ? this.opcode("pushLiteral", "undefined") : r.push({ type: "PathExpression", parts: [], depth: 0 })); var s = t.name.original, i = "SubExpression" === t.name.type; i && this.accept(t.name), this.setupFullMustacheParams(t, e, void 0, !0); var n = t.indent || ""; this.options.preventIndent && n && (this.opcode("appendContent", n), n = ""), this.opcode("invokePartial", i, s, n), this.opcode("append"); }, PartialBlockStatement: function (t) { this.PartialStatement(t); }, MustacheStatement: function (t) { this.SubExpression(t), t.escaped && !this.options.noEscape ? this.opcode("appendEscaped") : this.opcode("append"); }, Decorator: function (t) { this.DecoratorBlock(t); }, ContentStatement: function (t) { t.value && this.opcode("appendContent", t.value); }, CommentStatement: function () { }, SubExpression: function (t) { Dt(t); var e = this.classifySexpr(t); "simple" === e ? this.simpleSexpr(t) : "helper" === e ? this.helperSexpr(t) : this.ambiguousSexpr(t); }, ambiguousSexpr: function (t, e, r) { var s = t.path, i = s.parts[0], n = null != e || null != r; this.opcode("getContext", s.depth), this.opcode("pushProgram", e), this.opcode("pushProgram", r), s.strict = !0, this.accept(s), this.opcode("invokeAmbiguous", i, n); }, simpleSexpr: function (t) { var e = t.path; e.strict = !0, this.accept(e), this.opcode("resolvePossibleLambda"); }, helperSexpr: function (t, e, r) { var s = this.setupFullMustacheParams(t, e, r), i = t.path, n = i.parts[0]; if (this.options.knownHelpers[n]) - this.opcode("invokeKnownHelper", s.length, n); - else { - if (this.options.knownHelpersOnly) - throw new It.default("You specified knownHelpersOnly, but used the unknown helper " + n, t); - i.strict = !0, i.falsy = !0, this.accept(i), this.opcode("invokeHelper", s.length, i.original, Nt.default.helpers.simpleId(i)); - } }, PathExpression: function (t) { this.addDepth(t.depth), this.opcode("getContext", t.depth); var e = t.parts[0], r = Nt.default.helpers.scopedId(t), s = !t.depth && !r && this.blockParamIndex(e); s ? this.opcode("lookupBlockParam", s, t.parts) : e ? t.data ? (this.options.data = !0, this.opcode("lookupData", t.depth, t.parts, t.strict)) : this.opcode("lookupOnContext", t.parts, t.falsy, t.strict, r) : this.opcode("pushContext"); }, StringLiteral: function (t) { this.opcode("pushString", t.value); }, NumberLiteral: function (t) { this.opcode("pushLiteral", t.value); }, BooleanLiteral: function (t) { this.opcode("pushLiteral", t.value); }, UndefinedLiteral: function () { this.opcode("pushLiteral", "undefined"); }, NullLiteral: function () { this.opcode("pushLiteral", "null"); }, Hash: function (t) { var e = t.pairs, r = 0, s = e.length; for (this.opcode("pushHash"); r < s; r++) - this.pushParam(e[r].value); for (; r--;) - this.opcode("assignToHash", e[r].key); this.opcode("popHash"); }, opcode: function (t) { this.opcodes.push({ opcode: t, args: At.call(arguments, 1), loc: this.sourceNode[0].loc }); }, addDepth: function (t) { t && (this.useDepths = !0); }, classifySexpr: function (t) { var e = Nt.default.helpers.simpleId(t.path), r = e && !!this.blockParamIndex(t.path.parts[0]), s = !r && Nt.default.helpers.helperExpression(t), i = !r && (s || e); if (i && !s) { - var n = t.path.parts[0], o = this.options; - o.knownHelpers[n] ? s = !0 : o.knownHelpersOnly && (i = !1); - } return s ? "helper" : i ? "ambiguous" : "simple"; }, pushParams: function (t) { for (var e = 0, r = t.length; e < r; e++) - this.pushParam(t[e]); }, pushParam: function (t) { var e = null != t.value ? t.value : t.original || ""; if (this.stringParams) - e.replace && (e = e.replace(/^(\.?\.\/)*/g, "").replace(/\//g, ".")), t.depth && this.addDepth(t.depth), this.opcode("getContext", t.depth || 0), this.opcode("pushStringParam", e, t.type), "SubExpression" === t.type && this.accept(t); - else { - if (this.trackIds) { - var r = void 0; - if (!t.parts || Nt.default.helpers.scopedId(t) || t.depth || (r = this.blockParamIndex(t.parts[0])), r) { - var s = t.parts.slice(1).join("."); - this.opcode("pushId", "BlockParam", r, s); - } - else - (e = t.original || e).replace && (e = e.replace(/^this(?:\.|$)/, "").replace(/^\.\//, "").replace(/^\.$/, "")), this.opcode("pushId", t.type, e); - } - this.accept(t); - } }, setupFullMustacheParams: function (t, e, r, s) { var i = t.params; return this.pushParams(i), this.opcode("pushProgram", e), this.opcode("pushProgram", r), t.hash ? this.accept(t.hash) : this.opcode("emptyHash", s), i; }, blockParamIndex: function (t) { for (var e = 0, r = this.options.blockParams.length; e < r; e++) { - var s = this.options.blockParams[e], i = s && Ot.indexOf(s, t); - if (s && i >= 0) - return [e, i]; - } } }; -var Ht = { exports: {} }, $t = { exports: {} }; -!function (t, e) { e.__esModule = !0; var r = s, i = void 0; try { - var n = require("source-map"); - i = n.SourceNode; -} -catch (t) { } function o(t, e, s) { if (r.isArray(t)) { - for (var i = [], n = 0, o = t.length; n < o; n++) - i.push(e.wrap(t[n], s)); - return i; -} return "boolean" == typeof t || "number" == typeof t ? t + "" : t; } function a(t) { this.srcFile = t, this.source = []; } i || ((i = function (t, e, r, s) { this.src = "", s && this.add(s); }).prototype = { add: function (t) { r.isArray(t) && (t = t.join("")), this.src += t; }, prepend: function (t) { r.isArray(t) && (t = t.join("")), this.src = t + this.src; }, toStringWithSourceMap: function () { return { code: this.toString() }; }, toString: function () { return this.src; } }), a.prototype = { isEmpty: function () { return !this.source.length; }, prepend: function (t, e) { this.source.unshift(this.wrap(t, e)); }, push: function (t, e) { this.source.push(this.wrap(t, e)); }, merge: function () { var t = this.empty(); return this.each((function (e) { t.add([" ", e, "\n"]); })), t; }, each: function (t) { for (var e = 0, r = this.source.length; e < r; e++) - t(this.source[e]); }, empty: function () { var t = this.currentLocation || { start: {} }; return new i(t.start.line, t.start.column, this.srcFile); }, wrap: function (t) { var e = arguments.length <= 1 || void 0 === arguments[1] ? this.currentLocation || { start: {} } : arguments[1]; return t instanceof i ? t : (t = o(t, this, e), new i(e.start.line, e.start.column, this.srcFile, t)); }, functionCall: function (t, e, r) { return r = this.generateList(r), this.wrap([t, e ? "." + e + "(" : "(", r, ")"]); }, quotedString: function (t) { return '"' + (t + "").replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029") + '"'; }, objectLiteral: function (t) { var e = this, r = []; Object.keys(t).forEach((function (s) { var i = o(t[s], e); "undefined" !== i && r.push([e.quotedString(s), ":", i]); })); var s = this.generateList(r); return s.prepend("{"), s.add("}"), s; }, generateList: function (t) { for (var e = this.empty(), r = 0, s = t.length; r < s; r++) - r && e.add(","), e.add(o(t[r], this)); return e; }, generateArray: function (t) { var e = this.generateList(t); return e.prepend("["), e.add("]"), e; } }, e.default = a, t.exports = e.default; }($t, $t.exports), function (t, e) { function i(t) { return t && t.__esModule ? t : { default: t }; } e.__esModule = !0; var n = r, o = i(u.exports), a = s, l = i($t.exports); function c(t) { this.value = t; } function p() { } p.prototype = { nameLookup: function (t, e) { return this.internalNameLookup(t, e); }, depthedLookup: function (t) { return [this.aliasable("container.lookup"), "(depths, ", JSON.stringify(t), ")"]; }, compilerInfo: function () { var t = n.COMPILER_REVISION; return [t, n.REVISION_CHANGES[t]]; }, appendToBuffer: function (t, e, r) { return a.isArray(t) || (t = [t]), t = this.source.wrap(t, e), this.environment.isSimple ? ["return ", t, ";"] : r ? ["buffer += ", t, ";"] : (t.appendToBuffer = !0, t); }, initializeBuffer: function () { return this.quotedString(""); }, internalNameLookup: function (t, e) { return this.lookupPropertyFunctionIsUsed = !0, ["lookupProperty(", t, ",", JSON.stringify(e), ")"]; }, lookupPropertyFunctionIsUsed: !1, compile: function (t, e, r, s) { this.environment = t, this.options = e, this.stringParams = this.options.stringParams, this.trackIds = this.options.trackIds, this.precompile = !s, this.name = this.environment.name, this.isChild = !!r, this.context = r || { decorators: [], programs: [], environments: [] }, this.preamble(), this.stackSlot = 0, this.stackVars = [], this.aliases = {}, this.registers = { list: [] }, this.hashes = [], this.compileStack = [], this.inlineStack = [], this.blockParams = [], this.compileChildren(t, e), this.useDepths = this.useDepths || t.useDepths || t.useDecorators || this.options.compat, this.useBlockParams = this.useBlockParams || t.useBlockParams; var i = t.opcodes, n = void 0, a = void 0, l = void 0, c = void 0; for (l = 0, c = i.length; l < c; l++) - n = i[l], this.source.currentLocation = n.loc, a = a || n.loc, this[n.opcode].apply(this, n.args); if (this.source.currentLocation = a, this.pushSource(""), this.stackSlot || this.inlineStack.length || this.compileStack.length) - throw new o.default("Compile completed with content left on stack"); this.decorators.isEmpty() ? this.decorators = void 0 : (this.useDecorators = !0, this.decorators.prepend(["var decorators = container.decorators, ", this.lookupPropertyFunctionVarDeclaration(), ";\n"]), this.decorators.push("return fn;"), s ? this.decorators = Function.apply(this, ["fn", "props", "container", "depth0", "data", "blockParams", "depths", this.decorators.merge()]) : (this.decorators.prepend("function(fn, props, container, depth0, data, blockParams, depths) {\n"), this.decorators.push("}\n"), this.decorators = this.decorators.merge())); var p = this.createFunctionContext(s); if (this.isChild) - return p; var h = { compiler: this.compilerInfo(), main: p }; this.decorators && (h.main_d = this.decorators, h.useDecorators = !0); var u = this.context, f = u.programs, d = u.decorators; for (l = 0, c = f.length; l < c; l++) - f[l] && (h[l] = f[l], d[l] && (h[l + "_d"] = d[l], h.useDecorators = !0)); return this.environment.usePartial && (h.usePartial = !0), this.options.data && (h.useData = !0), this.useDepths && (h.useDepths = !0), this.useBlockParams && (h.useBlockParams = !0), this.options.compat && (h.compat = !0), s ? h.compilerOptions = this.options : (h.compiler = JSON.stringify(h.compiler), this.source.currentLocation = { start: { line: 1, column: 0 } }, h = this.objectLiteral(h), e.srcName ? (h = h.toStringWithSourceMap({ file: e.destName })).map = h.map && h.map.toString() : h = h.toString()), h; }, preamble: function () { this.lastContext = 0, this.source = new l.default(this.options.srcName), this.decorators = new l.default(this.options.srcName); }, createFunctionContext: function (t) { var e = this, r = "", s = this.stackVars.concat(this.registers.list); s.length > 0 && (r += ", " + s.join(", ")); var i = 0; Object.keys(this.aliases).forEach((function (t) { var s = e.aliases[t]; s.children && s.referenceCount > 1 && (r += ", alias" + ++i + "=" + t, s.children[0] = "alias" + i); })), this.lookupPropertyFunctionIsUsed && (r += ", " + this.lookupPropertyFunctionVarDeclaration()); var n = ["container", "depth0", "helpers", "partials", "data"]; (this.useBlockParams || this.useDepths) && n.push("blockParams"), this.useDepths && n.push("depths"); var o = this.mergeSource(r); return t ? (n.push(o), Function.apply(this, n)) : this.source.wrap(["function(", n.join(","), ") {\n ", o, "}"]); }, mergeSource: function (t) { var e = this.environment.isSimple, r = !this.forceBuffer, s = void 0, i = void 0, n = void 0, o = void 0; return this.source.each((function (t) { t.appendToBuffer ? (n ? t.prepend(" + ") : n = t, o = t) : (n && (i ? n.prepend("buffer += ") : s = !0, o.add(";"), n = o = void 0), i = !0, e || (r = !1)); })), r ? n ? (n.prepend("return "), o.add(";")) : i || this.source.push('return "";') : (t += ", buffer = " + (s ? "" : this.initializeBuffer()), n ? (n.prepend("return buffer + "), o.add(";")) : this.source.push("return buffer;")), t && this.source.prepend("var " + t.substring(2) + (s ? "" : ";\n")), this.source.merge(); }, lookupPropertyFunctionVarDeclaration: function () { return "\n lookupProperty = container.lookupProperty || function(parent, propertyName) {\n if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {\n return parent[propertyName];\n }\n return undefined\n }\n ".trim(); }, blockValue: function (t) { var e = this.aliasable("container.hooks.blockHelperMissing"), r = [this.contextName(0)]; this.setupHelperArgs(t, 0, r); var s = this.popStack(); r.splice(1, 0, s), this.push(this.source.functionCall(e, "call", r)); }, ambiguousBlockValue: function () { var t = this.aliasable("container.hooks.blockHelperMissing"), e = [this.contextName(0)]; this.setupHelperArgs("", 0, e, !0), this.flushInline(); var r = this.topStack(); e.splice(1, 0, r), this.pushSource(["if (!", this.lastHelper, ") { ", r, " = ", this.source.functionCall(t, "call", e), "}"]); }, appendContent: function (t) { this.pendingContent ? t = this.pendingContent + t : this.pendingLocation = this.source.currentLocation, this.pendingContent = t; }, append: function () { if (this.isInline()) - this.replaceStack((function (t) { return [" != null ? ", t, ' : ""']; })), this.pushSource(this.appendToBuffer(this.popStack())); - else { - var t = this.popStack(); - this.pushSource(["if (", t, " != null) { ", this.appendToBuffer(t, void 0, !0), " }"]), this.environment.isSimple && this.pushSource(["else { ", this.appendToBuffer("''", void 0, !0), " }"]); - } }, appendEscaped: function () { this.pushSource(this.appendToBuffer([this.aliasable("container.escapeExpression"), "(", this.popStack(), ")"])); }, getContext: function (t) { this.lastContext = t; }, pushContext: function () { this.pushStackLiteral(this.contextName(this.lastContext)); }, lookupOnContext: function (t, e, r, s) { var i = 0; s || !this.options.compat || this.lastContext ? this.pushContext() : this.push(this.depthedLookup(t[i++])), this.resolvePath("context", t, i, e, r); }, lookupBlockParam: function (t, e) { this.useBlockParams = !0, this.push(["blockParams[", t[0], "][", t[1], "]"]), this.resolvePath("context", e, 1); }, lookupData: function (t, e, r) { t ? this.pushStackLiteral("container.data(data, " + t + ")") : this.pushStackLiteral("data"), this.resolvePath("data", e, 0, !0, r); }, resolvePath: function (t, e, r, s, i) { var n = this; if (this.options.strict || this.options.assumeObjects) - this.push(function (t, e, r, s, i) { var n = e.popStack(), o = r.length; t && o--; for (; s < o; s++) - n = e.nameLookup(n, r[s], i); return t ? [e.aliasable("container.strict"), "(", n, ", ", e.quotedString(r[s]), ", ", JSON.stringify(e.source.currentLocation), " )"] : n; }(this.options.strict && i, this, e, r, t)); - else - for (var o = e.length; r < o; r++) - this.replaceStack((function (i) { var o = n.nameLookup(i, e[r], t); return s ? [" && ", o] : [" != null ? ", o, " : ", i]; })); }, resolvePossibleLambda: function () { this.push([this.aliasable("container.lambda"), "(", this.popStack(), ", ", this.contextName(0), ")"]); }, pushStringParam: function (t, e) { this.pushContext(), this.pushString(e), "SubExpression" !== e && ("string" == typeof t ? this.pushString(t) : this.pushStackLiteral(t)); }, emptyHash: function (t) { this.trackIds && this.push("{}"), this.stringParams && (this.push("{}"), this.push("{}")), this.pushStackLiteral(t ? "undefined" : "{}"); }, pushHash: function () { this.hash && this.hashes.push(this.hash), this.hash = { values: {}, types: [], contexts: [], ids: [] }; }, popHash: function () { var t = this.hash; this.hash = this.hashes.pop(), this.trackIds && this.push(this.objectLiteral(t.ids)), this.stringParams && (this.push(this.objectLiteral(t.contexts)), this.push(this.objectLiteral(t.types))), this.push(this.objectLiteral(t.values)); }, pushString: function (t) { this.pushStackLiteral(this.quotedString(t)); }, pushLiteral: function (t) { this.pushStackLiteral(t); }, pushProgram: function (t) { null != t ? this.pushStackLiteral(this.programExpression(t)) : this.pushStackLiteral(null); }, registerDecorator: function (t, e) { var r = this.nameLookup("decorators", e, "decorator"), s = this.setupHelperArgs(e, t); this.decorators.push(["fn = ", this.decorators.functionCall(r, "", ["fn", "props", "container", s]), " || fn;"]); }, invokeHelper: function (t, e, r) { var s = this.popStack(), i = this.setupHelper(t, e), n = []; r && n.push(i.name), n.push(s), this.options.strict || n.push(this.aliasable("container.hooks.helperMissing")); var o = ["(", this.itemsSeparatedBy(n, "||"), ")"], a = this.source.functionCall(o, "call", i.callParams); this.push(a); }, itemsSeparatedBy: function (t, e) { var r = []; r.push(t[0]); for (var s = 1; s < t.length; s++) - r.push(e, t[s]); return r; }, invokeKnownHelper: function (t, e) { var r = this.setupHelper(t, e); this.push(this.source.functionCall(r.name, "call", r.callParams)); }, invokeAmbiguous: function (t, e) { this.useRegister("helper"); var r = this.popStack(); this.emptyHash(); var s = this.setupHelper(0, t, e), i = ["(", "(helper = ", this.lastHelper = this.nameLookup("helpers", t, "helper"), " || ", r, ")"]; this.options.strict || (i[0] = "(helper = ", i.push(" != null ? helper : ", this.aliasable("container.hooks.helperMissing"))), this.push(["(", i, s.paramsInit ? ["),(", s.paramsInit] : [], "),", "(typeof helper === ", this.aliasable('"function"'), " ? ", this.source.functionCall("helper", "call", s.callParams), " : helper))"]); }, invokePartial: function (t, e, r) { var s = [], i = this.setupParams(e, 1, s); t && (e = this.popStack(), delete i.name), r && (i.indent = JSON.stringify(r)), i.helpers = "helpers", i.partials = "partials", i.decorators = "container.decorators", t ? s.unshift(e) : s.unshift(this.nameLookup("partials", e, "partial")), this.options.compat && (i.depths = "depths"), i = this.objectLiteral(i), s.push(i), this.push(this.source.functionCall("container.invokePartial", "", s)); }, assignToHash: function (t) { var e = this.popStack(), r = void 0, s = void 0, i = void 0; this.trackIds && (i = this.popStack()), this.stringParams && (s = this.popStack(), r = this.popStack()); var n = this.hash; r && (n.contexts[t] = r), s && (n.types[t] = s), i && (n.ids[t] = i), n.values[t] = e; }, pushId: function (t, e, r) { "BlockParam" === t ? this.pushStackLiteral("blockParams[" + e[0] + "].path[" + e[1] + "]" + (r ? " + " + JSON.stringify("." + r) : "")) : "PathExpression" === t ? this.pushString(e) : "SubExpression" === t ? this.pushStackLiteral("true") : this.pushStackLiteral("null"); }, compiler: p, compileChildren: function (t, e) { for (var r = t.children, s = void 0, i = void 0, n = 0, o = r.length; n < o; n++) { - s = r[n], i = new this.compiler; - var a = this.matchExistingProgram(s); - if (null == a) { - this.context.programs.push(""); - var l = this.context.programs.length; - s.index = l, s.name = "program" + l, this.context.programs[l] = i.compile(s, e, this.context, !this.precompile), this.context.decorators[l] = i.decorators, this.context.environments[l] = s, this.useDepths = this.useDepths || i.useDepths, this.useBlockParams = this.useBlockParams || i.useBlockParams, s.useDepths = this.useDepths, s.useBlockParams = this.useBlockParams; - } - else - s.index = a.index, s.name = "program" + a.index, this.useDepths = this.useDepths || a.useDepths, this.useBlockParams = this.useBlockParams || a.useBlockParams; - } }, matchExistingProgram: function (t) { for (var e = 0, r = this.context.environments.length; e < r; e++) { - var s = this.context.environments[e]; - if (s && s.equals(t)) - return s; - } }, programExpression: function (t) { var e = this.environment.children[t], r = [e.index, "data", e.blockParams]; return (this.useBlockParams || this.useDepths) && r.push("blockParams"), this.useDepths && r.push("depths"), "container.program(" + r.join(", ") + ")"; }, useRegister: function (t) { this.registers[t] || (this.registers[t] = !0, this.registers.list.push(t)); }, push: function (t) { return t instanceof c || (t = this.source.wrap(t)), this.inlineStack.push(t), t; }, pushStackLiteral: function (t) { this.push(new c(t)); }, pushSource: function (t) { this.pendingContent && (this.source.push(this.appendToBuffer(this.source.quotedString(this.pendingContent), this.pendingLocation)), this.pendingContent = void 0), t && this.source.push(t); }, replaceStack: function (t) { var e = ["("], r = void 0, s = void 0, i = void 0; if (!this.isInline()) - throw new o.default("replaceStack on non-inline"); var n = this.popStack(!0); if (n instanceof c) - e = ["(", r = [n.value]], i = !0; - else { - s = !0; - var a = this.incrStack(); - e = ["((", this.push(a), " = ", n, ")"], r = this.topStack(); - } var l = t.call(this, r); i || this.popStack(), s && this.stackSlot--, this.push(e.concat(l, ")")); }, incrStack: function () { return this.stackSlot++, this.stackSlot > this.stackVars.length && this.stackVars.push("stack" + this.stackSlot), this.topStackName(); }, topStackName: function () { return "stack" + this.stackSlot; }, flushInline: function () { var t = this.inlineStack; this.inlineStack = []; for (var e = 0, r = t.length; e < r; e++) { - var s = t[e]; - if (s instanceof c) - this.compileStack.push(s); - else { - var i = this.incrStack(); - this.pushSource([i, " = ", s, ";"]), this.compileStack.push(i); - } - } }, isInline: function () { return this.inlineStack.length; }, popStack: function (t) { var e = this.isInline(), r = (e ? this.inlineStack : this.compileStack).pop(); if (!t && r instanceof c) - return r.value; if (!e) { - if (!this.stackSlot) - throw new o.default("Invalid stack pop"); - this.stackSlot--; - } return r; }, topStack: function () { var t = this.isInline() ? this.inlineStack : this.compileStack, e = t[t.length - 1]; return e instanceof c ? e.value : e; }, contextName: function (t) { return this.useDepths && t ? "depths[" + t + "]" : "depth" + t; }, quotedString: function (t) { return this.source.quotedString(t); }, objectLiteral: function (t) { return this.source.objectLiteral(t); }, aliasable: function (t) { var e = this.aliases[t]; return e ? (e.referenceCount++, e) : ((e = this.aliases[t] = this.source.wrap(t)).aliasable = !0, e.referenceCount = 1, e); }, setupHelper: function (t, e, r) { var s = []; return { params: s, paramsInit: this.setupHelperArgs(e, t, s, r), name: this.nameLookup("helpers", e, "helper"), callParams: [this.aliasable(this.contextName(0) + " != null ? " + this.contextName(0) + " : (container.nullContext || {})")].concat(s) }; }, setupParams: function (t, e, r) { var s = {}, i = [], n = [], o = [], a = !r, l = void 0; a && (r = []), s.name = this.quotedString(t), s.hash = this.popStack(), this.trackIds && (s.hashIds = this.popStack()), this.stringParams && (s.hashTypes = this.popStack(), s.hashContexts = this.popStack()); var c = this.popStack(), p = this.popStack(); (p || c) && (s.fn = p || "container.noop", s.inverse = c || "container.noop"); for (var h = e; h--;) - l = this.popStack(), r[h] = l, this.trackIds && (o[h] = this.popStack()), this.stringParams && (n[h] = this.popStack(), i[h] = this.popStack()); return a && (s.args = this.source.generateArray(r)), this.trackIds && (s.ids = this.source.generateArray(o)), this.stringParams && (s.types = this.source.generateArray(n), s.contexts = this.source.generateArray(i)), this.options.data && (s.data = "data"), this.useBlockParams && (s.blockParams = "blockParams"), s; }, setupHelperArgs: function (t, e, r, s) { var i = this.setupParams(t, e, r); return i.loc = JSON.stringify(this.source.currentLocation), i = this.objectLiteral(i), s ? (this.useRegister("options"), r.push("options"), ["options=", i]) : r ? (r.push(i), "") : i; } }, function () { for (var t = "break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield await null true false".split(" "), e = p.RESERVED_WORDS = {}, r = 0, s = t.length; r < s; r++) - e[t[r]] = !0; }(), p.isValidJavaScriptVariableName = function (t) { return !p.RESERVED_WORDS[t] && /^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(t); }, e.default = p, t.exports = e.default; }(Ht, Ht.exports), function (t, r) { function s(t) { return t && t.__esModule ? t : { default: t }; } r.__esModule = !0; var i = s(e.exports), n = s(ut.exports), o = ft, a = Lt, l = s(Ht.exports), c = s(gt.exports), p = s(ht.exports), h = i.default.create; function u() { var t = h(); return t.compile = function (e, r) { return a.compile(e, r, t); }, t.precompile = function (e, r) { return a.precompile(e, r, t); }, t.AST = n.default, t.Compiler = a.Compiler, t.JavaScriptCompiler = l.default, t.Parser = o.parser, t.parse = o.parse, t.parseWithoutProcessing = o.parseWithoutProcessing, t; } var f = u(); f.create = u, p.default(f), f.Visitor = c.default, f.default = f, r.default = f, t.exports = r.default; }(t, t.exports); -var Rt = t.exports, jt = t.exports.__esModule; -export { jt as __esModule, Rt as default }; -//# sourceMappingURL=/sm/3d42de05bb0e3ecf6003f94da42455f7519c72c5b0fbec32ebd1ddbfe6b99c51.map diff --git a/modules/ui-module/src/main/ts/dist/js/libs/sortablejs.min.js b/modules/ui-module/src/main/ts/dist/js/libs/sortablejs.min.js deleted file mode 100644 index 75aa1c8ba..000000000 --- a/modules/ui-module/src/main/ts/dist/js/libs/sortablejs.min.js +++ /dev/null @@ -1,516 +0,0 @@ -/** - * Bundled by jsDelivr using Rollup v2.79.2 and Terser v5.39.0. - * Original file: /npm/sortablejs@1.15.6/modular/sortable.esm.js - * - * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files - */ -/**! - * Sortable 1.15.6 - * @author RubaXa - * @author owenm - * @license MIT - */ -function t(t, e) { var n = Object.keys(t); if (Object.getOwnPropertySymbols) { - var o = Object.getOwnPropertySymbols(t); - e && (o = o.filter((function (e) { return Object.getOwnPropertyDescriptor(t, e).enumerable; }))), n.push.apply(n, o); -} return n; } -function e(e) { for (var n = 1; n < arguments.length; n++) { - var i = null != arguments[n] ? arguments[n] : {}; - n % 2 ? t(Object(i), !0).forEach((function (t) { o(e, t, i[t]); })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(i)) : t(Object(i)).forEach((function (t) { Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(i, t)); })); -} return e; } -function n(t) { return n = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; }, n(t); } -function o(t, e, n) { return e in t ? Object.defineProperty(t, e, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = n, t; } -function i() { return i = Object.assign || function (t) { for (var e = 1; e < arguments.length; e++) { - var n = arguments[e]; - for (var o in n) - Object.prototype.hasOwnProperty.call(n, o) && (t[o] = n[o]); -} return t; }, i.apply(this, arguments); } -function r(t, e) { if (null == t) - return {}; var n, o, i = function (t, e) { if (null == t) - return {}; var n, o, i = {}, r = Object.keys(t); for (o = 0; o < r.length; o++) - n = r[o], e.indexOf(n) >= 0 || (i[n] = t[n]); return i; }(t, e); if (Object.getOwnPropertySymbols) { - var r = Object.getOwnPropertySymbols(t); - for (o = 0; o < r.length; o++) - n = r[o], e.indexOf(n) >= 0 || Object.prototype.propertyIsEnumerable.call(t, n) && (i[n] = t[n]); -} return i; } -function a(t) { return function (t) { if (Array.isArray(t)) - return l(t); }(t) || function (t) { if ("undefined" != typeof Symbol && null != t[Symbol.iterator] || null != t["@@iterator"]) - return Array.from(t); }(t) || function (t, e) { if (!t) - return; if ("string" == typeof t) - return l(t, e); var n = Object.prototype.toString.call(t).slice(8, -1); "Object" === n && t.constructor && (n = t.constructor.name); if ("Map" === n || "Set" === n) - return Array.from(t); if ("Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) - return l(t, e); }(t) || function () { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }(); } -function l(t, e) { (null == e || e > t.length) && (e = t.length); for (var n = 0, o = new Array(e); n < e; n++) - o[n] = t[n]; return o; } -function s(t) { if ("undefined" != typeof window && window.navigator) - return !!navigator.userAgent.match(t); } -var c = s(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i), u = s(/Edge/i), d = s(/firefox/i), h = s(/safari/i) && !s(/chrome/i) && !s(/android/i), f = s(/iP(ad|od|hone)/i), p = s(/chrome/i) && s(/android/i), g = { capture: !1, passive: !1 }; -function v(t, e, n) { t.addEventListener(e, n, !c && g); } -function m(t, e, n) { t.removeEventListener(e, n, !c && g); } -function b(t, e) { if (e) { - if (">" === e[0] && (e = e.substring(1)), t) - try { - if (t.matches) - return t.matches(e); - if (t.msMatchesSelector) - return t.msMatchesSelector(e); - if (t.webkitMatchesSelector) - return t.webkitMatchesSelector(e); - } - catch (t) { - return !1; - } - return !1; -} } -function y(t) { return t.host && t !== document && t.host.nodeType ? t.host : t.parentNode; } -function w(t, e, n, o) { if (t) { - n = n || document; - do { - if (null != e && (">" === e[0] ? t.parentNode === n && b(t, e) : b(t, e)) || o && t === n) - return t; - if (t === n) - break; - } while (t = y(t)); -} return null; } -var D, E = /\s+/g; -function S(t, e, n) { if (t && e) - if (t.classList) - t.classList[n ? "add" : "remove"](e); - else { - var o = (" " + t.className + " ").replace(E, " ").replace(" " + e + " ", " "); - t.className = (o + (n ? " " + e : "")).replace(E, " "); - } } -function _(t, e, n) { var o = t && t.style; if (o) { - if (void 0 === n) - return document.defaultView && document.defaultView.getComputedStyle ? n = document.defaultView.getComputedStyle(t, "") : t.currentStyle && (n = t.currentStyle), void 0 === e ? n : n[e]; - e in o || -1 !== e.indexOf("webkit") || (e = "-webkit-" + e), o[e] = n + ("string" == typeof n ? "" : "px"); -} } -function C(t, e) { var n = ""; if ("string" == typeof t) - n = t; -else - do { - var o = _(t, "transform"); - o && "none" !== o && (n = o + " " + n); - } while (!e && (t = t.parentNode)); var i = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix; return i && new i(n); } -function T(t, e, n) { if (t) { - var o = t.getElementsByTagName(e), i = 0, r = o.length; - if (n) - for (; i < r; i++) - n(o[i], i); - return o; -} return []; } -function x() { var t = document.scrollingElement; return t || document.documentElement; } -function O(t, e, n, o, i) { if (t.getBoundingClientRect || t === window) { - var r, a, l, s, u, d, h; - if (t !== window && t.parentNode && t !== x() ? (a = (r = t.getBoundingClientRect()).top, l = r.left, s = r.bottom, u = r.right, d = r.height, h = r.width) : (a = 0, l = 0, s = window.innerHeight, u = window.innerWidth, d = window.innerHeight, h = window.innerWidth), (e || n) && t !== window && (i = i || t.parentNode, !c)) - do { - if (i && i.getBoundingClientRect && ("none" !== _(i, "transform") || n && "static" !== _(i, "position"))) { - var f = i.getBoundingClientRect(); - a -= f.top + parseInt(_(i, "border-top-width")), l -= f.left + parseInt(_(i, "border-left-width")), s = a + r.height, u = l + r.width; - break; - } - } while (i = i.parentNode); - if (o && t !== window) { - var p = C(i || t), g = p && p.a, v = p && p.d; - p && (s = (a /= v) + (d /= v), u = (l /= g) + (h /= g)); - } - return { top: a, left: l, bottom: s, right: u, width: h, height: d }; -} } -function M(t, e, n) { for (var o = k(t, !0), i = O(t)[e]; o;) { - var r = O(o)[n]; - if (!("top" === n || "left" === n ? i >= r : i <= r)) - return o; - if (o === x()) - break; - o = k(o, !1); -} return !1; } -function A(t, e, n, o) { for (var i = 0, r = 0, a = t.children; r < a.length;) { - if ("none" !== a[r].style.display && a[r] !== Ht.ghost && (o || a[r] !== Ht.dragged) && w(a[r], n.draggable, t, !1)) { - if (i === e) - return a[r]; - i++; - } - r++; -} return null; } -function N(t, e) { for (var n = t.lastElementChild; n && (n === Ht.ghost || "none" === _(n, "display") || e && !b(n, e));) - n = n.previousElementSibling; return n || null; } -function I(t, e) { var n = 0; if (!t || !t.parentNode) - return -1; for (; t = t.previousElementSibling;) - "TEMPLATE" === t.nodeName.toUpperCase() || t === Ht.clone || e && !b(t, e) || n++; return n; } -function P(t) { var e = 0, n = 0, o = x(); if (t) - do { - var i = C(t), r = i.a, a = i.d; - e += t.scrollLeft * r, n += t.scrollTop * a; - } while (t !== o && (t = t.parentNode)); return [e, n]; } -function k(t, e) { if (!t || !t.getBoundingClientRect) - return x(); var n = t, o = !1; do { - if (n.clientWidth < n.scrollWidth || n.clientHeight < n.scrollHeight) { - var i = _(n); - if (n.clientWidth < n.scrollWidth && ("auto" == i.overflowX || "scroll" == i.overflowX) || n.clientHeight < n.scrollHeight && ("auto" == i.overflowY || "scroll" == i.overflowY)) { - if (!n.getBoundingClientRect || n === document.body) - return x(); - if (o || e) - return n; - o = !0; - } - } -} while (n = n.parentNode); return x(); } -function R(t, e) { return Math.round(t.top) === Math.round(e.top) && Math.round(t.left) === Math.round(e.left) && Math.round(t.height) === Math.round(e.height) && Math.round(t.width) === Math.round(e.width); } -function X(t, e) { return function () { if (!D) { - var n = arguments; - 1 === n.length ? t.call(this, n[0]) : t.apply(this, n), D = setTimeout((function () { D = void 0; }), e); -} }; } -function Y(t, e, n) { t.scrollLeft += e, t.scrollTop += n; } -function B(t) { var e = window.Polymer, n = window.jQuery || window.Zepto; return e && e.dom ? e.dom(t).cloneNode(!0) : n ? n(t).clone(!0)[0] : t.cloneNode(!0); } -function F(t, e) { _(t, "position", "absolute"), _(t, "top", e.top), _(t, "left", e.left), _(t, "width", e.width), _(t, "height", e.height); } -function j(t) { _(t, "position", ""), _(t, "top", ""), _(t, "left", ""), _(t, "width", ""), _(t, "height", ""); } -function H(t, e, n) { var o = {}; return Array.from(t.children).forEach((function (i) { var r, a, l, s; if (w(i, e.draggable, t, !1) && !i.animated && i !== n) { - var c = O(i); - o.left = Math.min(null !== (r = o.left) && void 0 !== r ? r : 1 / 0, c.left), o.top = Math.min(null !== (a = o.top) && void 0 !== a ? a : 1 / 0, c.top), o.right = Math.max(null !== (l = o.right) && void 0 !== l ? l : -1 / 0, c.right), o.bottom = Math.max(null !== (s = o.bottom) && void 0 !== s ? s : -1 / 0, c.bottom); -} })), o.width = o.right - o.left, o.height = o.bottom - o.top, o.x = o.left, o.y = o.top, o; } -var L = "Sortable" + (new Date).getTime(); -function K() { var t, n = []; return { captureAnimationState: function () { (n = [], this.options.animation) && [].slice.call(this.el.children).forEach((function (t) { if ("none" !== _(t, "display") && t !== Ht.ghost) { - n.push({ target: t, rect: O(t) }); - var o = e({}, n[n.length - 1].rect); - if (t.thisAnimationDuration) { - var i = C(t, !0); - i && (o.top -= i.f, o.left -= i.e); - } - t.fromRect = o; - } })); }, addAnimationState: function (t) { n.push(t); }, removeAnimationState: function (t) { n.splice(function (t, e) { for (var n in t) - if (t.hasOwnProperty(n)) - for (var o in e) - if (e.hasOwnProperty(o) && e[o] === t[n][o]) - return Number(n); return -1; }(n, { target: t }), 1); }, animateAll: function (e) { var o = this; if (!this.options.animation) - return clearTimeout(t), void ("function" == typeof e && e()); var i = !1, r = 0; n.forEach((function (t) { var e = 0, n = t.target, a = n.fromRect, l = O(n), s = n.prevFromRect, c = n.prevToRect, u = t.rect, d = C(n, !0); d && (l.top -= d.f, l.left -= d.e), n.toRect = l, n.thisAnimationDuration && R(s, l) && !R(a, l) && (u.top - l.top) / (u.left - l.left) == (a.top - l.top) / (a.left - l.left) && (e = function (t, e, n, o) { return Math.sqrt(Math.pow(e.top - t.top, 2) + Math.pow(e.left - t.left, 2)) / Math.sqrt(Math.pow(e.top - n.top, 2) + Math.pow(e.left - n.left, 2)) * o.animation; }(u, s, c, o.options)), R(l, a) || (n.prevFromRect = a, n.prevToRect = l, e || (e = o.options.animation), o.animate(n, u, l, e)), e && (i = !0, r = Math.max(r, e), clearTimeout(n.animationResetTimer), n.animationResetTimer = setTimeout((function () { n.animationTime = 0, n.prevFromRect = null, n.fromRect = null, n.prevToRect = null, n.thisAnimationDuration = null; }), e), n.thisAnimationDuration = e); })), clearTimeout(t), i ? t = setTimeout((function () { "function" == typeof e && e(); }), r) : "function" == typeof e && e(), n = []; }, animate: function (t, e, n, o) { if (o) { - _(t, "transition", ""), _(t, "transform", ""); - var i = C(this.el), r = i && i.a, a = i && i.d, l = (e.left - n.left) / (r || 1), s = (e.top - n.top) / (a || 1); - t.animatingX = !!l, t.animatingY = !!s, _(t, "transform", "translate3d(" + l + "px," + s + "px,0)"), this.forRepaintDummy = function (t) { return t.offsetWidth; }(t), _(t, "transition", "transform " + o + "ms" + (this.options.easing ? " " + this.options.easing : "")), _(t, "transform", "translate3d(0,0,0)"), "number" == typeof t.animated && clearTimeout(t.animated), t.animated = setTimeout((function () { _(t, "transition", ""), _(t, "transform", ""), t.animated = !1, t.animatingX = !1, t.animatingY = !1; }), o); - } } }; } -var W = [], z = { initializeByDefault: !0 }, G = { mount: function (t) { for (var e in z) - z.hasOwnProperty(e) && !(e in t) && (t[e] = z[e]); W.forEach((function (e) { if (e.pluginName === t.pluginName) - throw "Sortable: Cannot mount plugin ".concat(t.pluginName, " more than once"); })), W.push(t); }, pluginEvent: function (t, n, o) { var i = this; this.eventCanceled = !1, o.cancel = function () { i.eventCanceled = !0; }; var r = t + "Global"; W.forEach((function (i) { n[i.pluginName] && (n[i.pluginName][r] && n[i.pluginName][r](e({ sortable: n }, o)), n.options[i.pluginName] && n[i.pluginName][t] && n[i.pluginName][t](e({ sortable: n }, o))); })); }, initializePlugins: function (t, e, n, o) { for (var r in W.forEach((function (o) { var r = o.pluginName; if (t.options[r] || o.initializeByDefault) { - var a = new o(t, e, t.options); - a.sortable = t, a.options = t.options, t[r] = a, i(n, a.defaults); - } })), t.options) - if (t.options.hasOwnProperty(r)) { - var a = this.modifyOption(t, r, t.options[r]); - void 0 !== a && (t.options[r] = a); - } }, getEventProperties: function (t, e) { var n = {}; return W.forEach((function (o) { "function" == typeof o.eventProperties && i(n, o.eventProperties.call(e[o.pluginName], t)); })), n; }, modifyOption: function (t, e, n) { var o; return W.forEach((function (i) { t[i.pluginName] && i.optionListeners && "function" == typeof i.optionListeners[e] && (o = i.optionListeners[e].call(t[i.pluginName], n)); })), o; } }; -function U(t) { var n = t.sortable, o = t.rootEl, i = t.name, r = t.targetEl, a = t.cloneEl, l = t.toEl, s = t.fromEl, d = t.oldIndex, h = t.newIndex, f = t.oldDraggableIndex, p = t.newDraggableIndex, g = t.originalEvent, v = t.putSortable, m = t.extraEventProperties; if (n = n || o && o[L]) { - var b, y = n.options, w = "on" + i.charAt(0).toUpperCase() + i.substr(1); - !window.CustomEvent || c || u ? (b = document.createEvent("Event")).initEvent(i, !0, !0) : b = new CustomEvent(i, { bubbles: !0, cancelable: !0 }), b.to = l || o, b.from = s || o, b.item = r || o, b.clone = a, b.oldIndex = d, b.newIndex = h, b.oldDraggableIndex = f, b.newDraggableIndex = p, b.originalEvent = g, b.pullMode = v ? v.lastPutMode : void 0; - var D = e(e({}, m), G.getEventProperties(i, n)); - for (var E in D) - b[E] = D[E]; - o && o.dispatchEvent(b), y[w] && y[w].call(n, b); -} } -var q = ["evt"], V = function (t, n) { var o = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}, i = o.evt, a = r(o, q); G.pluginEvent.bind(Ht)(t, n, e({ dragEl: $, parentEl: Q, ghostEl: J, rootEl: tt, nextEl: et, lastDownEl: nt, cloneEl: ot, cloneHidden: it, dragStarted: mt, putSortable: ut, activeSortable: Ht.active, originalEvent: i, oldIndex: rt, oldDraggableIndex: lt, newIndex: at, newDraggableIndex: st, hideGhostForTarget: Yt, unhideGhostForTarget: Bt, cloneNowHidden: function () { it = !0; }, cloneNowShown: function () { it = !1; }, dispatchSortableEvent: function (t) { Z({ sortable: n, name: t, originalEvent: i }); } }, a)); }; -function Z(t) { U(e({ putSortable: ut, cloneEl: ot, targetEl: $, rootEl: tt, oldIndex: rt, oldDraggableIndex: lt, newIndex: at, newDraggableIndex: st }, t)); } -var $, Q, J, tt, et, nt, ot, it, rt, at, lt, st, ct, ut, dt, ht, ft, pt, gt, vt, mt, bt, yt, wt, Dt, Et = !1, St = !1, _t = [], Ct = !1, Tt = !1, xt = [], Ot = !1, Mt = [], At = "undefined" != typeof document, Nt = f, It = u || c ? "cssFloat" : "float", Pt = At && !p && !f && "draggable" in document.createElement("div"), kt = function () { if (At) { - if (c) - return !1; - var t = document.createElement("x"); - return t.style.cssText = "pointer-events:auto", "auto" === t.style.pointerEvents; -} }(), Rt = function (t, e) { var n = _(t), o = parseInt(n.width) - parseInt(n.paddingLeft) - parseInt(n.paddingRight) - parseInt(n.borderLeftWidth) - parseInt(n.borderRightWidth), i = A(t, 0, e), r = A(t, 1, e), a = i && _(i), l = r && _(r), s = a && parseInt(a.marginLeft) + parseInt(a.marginRight) + O(i).width, c = l && parseInt(l.marginLeft) + parseInt(l.marginRight) + O(r).width; if ("flex" === n.display) - return "column" === n.flexDirection || "column-reverse" === n.flexDirection ? "vertical" : "horizontal"; if ("grid" === n.display) - return n.gridTemplateColumns.split(" ").length <= 1 ? "vertical" : "horizontal"; if (i && a.float && "none" !== a.float) { - var u = "left" === a.float ? "left" : "right"; - return !r || "both" !== l.clear && l.clear !== u ? "horizontal" : "vertical"; -} return i && ("block" === a.display || "flex" === a.display || "table" === a.display || "grid" === a.display || s >= o && "none" === n[It] || r && "none" === n[It] && s + c > o) ? "vertical" : "horizontal"; }, Xt = function (t) { function e(t, n) { return function (o, i, r, a) { var l = o.options.group.name && i.options.group.name && o.options.group.name === i.options.group.name; if (null == t && (n || l)) - return !0; if (null == t || !1 === t) - return !1; if (n && "clone" === t) - return t; if ("function" == typeof t) - return e(t(o, i, r, a), n)(o, i, r, a); var s = (n ? o : i).options.group.name; return !0 === t || "string" == typeof t && t === s || t.join && t.indexOf(s) > -1; }; } var o = {}, i = t.group; i && "object" == n(i) || (i = { name: i }), o.name = i.name, o.checkPull = e(i.pull, !0), o.checkPut = e(i.put), o.revertClone = i.revertClone, t.group = o; }, Yt = function () { !kt && J && _(J, "display", "none"); }, Bt = function () { !kt && J && _(J, "display", ""); }; -At && !p && document.addEventListener("click", (function (t) { if (St) - return t.preventDefault(), t.stopPropagation && t.stopPropagation(), t.stopImmediatePropagation && t.stopImmediatePropagation(), St = !1, !1; }), !0); -var Ft = function (t) { if ($) { - t = t.touches ? t.touches[0] : t; - var e = (i = t.clientX, r = t.clientY, _t.some((function (t) { var e = t[L].options.emptyInsertThreshold; if (e && !N(t)) { - var n = O(t), o = i >= n.left - e && i <= n.right + e, l = r >= n.top - e && r <= n.bottom + e; - return o && l ? a = t : void 0; - } })), a); - if (e) { - var n = {}; - for (var o in t) - t.hasOwnProperty(o) && (n[o] = t[o]); - n.target = n.rootEl = e, n.preventDefault = void 0, n.stopPropagation = void 0, e[L]._onDragOver(n); - } -} var i, r, a; }, jt = function (t) { $ && $.parentNode[L]._isOutsideThisEl(t.target); }; -function Ht(t, e) { if (!t || !t.nodeType || 1 !== t.nodeType) - throw "Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t)); this.el = t, this.options = e = i({}, e), t[L] = this; var n = { group: null, sort: !0, disabled: !1, store: null, handle: null, draggable: /^[uo]l$/i.test(t.nodeName) ? ">li" : ">*", swapThreshold: 1, invertSwap: !1, invertedSwapThreshold: null, removeCloneOnHide: !0, direction: function () { return Rt(t, this.options); }, ghostClass: "sortable-ghost", chosenClass: "sortable-chosen", dragClass: "sortable-drag", ignore: "a, img", filter: null, preventOnFilter: !0, animation: 0, easing: null, setData: function (t, e) { t.setData("Text", e.textContent); }, dropBubble: !1, dragoverBubble: !1, dataIdAttr: "data-id", delay: 0, delayOnTouchOnly: !1, touchStartThreshold: (Number.parseInt ? Number : window).parseInt(window.devicePixelRatio, 10) || 1, forceFallback: !1, fallbackClass: "sortable-fallback", fallbackOnBody: !1, fallbackTolerance: 0, fallbackOffset: { x: 0, y: 0 }, supportPointer: !1 !== Ht.supportPointer && "PointerEvent" in window && (!h || f), emptyInsertThreshold: 5 }; for (var o in G.initializePlugins(this, t, n), n) - !(o in e) && (e[o] = n[o]); for (var r in Xt(e), this) - "_" === r.charAt(0) && "function" == typeof this[r] && (this[r] = this[r].bind(this)); this.nativeDraggable = !e.forceFallback && Pt, this.nativeDraggable && (this.options.touchStartThreshold = 1), e.supportPointer ? v(t, "pointerdown", this._onTapStart) : (v(t, "mousedown", this._onTapStart), v(t, "touchstart", this._onTapStart)), this.nativeDraggable && (v(t, "dragover", this), v(t, "dragenter", this)), _t.push(this.el), e.store && e.store.get && this.sort(e.store.get(this) || []), i(this, K()); } -function Lt(t, e, n, o, i, r, a, l) { var s, d, h = t[L], f = h.options.onMove; return !window.CustomEvent || c || u ? (s = document.createEvent("Event")).initEvent("move", !0, !0) : s = new CustomEvent("move", { bubbles: !0, cancelable: !0 }), s.to = e, s.from = t, s.dragged = n, s.draggedRect = o, s.related = i || e, s.relatedRect = r || O(e), s.willInsertAfter = l, s.originalEvent = a, t.dispatchEvent(s), f && (d = f.call(h, s, a)), d; } -function Kt(t) { t.draggable = !1; } -function Wt() { Ot = !1; } -function zt(t) { for (var e = t.tagName + t.className + t.src + t.href + t.textContent, n = e.length, o = 0; n--;) - o += e.charCodeAt(n); return o.toString(36); } -function Gt(t) { return setTimeout(t, 0); } -function Ut(t) { return clearTimeout(t); } -Ht.prototype = { constructor: Ht, _isOutsideThisEl: function (t) { this.el.contains(t) || t === this.el || (bt = null); }, _getDirection: function (t, e) { return "function" == typeof this.options.direction ? this.options.direction.call(this, t, e, $) : this.options.direction; }, _onTapStart: function (t) { if (t.cancelable) { - var e = this, n = this.el, o = this.options, i = o.preventOnFilter, r = t.type, a = t.touches && t.touches[0] || t.pointerType && "touch" === t.pointerType && t, l = (a || t).target, s = t.target.shadowRoot && (t.path && t.path[0] || t.composedPath && t.composedPath()[0]) || l, c = o.filter; - if (function (t) { Mt.length = 0; var e = t.getElementsByTagName("input"), n = e.length; for (; n--;) { - var o = e[n]; - o.checked && Mt.push(o); - } }(n), !$ && !(/mousedown|pointerdown/.test(r) && 0 !== t.button || o.disabled) && !s.isContentEditable && (this.nativeDraggable || !h || !l || "SELECT" !== l.tagName.toUpperCase()) && !((l = w(l, o.draggable, n, !1)) && l.animated || nt === l)) { - if (rt = I(l), lt = I(l, o.draggable), "function" == typeof c) { - if (c.call(this, t, l, this)) - return Z({ sortable: e, rootEl: s, name: "filter", targetEl: l, toEl: n, fromEl: n }), V("filter", e, { evt: t }), void (i && t.preventDefault()); - } - else if (c && (c = c.split(",").some((function (o) { if (o = w(s, o.trim(), n, !1)) - return Z({ sortable: e, rootEl: o, name: "filter", targetEl: l, fromEl: n, toEl: n }), V("filter", e, { evt: t }), !0; })))) - return void (i && t.preventDefault()); - o.handle && !w(s, o.handle, n, !1) || this._prepareDragStart(t, a, l); - } - } }, _prepareDragStart: function (t, e, n) { var o, i = this, r = i.el, a = i.options, l = r.ownerDocument; if (n && !$ && n.parentNode === r) { - var s = O(n); - if (tt = r, Q = ($ = n).parentNode, et = $.nextSibling, nt = n, ct = a.group, Ht.dragged = $, dt = { target: $, clientX: (e || t).clientX, clientY: (e || t).clientY }, gt = dt.clientX - s.left, vt = dt.clientY - s.top, this._lastX = (e || t).clientX, this._lastY = (e || t).clientY, $.style["will-change"] = "all", o = function () { V("delayEnded", i, { evt: t }), Ht.eventCanceled ? i._onDrop() : (i._disableDelayedDragEvents(), !d && i.nativeDraggable && ($.draggable = !0), i._triggerDragStart(t, e), Z({ sortable: i, name: "choose", originalEvent: t }), S($, a.chosenClass, !0)); }, a.ignore.split(",").forEach((function (t) { T($, t.trim(), Kt); })), v(l, "dragover", Ft), v(l, "mousemove", Ft), v(l, "touchmove", Ft), a.supportPointer ? (v(l, "pointerup", i._onDrop), !this.nativeDraggable && v(l, "pointercancel", i._onDrop)) : (v(l, "mouseup", i._onDrop), v(l, "touchend", i._onDrop), v(l, "touchcancel", i._onDrop)), d && this.nativeDraggable && (this.options.touchStartThreshold = 4, $.draggable = !0), V("delayStart", this, { evt: t }), !a.delay || a.delayOnTouchOnly && !e || this.nativeDraggable && (u || c)) - o(); - else { - if (Ht.eventCanceled) - return void this._onDrop(); - a.supportPointer ? (v(l, "pointerup", i._disableDelayedDrag), v(l, "pointercancel", i._disableDelayedDrag)) : (v(l, "mouseup", i._disableDelayedDrag), v(l, "touchend", i._disableDelayedDrag), v(l, "touchcancel", i._disableDelayedDrag)), v(l, "mousemove", i._delayedDragTouchMoveHandler), v(l, "touchmove", i._delayedDragTouchMoveHandler), a.supportPointer && v(l, "pointermove", i._delayedDragTouchMoveHandler), i._dragStartTimer = setTimeout(o, a.delay); - } - } }, _delayedDragTouchMoveHandler: function (t) { var e = t.touches ? t.touches[0] : t; Math.max(Math.abs(e.clientX - this._lastX), Math.abs(e.clientY - this._lastY)) >= Math.floor(this.options.touchStartThreshold / (this.nativeDraggable && window.devicePixelRatio || 1)) && this._disableDelayedDrag(); }, _disableDelayedDrag: function () { $ && Kt($), clearTimeout(this._dragStartTimer), this._disableDelayedDragEvents(); }, _disableDelayedDragEvents: function () { var t = this.el.ownerDocument; m(t, "mouseup", this._disableDelayedDrag), m(t, "touchend", this._disableDelayedDrag), m(t, "touchcancel", this._disableDelayedDrag), m(t, "pointerup", this._disableDelayedDrag), m(t, "pointercancel", this._disableDelayedDrag), m(t, "mousemove", this._delayedDragTouchMoveHandler), m(t, "touchmove", this._delayedDragTouchMoveHandler), m(t, "pointermove", this._delayedDragTouchMoveHandler); }, _triggerDragStart: function (t, e) { e = e || "touch" == t.pointerType && t, !this.nativeDraggable || e ? this.options.supportPointer ? v(document, "pointermove", this._onTouchMove) : v(document, e ? "touchmove" : "mousemove", this._onTouchMove) : (v($, "dragend", this), v(tt, "dragstart", this._onDragStart)); try { - document.selection ? Gt((function () { document.selection.empty(); })) : window.getSelection().removeAllRanges(); - } - catch (t) { } }, _dragStarted: function (t, e) { if (Et = !1, tt && $) { - V("dragStarted", this, { evt: e }), this.nativeDraggable && v(document, "dragover", jt); - var n = this.options; - !t && S($, n.dragClass, !1), S($, n.ghostClass, !0), Ht.active = this, t && this._appendGhost(), Z({ sortable: this, name: "start", originalEvent: e }); - } - else - this._nulling(); }, _emulateDragOver: function () { if (ht) { - this._lastX = ht.clientX, this._lastY = ht.clientY, Yt(); - for (var t = document.elementFromPoint(ht.clientX, ht.clientY), e = t; t && t.shadowRoot && (t = t.shadowRoot.elementFromPoint(ht.clientX, ht.clientY)) !== e;) - e = t; - if ($.parentNode[L]._isOutsideThisEl(t), e) - do { - if (e[L]) { - if (e[L]._onDragOver({ clientX: ht.clientX, clientY: ht.clientY, target: t, rootEl: e }) && !this.options.dragoverBubble) - break; - } - t = e; - } while (e = y(e)); - Bt(); - } }, _onTouchMove: function (t) { if (dt) { - var e = this.options, n = e.fallbackTolerance, o = e.fallbackOffset, i = t.touches ? t.touches[0] : t, r = J && C(J, !0), a = J && r && r.a, l = J && r && r.d, s = Nt && Dt && P(Dt), c = (i.clientX - dt.clientX + o.x) / (a || 1) + (s ? s[0] - xt[0] : 0) / (a || 1), u = (i.clientY - dt.clientY + o.y) / (l || 1) + (s ? s[1] - xt[1] : 0) / (l || 1); - if (!Ht.active && !Et) { - if (n && Math.max(Math.abs(i.clientX - this._lastX), Math.abs(i.clientY - this._lastY)) < n) - return; - this._onDragStart(t, !0); - } - if (J) { - r ? (r.e += c - (ft || 0), r.f += u - (pt || 0)) : r = { a: 1, b: 0, c: 0, d: 1, e: c, f: u }; - var d = "matrix(".concat(r.a, ",").concat(r.b, ",").concat(r.c, ",").concat(r.d, ",").concat(r.e, ",").concat(r.f, ")"); - _(J, "webkitTransform", d), _(J, "mozTransform", d), _(J, "msTransform", d), _(J, "transform", d), ft = c, pt = u, ht = i; - } - t.cancelable && t.preventDefault(); - } }, _appendGhost: function () { if (!J) { - var t = this.options.fallbackOnBody ? document.body : tt, e = O($, !0, Nt, !0, t), n = this.options; - if (Nt) { - for (Dt = t; "static" === _(Dt, "position") && "none" === _(Dt, "transform") && Dt !== document;) - Dt = Dt.parentNode; - Dt !== document.body && Dt !== document.documentElement ? (Dt === document && (Dt = x()), e.top += Dt.scrollTop, e.left += Dt.scrollLeft) : Dt = x(), xt = P(Dt); - } - S(J = $.cloneNode(!0), n.ghostClass, !1), S(J, n.fallbackClass, !0), S(J, n.dragClass, !0), _(J, "transition", ""), _(J, "transform", ""), _(J, "box-sizing", "border-box"), _(J, "margin", 0), _(J, "top", e.top), _(J, "left", e.left), _(J, "width", e.width), _(J, "height", e.height), _(J, "opacity", "0.8"), _(J, "position", Nt ? "absolute" : "fixed"), _(J, "zIndex", "100000"), _(J, "pointerEvents", "none"), Ht.ghost = J, t.appendChild(J), _(J, "transform-origin", gt / parseInt(J.style.width) * 100 + "% " + vt / parseInt(J.style.height) * 100 + "%"); - } }, _onDragStart: function (t, e) { var n = this, o = t.dataTransfer, i = n.options; V("dragStart", this, { evt: t }), Ht.eventCanceled ? this._onDrop() : (V("setupClone", this), Ht.eventCanceled || ((ot = B($)).removeAttribute("id"), ot.draggable = !1, ot.style["will-change"] = "", this._hideClone(), S(ot, this.options.chosenClass, !1), Ht.clone = ot), n.cloneId = Gt((function () { V("clone", n), Ht.eventCanceled || (n.options.removeCloneOnHide || tt.insertBefore(ot, $), n._hideClone(), Z({ sortable: n, name: "clone" })); })), !e && S($, i.dragClass, !0), e ? (St = !0, n._loopId = setInterval(n._emulateDragOver, 50)) : (m(document, "mouseup", n._onDrop), m(document, "touchend", n._onDrop), m(document, "touchcancel", n._onDrop), o && (o.effectAllowed = "move", i.setData && i.setData.call(n, o, $)), v(document, "drop", n), _($, "transform", "translateZ(0)")), Et = !0, n._dragStartId = Gt(n._dragStarted.bind(n, e, t)), v(document, "selectstart", n), mt = !0, window.getSelection().removeAllRanges(), h && _(document.body, "user-select", "none")); }, _onDragOver: function (t) { var n, o, i, r, a = this.el, l = t.target, s = this.options, c = s.group, u = Ht.active, d = ct === c, h = s.sort, f = ut || u, p = this, g = !1; if (!Ot) { - if (void 0 !== t.preventDefault && t.cancelable && t.preventDefault(), l = w(l, s.draggable, a, !0), F("dragOver"), Ht.eventCanceled) - return g; - if ($.contains(t.target) || l.animated && l.animatingX && l.animatingY || p._ignoreWhileAnimating === l) - return K(!1); - if (St = !1, u && !s.disabled && (d ? h || (i = Q !== tt) : ut === this || (this.lastPutMode = ct.checkPull(this, u, $, t)) && c.checkPut(this, u, $, t))) { - if (r = "vertical" === this._getDirection(t, l), n = O($), F("dragOverValid"), Ht.eventCanceled) - return g; - if (i) - return Q = tt, j(), this._hideClone(), F("revert"), Ht.eventCanceled || (et ? tt.insertBefore($, et) : tt.appendChild($)), K(!0); - var v = N(a, s.draggable); - if (!v || function (t, e, n) { var o = O(N(n.el, n.options.draggable)), i = H(n.el, n.options, J), r = 10; return e ? t.clientX > i.right + r || t.clientY > o.bottom && t.clientX > o.left : t.clientY > i.bottom + r || t.clientX > o.right && t.clientY > o.top; }(t, r, this) && !v.animated) { - if (v === $) - return K(!1); - if (v && a === t.target && (l = v), l && (o = O(l)), !1 !== Lt(tt, a, $, n, l, o, t, !!l)) - return j(), v && v.nextSibling ? a.insertBefore($, v.nextSibling) : a.appendChild($), Q = a, W(), K(!0); - } - else if (v && function (t, e, n) { var o = O(A(n.el, 0, n.options, !0)), i = H(n.el, n.options, J), r = 10; return e ? t.clientX < i.left - r || t.clientY < o.top && t.clientX < o.right : t.clientY < i.top - r || t.clientY < o.bottom && t.clientX < o.left; }(t, r, this)) { - var m = A(a, 0, s, !0); - if (m === $) - return K(!1); - if (o = O(l = m), !1 !== Lt(tt, a, $, n, l, o, t, !1)) - return j(), a.insertBefore($, m), Q = a, W(), K(!0); - } - else if (l.parentNode === a) { - o = O(l); - var b, y, D, E = $.parentNode !== a, C = !function (t, e, n) { var o = n ? t.left : t.top, i = n ? t.right : t.bottom, r = n ? t.width : t.height, a = n ? e.left : e.top, l = n ? e.right : e.bottom, s = n ? e.width : e.height; return o === a || i === l || o + r / 2 === a + s / 2; }($.animated && $.toRect || n, l.animated && l.toRect || o, r), T = r ? "top" : "left", x = M(l, "top", "top") || M($, "top", "top"), P = x ? x.scrollTop : void 0; - if (bt !== l && (y = o[T], Ct = !1, Tt = !C && s.invertSwap || E), b = function (t, e, n, o, i, r, a, l) { var s = o ? t.clientY : t.clientX, c = o ? n.height : n.width, u = o ? n.top : n.left, d = o ? n.bottom : n.right, h = !1; if (!a) - if (l && wt < c * i) { - if (!Ct && (1 === yt ? s > u + c * r / 2 : s < d - c * r / 2) && (Ct = !0), Ct) - h = !0; - else if (1 === yt ? s < u + wt : s > d - wt) - return -yt; - } - else if (s > u + c * (1 - i) / 2 && s < d - c * (1 - i) / 2) - return function (t) { return I($) < I(t) ? 1 : -1; }(e); if ((h = h || a) && (s < u + c * r / 2 || s > d - c * r / 2)) - return s > u + c / 2 ? 1 : -1; return 0; }(t, l, o, r, C ? 1 : s.swapThreshold, null == s.invertedSwapThreshold ? s.swapThreshold : s.invertedSwapThreshold, Tt, bt === l), 0 !== b) { - var k = I($); - do { - k -= b, D = Q.children[k]; - } while (D && ("none" === _(D, "display") || D === J)); - } - if (0 === b || D === l) - return K(!1); - bt = l, yt = b; - var R = l.nextElementSibling, X = !1, B = Lt(tt, a, $, n, l, o, t, X = 1 === b); - if (!1 !== B) - return 1 !== B && -1 !== B || (X = 1 === B), Ot = !0, setTimeout(Wt, 30), j(), X && !R ? a.appendChild($) : l.parentNode.insertBefore($, X ? R : l), x && Y(x, 0, P - x.scrollTop), Q = $.parentNode, void 0 === y || Tt || (wt = Math.abs(y - O(l)[T])), W(), K(!0); - } - if (a.contains($)) - return K(!1); - } - return !1; - } function F(s, c) { V(s, p, e({ evt: t, isOwner: d, axis: r ? "vertical" : "horizontal", revert: i, dragRect: n, targetRect: o, canSort: h, fromSortable: f, target: l, completed: K, onMove: function (e, o) { return Lt(tt, a, $, n, e, O(e), t, o); }, changed: W }, c)); } function j() { F("dragOverAnimationCapture"), p.captureAnimationState(), p !== f && f.captureAnimationState(); } function K(e) { return F("dragOverCompleted", { insertion: e }), e && (d ? u._hideClone() : u._showClone(p), p !== f && (S($, ut ? ut.options.ghostClass : u.options.ghostClass, !1), S($, s.ghostClass, !0)), ut !== p && p !== Ht.active ? ut = p : p === Ht.active && ut && (ut = null), f === p && (p._ignoreWhileAnimating = l), p.animateAll((function () { F("dragOverAnimationComplete"), p._ignoreWhileAnimating = null; })), p !== f && (f.animateAll(), f._ignoreWhileAnimating = null)), (l === $ && !$.animated || l === a && !l.animated) && (bt = null), s.dragoverBubble || t.rootEl || l === document || ($.parentNode[L]._isOutsideThisEl(t.target), !e && Ft(t)), !s.dragoverBubble && t.stopPropagation && t.stopPropagation(), g = !0; } function W() { at = I($), st = I($, s.draggable), Z({ sortable: p, name: "change", toEl: a, newIndex: at, newDraggableIndex: st, originalEvent: t }); } }, _ignoreWhileAnimating: null, _offMoveEvents: function () { m(document, "mousemove", this._onTouchMove), m(document, "touchmove", this._onTouchMove), m(document, "pointermove", this._onTouchMove), m(document, "dragover", Ft), m(document, "mousemove", Ft), m(document, "touchmove", Ft); }, _offUpEvents: function () { var t = this.el.ownerDocument; m(t, "mouseup", this._onDrop), m(t, "touchend", this._onDrop), m(t, "pointerup", this._onDrop), m(t, "pointercancel", this._onDrop), m(t, "touchcancel", this._onDrop), m(document, "selectstart", this); }, _onDrop: function (t) { var e = this.el, n = this.options; at = I($), st = I($, n.draggable), V("drop", this, { evt: t }), Q = $ && $.parentNode, at = I($), st = I($, n.draggable), Ht.eventCanceled || (Et = !1, Tt = !1, Ct = !1, clearInterval(this._loopId), clearTimeout(this._dragStartTimer), Ut(this.cloneId), Ut(this._dragStartId), this.nativeDraggable && (m(document, "drop", this), m(e, "dragstart", this._onDragStart)), this._offMoveEvents(), this._offUpEvents(), h && _(document.body, "user-select", ""), _($, "transform", ""), t && (mt && (t.cancelable && t.preventDefault(), !n.dropBubble && t.stopPropagation()), J && J.parentNode && J.parentNode.removeChild(J), (tt === Q || ut && "clone" !== ut.lastPutMode) && ot && ot.parentNode && ot.parentNode.removeChild(ot), $ && (this.nativeDraggable && m($, "dragend", this), Kt($), $.style["will-change"] = "", mt && !Et && S($, ut ? ut.options.ghostClass : this.options.ghostClass, !1), S($, this.options.chosenClass, !1), Z({ sortable: this, name: "unchoose", toEl: Q, newIndex: null, newDraggableIndex: null, originalEvent: t }), tt !== Q ? (at >= 0 && (Z({ rootEl: Q, name: "add", toEl: Q, fromEl: tt, originalEvent: t }), Z({ sortable: this, name: "remove", toEl: Q, originalEvent: t }), Z({ rootEl: Q, name: "sort", toEl: Q, fromEl: tt, originalEvent: t }), Z({ sortable: this, name: "sort", toEl: Q, originalEvent: t })), ut && ut.save()) : at !== rt && at >= 0 && (Z({ sortable: this, name: "update", toEl: Q, originalEvent: t }), Z({ sortable: this, name: "sort", toEl: Q, originalEvent: t })), Ht.active && (null != at && -1 !== at || (at = rt, st = lt), Z({ sortable: this, name: "end", toEl: Q, originalEvent: t }), this.save())))), this._nulling(); }, _nulling: function () { V("nulling", this), tt = $ = Q = J = et = ot = nt = it = dt = ht = mt = at = st = rt = lt = bt = yt = ut = ct = Ht.dragged = Ht.ghost = Ht.clone = Ht.active = null, Mt.forEach((function (t) { t.checked = !0; })), Mt.length = ft = pt = 0; }, handleEvent: function (t) { switch (t.type) { - case "drop": - case "dragend": - this._onDrop(t); - break; - case "dragenter": - case "dragover": - $ && (this._onDragOver(t), function (t) { t.dataTransfer && (t.dataTransfer.dropEffect = "move"); t.cancelable && t.preventDefault(); }(t)); - break; - case "selectstart": t.preventDefault(); - } }, toArray: function () { for (var t, e = [], n = this.el.children, o = 0, i = n.length, r = this.options; o < i; o++) - w(t = n[o], r.draggable, this.el, !1) && e.push(t.getAttribute(r.dataIdAttr) || zt(t)); return e; }, sort: function (t, e) { var n = {}, o = this.el; this.toArray().forEach((function (t, e) { var i = o.children[e]; w(i, this.options.draggable, o, !1) && (n[t] = i); }), this), e && this.captureAnimationState(), t.forEach((function (t) { n[t] && (o.removeChild(n[t]), o.appendChild(n[t])); })), e && this.animateAll(); }, save: function () { var t = this.options.store; t && t.set && t.set(this); }, closest: function (t, e) { return w(t, e || this.options.draggable, this.el, !1); }, option: function (t, e) { var n = this.options; if (void 0 === e) - return n[t]; var o = G.modifyOption(this, t, e); n[t] = void 0 !== o ? o : e, "group" === t && Xt(n); }, destroy: function () { V("destroy", this); var t = this.el; t[L] = null, m(t, "mousedown", this._onTapStart), m(t, "touchstart", this._onTapStart), m(t, "pointerdown", this._onTapStart), this.nativeDraggable && (m(t, "dragover", this), m(t, "dragenter", this)), Array.prototype.forEach.call(t.querySelectorAll("[draggable]"), (function (t) { t.removeAttribute("draggable"); })), this._onDrop(), this._disableDelayedDragEvents(), _t.splice(_t.indexOf(this.el), 1), this.el = t = null; }, _hideClone: function () { if (!it) { - if (V("hideClone", this), Ht.eventCanceled) - return; - _(ot, "display", "none"), this.options.removeCloneOnHide && ot.parentNode && ot.parentNode.removeChild(ot), it = !0; - } }, _showClone: function (t) { if ("clone" === t.lastPutMode) { - if (it) { - if (V("showClone", this), Ht.eventCanceled) - return; - $.parentNode != tt || this.options.group.revertClone ? et ? tt.insertBefore(ot, et) : tt.appendChild(ot) : tt.insertBefore(ot, $), this.options.group.revertClone && this.animate($, ot), _(ot, "display", ""), it = !1; - } - } - else - this._hideClone(); } }, At && v(document, "touchmove", (function (t) { (Ht.active || Et) && t.cancelable && t.preventDefault(); })), Ht.utils = { on: v, off: m, css: _, find: T, is: function (t, e) { return !!w(t, e, t, !1); }, extend: function (t, e) { if (t && e) - for (var n in e) - e.hasOwnProperty(n) && (t[n] = e[n]); return t; }, throttle: X, closest: w, toggleClass: S, clone: B, index: I, nextTick: Gt, cancelNextTick: Ut, detectDirection: Rt, getChild: A, expando: L }, Ht.get = function (t) { return t[L]; }, Ht.mount = function () { for (var t = arguments.length, n = new Array(t), o = 0; o < t; o++) - n[o] = arguments[o]; n[0].constructor === Array && (n = n[0]), n.forEach((function (t) { if (!t.prototype || !t.prototype.constructor) - throw "Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(t)); t.utils && (Ht.utils = e(e({}, Ht.utils), t.utils)), G.mount(t); })); }, Ht.create = function (t, e) { return new Ht(t, e); }, Ht.version = "1.15.6"; -var qt, Vt, Zt, $t, Qt, Jt, te = [], ee = !1; -function ne() { te.forEach((function (t) { clearInterval(t.pid); })), te = []; } -function oe() { clearInterval(Jt); } -var ie, re = X((function (t, e, n, o) { if (e.scroll) { - var i, r = (t.touches ? t.touches[0] : t).clientX, a = (t.touches ? t.touches[0] : t).clientY, l = e.scrollSensitivity, s = e.scrollSpeed, c = x(), u = !1; - Vt !== n && (Vt = n, ne(), qt = e.scroll, i = e.scrollFn, !0 === qt && (qt = k(n, !0))); - var d = 0, h = qt; - do { - var f = h, p = O(f), g = p.top, v = p.bottom, m = p.left, b = p.right, y = p.width, w = p.height, D = void 0, E = void 0, S = f.scrollWidth, C = f.scrollHeight, T = _(f), M = f.scrollLeft, A = f.scrollTop; - f === c ? (D = y < S && ("auto" === T.overflowX || "scroll" === T.overflowX || "visible" === T.overflowX), E = w < C && ("auto" === T.overflowY || "scroll" === T.overflowY || "visible" === T.overflowY)) : (D = y < S && ("auto" === T.overflowX || "scroll" === T.overflowX), E = w < C && ("auto" === T.overflowY || "scroll" === T.overflowY)); - var N = D && (Math.abs(b - r) <= l && M + y < S) - (Math.abs(m - r) <= l && !!M), I = E && (Math.abs(v - a) <= l && A + w < C) - (Math.abs(g - a) <= l && !!A); - if (!te[d]) - for (var P = 0; P <= d; P++) - te[P] || (te[P] = {}); - te[d].vx == N && te[d].vy == I && te[d].el === f || (te[d].el = f, te[d].vx = N, te[d].vy = I, clearInterval(te[d].pid), 0 == N && 0 == I || (u = !0, te[d].pid = setInterval(function () { o && 0 === this.layer && Ht.active._onTouchMove(Qt); var e = te[this.layer].vy ? te[this.layer].vy * s : 0, n = te[this.layer].vx ? te[this.layer].vx * s : 0; "function" == typeof i && "continue" !== i.call(Ht.dragged.parentNode[L], n, e, t, Qt, te[this.layer].el) || Y(te[this.layer].el, n, e); }.bind({ layer: d }), 24))), d++; - } while (e.bubbleScroll && h !== c && (h = k(h, !1))); - ee = u; -} }), 30), ae = function (t) { var e = t.originalEvent, n = t.putSortable, o = t.dragEl, i = t.activeSortable, r = t.dispatchSortableEvent, a = t.hideGhostForTarget, l = t.unhideGhostForTarget; if (e) { - var s = n || i; - a(); - var c = e.changedTouches && e.changedTouches.length ? e.changedTouches[0] : e, u = document.elementFromPoint(c.clientX, c.clientY); - l(), s && !s.el.contains(u) && (r("spill"), this.onSpill({ dragEl: o, putSortable: n })); -} }; -function le() { } -function se() { } -function ce() { function t() { this.defaults = { swapClass: "sortable-swap-highlight" }; } return t.prototype = { dragStart: function (t) { var e = t.dragEl; ie = e; }, dragOverValid: function (t) { var e = t.completed, n = t.target, o = t.onMove, i = t.activeSortable, r = t.changed, a = t.cancel; if (i.options.swap) { - var l = this.sortable.el, s = this.options; - if (n && n !== l) { - var c = ie; - !1 !== o(n) ? (S(n, s.swapClass, !0), ie = n) : ie = null, c && c !== ie && S(c, s.swapClass, !1); - } - r(), e(!0), a(); - } }, drop: function (t) { var e = t.activeSortable, n = t.putSortable, o = t.dragEl, i = n || this.sortable, r = this.options; ie && S(ie, r.swapClass, !1), ie && (r.swap || n && n.options.swap) && o !== ie && (i.captureAnimationState(), i !== e && e.captureAnimationState(), function (t, e) { var n, o, i = t.parentNode, r = e.parentNode; if (!i || !r || i.isEqualNode(e) || r.isEqualNode(t)) - return; n = I(t), o = I(e), i.isEqualNode(r) && n < o && o++; i.insertBefore(e, i.children[n]), r.insertBefore(t, r.children[o]); }(o, ie), i.animateAll(), i !== e && e.animateAll()); }, nulling: function () { ie = null; } }, i(t, { pluginName: "swap", eventProperties: function () { return { swapItem: ie }; } }); } -le.prototype = { startIndex: null, dragStart: function (t) { var e = t.oldDraggableIndex; this.startIndex = e; }, onSpill: function (t) { var e = t.dragEl, n = t.putSortable; this.sortable.captureAnimationState(), n && n.captureAnimationState(); var o = A(this.sortable.el, this.startIndex, this.options); o ? this.sortable.el.insertBefore(e, o) : this.sortable.el.appendChild(e), this.sortable.animateAll(), n && n.animateAll(); }, drop: ae }, i(le, { pluginName: "revertOnSpill" }), se.prototype = { onSpill: function (t) { var e = t.dragEl, n = t.putSortable || this.sortable; n.captureAnimationState(), e.parentNode && e.parentNode.removeChild(e), n.animateAll(); }, drop: ae }, i(se, { pluginName: "removeOnSpill" }); -var ue, de, he, fe, pe, ge = [], ve = [], me = !1, be = !1, ye = !1; -function we() { function t(t) { for (var e in this) - "_" === e.charAt(0) && "function" == typeof this[e] && (this[e] = this[e].bind(this)); t.options.avoidImplicitDeselect || (t.options.supportPointer ? v(document, "pointerup", this._deselectMultiDrag) : (v(document, "mouseup", this._deselectMultiDrag), v(document, "touchend", this._deselectMultiDrag))), v(document, "keydown", this._checkKeyDown), v(document, "keyup", this._checkKeyUp), this.defaults = { selectedClass: "sortable-selected", multiDragKey: null, avoidImplicitDeselect: !1, setData: function (e, n) { var o = ""; ge.length && de === t ? ge.forEach((function (t, e) { o += (e ? ", " : "") + t.textContent; })) : o = n.textContent, e.setData("Text", o); } }; } return t.prototype = { multiDragKeyDown: !1, isMultiDrag: !1, delayStartGlobal: function (t) { var e = t.dragEl; he = e; }, delayEnded: function () { this.isMultiDrag = ~ge.indexOf(he); }, setupClone: function (t) { var e = t.sortable, n = t.cancel; if (this.isMultiDrag) { - for (var o = 0; o < ge.length; o++) - ve.push(B(ge[o])), ve[o].sortableIndex = ge[o].sortableIndex, ve[o].draggable = !1, ve[o].style["will-change"] = "", S(ve[o], this.options.selectedClass, !1), ge[o] === he && S(ve[o], this.options.chosenClass, !1); - e._hideClone(), n(); - } }, clone: function (t) { var e = t.sortable, n = t.rootEl, o = t.dispatchSortableEvent, i = t.cancel; this.isMultiDrag && (this.options.removeCloneOnHide || ge.length && de === e && (De(!0, n), o("clone"), i())); }, showClone: function (t) { var e = t.cloneNowShown, n = t.rootEl, o = t.cancel; this.isMultiDrag && (De(!1, n), ve.forEach((function (t) { _(t, "display", ""); })), e(), pe = !1, o()); }, hideClone: function (t) { var e = this; t.sortable; var n = t.cloneNowHidden, o = t.cancel; this.isMultiDrag && (ve.forEach((function (t) { _(t, "display", "none"), e.options.removeCloneOnHide && t.parentNode && t.parentNode.removeChild(t); })), n(), pe = !0, o()); }, dragStartGlobal: function (t) { t.sortable, !this.isMultiDrag && de && de.multiDrag._deselectMultiDrag(), ge.forEach((function (t) { t.sortableIndex = I(t); })), ge = ge.sort((function (t, e) { return t.sortableIndex - e.sortableIndex; })), ye = !0; }, dragStarted: function (t) { var e = this, n = t.sortable; if (this.isMultiDrag) { - if (this.options.sort && (n.captureAnimationState(), this.options.animation)) { - ge.forEach((function (t) { t !== he && _(t, "position", "absolute"); })); - var o = O(he, !1, !0, !0); - ge.forEach((function (t) { t !== he && F(t, o); })), be = !0, me = !0; - } - n.animateAll((function () { be = !1, me = !1, e.options.animation && ge.forEach((function (t) { j(t); })), e.options.sort && Ee(); })); - } }, dragOver: function (t) { var e = t.target, n = t.completed, o = t.cancel; be && ~ge.indexOf(e) && (n(!1), o()); }, revert: function (t) { var e = t.fromSortable, n = t.rootEl, o = t.sortable, i = t.dragRect; ge.length > 1 && (ge.forEach((function (t) { o.addAnimationState({ target: t, rect: be ? O(t) : i }), j(t), t.fromRect = i, e.removeAnimationState(t); })), be = !1, function (t, e) { ge.forEach((function (n, o) { var i = e.children[n.sortableIndex + (t ? Number(o) : 0)]; i ? e.insertBefore(n, i) : e.appendChild(n); })); }(!this.options.removeCloneOnHide, n)); }, dragOverCompleted: function (t) { var e = t.sortable, n = t.isOwner, o = t.insertion, i = t.activeSortable, r = t.parentEl, a = t.putSortable, l = this.options; if (o) { - if (n && i._hideClone(), me = !1, l.animation && ge.length > 1 && (be || !n && !i.options.sort && !a)) { - var s = O(he, !1, !0, !0); - ge.forEach((function (t) { t !== he && (F(t, s), r.appendChild(t)); })), be = !0; - } - if (!n) - if (be || Ee(), ge.length > 1) { - var c = pe; - i._showClone(e), i.options.animation && !pe && c && ve.forEach((function (t) { i.addAnimationState({ target: t, rect: fe }), t.fromRect = fe, t.thisAnimationDuration = null; })); - } - else - i._showClone(e); - } }, dragOverAnimationCapture: function (t) { var e = t.dragRect, n = t.isOwner, o = t.activeSortable; if (ge.forEach((function (t) { t.thisAnimationDuration = null; })), o.options.animation && !n && o.multiDrag.isMultiDrag) { - fe = i({}, e); - var r = C(he, !0); - fe.top -= r.f, fe.left -= r.e; - } }, dragOverAnimationComplete: function () { be && (be = !1, Ee()); }, drop: function (t) { var e = t.originalEvent, n = t.rootEl, o = t.parentEl, i = t.sortable, r = t.dispatchSortableEvent, a = t.oldIndex, l = t.putSortable, s = l || this.sortable; if (e) { - var c = this.options, u = o.children; - if (!ye) - if (c.multiDragKey && !this.multiDragKeyDown && this._deselectMultiDrag(), S(he, c.selectedClass, !~ge.indexOf(he)), ~ge.indexOf(he)) - ge.splice(ge.indexOf(he), 1), ue = null, U({ sortable: i, rootEl: n, name: "deselect", targetEl: he, originalEvent: e }); - else { - if (ge.push(he), U({ sortable: i, rootEl: n, name: "select", targetEl: he, originalEvent: e }), e.shiftKey && ue && i.el.contains(ue)) { - var d = I(ue), h = I(he); - ~d && ~h && d !== h && function () { var t, r; h > d ? (r = d, t = h) : (r = h, t = d + 1); for (var a = c.filter; r < t; r++) { - if (!~ge.indexOf(u[r])) - if (w(u[r], c.draggable, o, !1)) - a && ("function" == typeof a ? a.call(i, e, u[r], i) : a.split(",").some((function (t) { return w(u[r], t.trim(), o, !1); }))) || (S(u[r], c.selectedClass, !0), ge.push(u[r]), U({ sortable: i, rootEl: n, name: "select", targetEl: u[r], originalEvent: e })); - } }(); - } - else - ue = he; - de = s; - } - if (ye && this.isMultiDrag) { - if (be = !1, (o[L].options.sort || o !== n) && ge.length > 1) { - var f = O(he), p = I(he, ":not(." + this.options.selectedClass + ")"); - if (!me && c.animation && (he.thisAnimationDuration = null), s.captureAnimationState(), !me && (c.animation && (he.fromRect = f, ge.forEach((function (t) { if (t.thisAnimationDuration = null, t !== he) { - var e = be ? O(t) : f; - t.fromRect = e, s.addAnimationState({ target: t, rect: e }); - } }))), Ee(), ge.forEach((function (t) { u[p] ? o.insertBefore(t, u[p]) : o.appendChild(t), p++; })), a === I(he))) { - var g = !1; - ge.forEach((function (t) { t.sortableIndex === I(t) || (g = !0); })), g && (r("update"), r("sort")); - } - ge.forEach((function (t) { j(t); })), s.animateAll(); - } - de = s; - } - (n === o || l && "clone" !== l.lastPutMode) && ve.forEach((function (t) { t.parentNode && t.parentNode.removeChild(t); })); - } }, nullingGlobal: function () { this.isMultiDrag = ye = !1, ve.length = 0; }, destroyGlobal: function () { this._deselectMultiDrag(), m(document, "pointerup", this._deselectMultiDrag), m(document, "mouseup", this._deselectMultiDrag), m(document, "touchend", this._deselectMultiDrag), m(document, "keydown", this._checkKeyDown), m(document, "keyup", this._checkKeyUp); }, _deselectMultiDrag: function (t) { if (!(void 0 !== ye && ye || de !== this.sortable || t && w(t.target, this.options.draggable, this.sortable.el, !1) || t && 0 !== t.button)) - for (; ge.length;) { - var e = ge[0]; - S(e, this.options.selectedClass, !1), ge.shift(), U({ sortable: this.sortable, rootEl: this.sortable.el, name: "deselect", targetEl: e, originalEvent: t }); - } }, _checkKeyDown: function (t) { t.key === this.options.multiDragKey && (this.multiDragKeyDown = !0); }, _checkKeyUp: function (t) { t.key === this.options.multiDragKey && (this.multiDragKeyDown = !1); } }, i(t, { pluginName: "multiDrag", utils: { select: function (t) { var e = t.parentNode[L]; e && e.options.multiDrag && !~ge.indexOf(t) && (de && de !== e && (de.multiDrag._deselectMultiDrag(), de = e), S(t, e.options.selectedClass, !0), ge.push(t)); }, deselect: function (t) { var e = t.parentNode[L], n = ge.indexOf(t); e && e.options.multiDrag && ~n && (S(t, e.options.selectedClass, !1), ge.splice(n, 1)); } }, eventProperties: function () { var t = this, e = [], n = []; return ge.forEach((function (o) { var i; e.push({ multiDragElement: o, index: o.sortableIndex }), i = be && o !== he ? -1 : be ? I(o, ":not(." + t.options.selectedClass + ")") : I(o), n.push({ multiDragElement: o, index: i }); })), { items: a(ge), clones: [].concat(ve), oldIndicies: e, newIndicies: n }; }, optionListeners: { multiDragKey: function (t) { return "ctrl" === (t = t.toLowerCase()) ? t = "Control" : t.length > 1 && (t = t.charAt(0).toUpperCase() + t.substr(1)), t; } } }); } -function De(t, e) { ve.forEach((function (n, o) { var i = e.children[n.sortableIndex + (t ? Number(o) : 0)]; i ? e.insertBefore(n, i) : e.appendChild(n); })); } -function Ee() { ge.forEach((function (t) { t !== he && t.parentNode && t.parentNode.removeChild(t); })); } -Ht.mount(new function () { function t() { for (var t in this.defaults = { scroll: !0, forceAutoScrollFallback: !1, scrollSensitivity: 30, scrollSpeed: 10, bubbleScroll: !0 }, this) - "_" === t.charAt(0) && "function" == typeof this[t] && (this[t] = this[t].bind(this)); } return t.prototype = { dragStarted: function (t) { var e = t.originalEvent; this.sortable.nativeDraggable ? v(document, "dragover", this._handleAutoScroll) : this.options.supportPointer ? v(document, "pointermove", this._handleFallbackAutoScroll) : e.touches ? v(document, "touchmove", this._handleFallbackAutoScroll) : v(document, "mousemove", this._handleFallbackAutoScroll); }, dragOverCompleted: function (t) { var e = t.originalEvent; this.options.dragOverBubble || e.rootEl || this._handleAutoScroll(e); }, drop: function () { this.sortable.nativeDraggable ? m(document, "dragover", this._handleAutoScroll) : (m(document, "pointermove", this._handleFallbackAutoScroll), m(document, "touchmove", this._handleFallbackAutoScroll), m(document, "mousemove", this._handleFallbackAutoScroll)), oe(), ne(), clearTimeout(D), D = void 0; }, nulling: function () { Qt = Vt = qt = ee = Jt = Zt = $t = null, te.length = 0; }, _handleFallbackAutoScroll: function (t) { this._handleAutoScroll(t, !0); }, _handleAutoScroll: function (t, e) { var n = this, o = (t.touches ? t.touches[0] : t).clientX, i = (t.touches ? t.touches[0] : t).clientY, r = document.elementFromPoint(o, i); if (Qt = t, e || this.options.forceAutoScrollFallback || u || c || h) { - re(t, this.options, r, e); - var a = k(r, !0); - !ee || Jt && o === Zt && i === $t || (Jt && oe(), Jt = setInterval((function () { var r = k(document.elementFromPoint(o, i), !0); r !== a && (a = r, ne()), re(t, n.options, r, e); }), 10), Zt = o, $t = i); - } - else { - if (!this.options.bubbleScroll || k(r, !0) === x()) - return void ne(); - re(t, this.options, k(r, !1), !1); - } } }, i(t, { pluginName: "scroll", initializeByDefault: !0 }); }), Ht.mount(se, le); -export { we as MultiDrag, Ht as Sortable, ce as Swap, Ht as default }; -//# sourceMappingURL=/sm/5d7e5cf4455b72a57c7259b1d7c4fa1fdb9f4cd69f516cb0361cb58f3f33668c.map diff --git a/modules/ui-module/src/main/ts/dist/js/manager-globals.d.ts b/modules/ui-module/src/main/ts/dist/js/manager-globals.d.ts new file mode 100644 index 000000000..dfa11d975 --- /dev/null +++ b/modules/ui-module/src/main/ts/dist/js/manager-globals.d.ts @@ -0,0 +1,17 @@ +declare function executeScriptAction(action: any): Promise; +declare function executeHookAction(action: any): Promise; +/** + * Patches a relative path so that it's correctly prefixed with the given manager base path. + * + * @param {string} relativePath e.g. "/manager/module" + * @param {string} managerBasePath e.g. "/manager" or "/de/manager" + * @returns {string} e.g. "/de/manager/module" + */ +declare function patchManagerPath(relativePath: string, managerBasePath: string): string; +/** + * Patches a path with the context path, if not already present. + * + * @param {string} path - The original path (e.g. "/assets/images/test.jpg"). + * @returns {string} - The patched path with context prefix if needed. + */ +declare function patchPathWithContext(path: string): string; diff --git a/modules/ui-module/src/main/ts/dist/js/manager-inject-init.d.ts b/modules/ui-module/src/main/ts/dist/js/manager-inject-init.d.ts new file mode 100644 index 000000000..de2be067b --- /dev/null +++ b/modules/ui-module/src/main/ts/dist/js/manager-inject-init.d.ts @@ -0,0 +1,2 @@ +export function initIframe(): void; +export function isSectionPublishedExpired(section: any): boolean; diff --git a/modules/ui-module/src/main/ts/dist/js/manager-inject.d.ts b/modules/ui-module/src/main/ts/dist/js/manager-inject.d.ts new file mode 100644 index 000000000..e69de29bb diff --git a/modules/ui-module/src/main/ts/dist/js/manager.d.ts b/modules/ui-module/src/main/ts/dist/js/manager.d.ts new file mode 100644 index 000000000..cb0ff5c3b --- /dev/null +++ b/modules/ui-module/src/main/ts/dist/js/manager.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/modules/ui-module/src/main/ts/dist/js/modules/alerts.d.ts b/modules/ui-module/src/main/ts/dist/js/modules/alerts.d.ts new file mode 100644 index 000000000..629a61d8f --- /dev/null +++ b/modules/ui-module/src/main/ts/dist/js/modules/alerts.d.ts @@ -0,0 +1,4 @@ +export function alertSelect(options: any): Promise; +export function alertError(options: any): void; +export function alertConfirm(options: any): Promise; +export function alertPrompt(options: any): Promise; diff --git a/modules/ui-module/src/main/ts/dist/js/modules/event-bus.d.ts b/modules/ui-module/src/main/ts/dist/js/modules/event-bus.d.ts new file mode 100644 index 000000000..d44295919 --- /dev/null +++ b/modules/ui-module/src/main/ts/dist/js/modules/event-bus.d.ts @@ -0,0 +1,4 @@ +export namespace EventBus { + function on(event: any, handler: any): void; + function emit(event: any, payload: any): void; +} diff --git a/modules/ui-module/src/main/ts/dist/js/modules/filebrowser.actions.d.ts b/modules/ui-module/src/main/ts/dist/js/modules/filebrowser.actions.d.ts new file mode 100644 index 000000000..7dc80374c --- /dev/null +++ b/modules/ui-module/src/main/ts/dist/js/modules/filebrowser.actions.d.ts @@ -0,0 +1,24 @@ +export function renameFileAction({ state, getTargetFolder, filename }: { + state: any; + getTargetFolder: any; + filename: any; +}): Promise; +export function deleteElementAction({ elementName, state, deleteFN, getTargetFolder }: { + elementName: any; + state: any; + deleteFN: any; + getTargetFolder: any; +}): Promise; +export function createFolderAction({ state, getTargetFolder }: { + state: any; + getTargetFolder: any; +}): Promise; +export function createFileAction({ state, getTargetFolder }: { + state: any; + getTargetFolder: any; +}): Promise; +export function createPageActionOfContentType({ state, getTargetFolder, contentType }: { + state: any; + getTargetFolder: any; + contentType: any; +}): Promise; diff --git a/modules/ui-module/src/main/ts/dist/js/modules/filebrowser.d.ts b/modules/ui-module/src/main/ts/dist/js/modules/filebrowser.d.ts new file mode 100644 index 000000000..34d9f9cb9 --- /dev/null +++ b/modules/ui-module/src/main/ts/dist/js/modules/filebrowser.d.ts @@ -0,0 +1,5 @@ +export function openFileBrowser(optionsParam: any): Promise; +export namespace state { + let options: any; + let currentFolder: string; +} diff --git a/modules/ui-module/src/main/ts/dist/js/modules/filebrowser.template.d.ts b/modules/ui-module/src/main/ts/dist/js/modules/filebrowser.template.d.ts new file mode 100644 index 000000000..72c47da10 --- /dev/null +++ b/modules/ui-module/src/main/ts/dist/js/modules/filebrowser.template.d.ts @@ -0,0 +1,2 @@ +export { template as filebrowserTemplate }; +declare const template: any; diff --git a/modules/ui-module/src/main/ts/dist/js/modules/filebrowser.template.js b/modules/ui-module/src/main/ts/dist/js/modules/filebrowser.template.js index 33a744356..5370f0482 100644 --- a/modules/ui-module/src/main/ts/dist/js/modules/filebrowser.template.js +++ b/modules/ui-module/src/main/ts/dist/js/modules/filebrowser.template.js @@ -19,7 +19,7 @@ * . * #L% */ -import Handlebars from '@cms/libs/handlebars.min.js'; +import Handlebars from 'https://cdn.jsdelivr.net/npm/handlebars@4.7.8/+esm'; Handlebars.registerHelper("patchPathWithContext", patchPathWithContext); Handlebars.registerHelper('concat', function (...args) { args.pop(); diff --git a/modules/ui-module/src/main/ts/dist/js/modules/filebrowser.upload.d.ts b/modules/ui-module/src/main/ts/dist/js/modules/filebrowser.upload.d.ts new file mode 100644 index 000000000..5b1bd46d8 --- /dev/null +++ b/modules/ui-module/src/main/ts/dist/js/modules/filebrowser.upload.d.ts @@ -0,0 +1,2 @@ +export function initDragAndDropUpload(): void; +export function handleFileUpload(): Promise; diff --git a/modules/ui-module/src/main/ts/dist/js/modules/form/field.checkbox.d.ts b/modules/ui-module/src/main/ts/dist/js/modules/form/field.checkbox.d.ts new file mode 100644 index 000000000..d2a0c9280 --- /dev/null +++ b/modules/ui-module/src/main/ts/dist/js/modules/form/field.checkbox.d.ts @@ -0,0 +1,11 @@ +import { FieldOptions, FormField } from "@cms/modules/form/forms.js"; +export interface CheckboxOptions extends FieldOptions { + key?: string; + options?: { + choices: Array<{ + label: string; + value: string; + }>; + }; +} +export declare const CheckboxField: FormField; diff --git a/modules/ui-module/src/main/ts/dist/js/modules/form/field.code.d.ts b/modules/ui-module/src/main/ts/dist/js/modules/form/field.code.d.ts new file mode 100644 index 000000000..ada1f20f1 --- /dev/null +++ b/modules/ui-module/src/main/ts/dist/js/modules/form/field.code.d.ts @@ -0,0 +1,9 @@ +export namespace CodeField { + export { createCodeField as markup }; + export { init }; + export { getData as data }; +} +declare function createCodeField(options: any, value?: string): string; +declare function init(context: any): void; +declare function getData(context: any): {}; +export {}; diff --git a/modules/ui-module/src/main/ts/dist/js/modules/form/field.color.d.ts b/modules/ui-module/src/main/ts/dist/js/modules/form/field.color.d.ts new file mode 100644 index 000000000..cab0d2e87 --- /dev/null +++ b/modules/ui-module/src/main/ts/dist/js/modules/form/field.color.d.ts @@ -0,0 +1,4 @@ +import { FieldOptions, FormField } from "@cms/modules/form/forms.js"; +export interface ColorFieldOptions extends FieldOptions { +} +export declare const ColorField: FormField; diff --git a/modules/ui-module/src/main/ts/dist/js/modules/form/field.date.d.ts b/modules/ui-module/src/main/ts/dist/js/modules/form/field.date.d.ts new file mode 100644 index 000000000..f07e3cc6e --- /dev/null +++ b/modules/ui-module/src/main/ts/dist/js/modules/form/field.date.d.ts @@ -0,0 +1,5 @@ +import { FieldOptions, FormField } from "@cms/modules/form/forms.js"; +export interface DateFieldOptions extends FieldOptions { + placeholder?: string; +} +export declare const DateField: FormField; diff --git a/modules/ui-module/src/main/ts/dist/js/modules/form/field.datetime.d.ts b/modules/ui-module/src/main/ts/dist/js/modules/form/field.datetime.d.ts new file mode 100644 index 000000000..272202696 --- /dev/null +++ b/modules/ui-module/src/main/ts/dist/js/modules/form/field.datetime.d.ts @@ -0,0 +1,5 @@ +import { FieldOptions, FormField } from "@cms/modules/form/forms.js"; +export interface DateTimeFieldOptions extends FieldOptions { + placeholder?: string; +} +export declare const DateTimeField: FormField; diff --git a/modules/ui-module/src/main/ts/dist/js/modules/form/field.divider.d.ts b/modules/ui-module/src/main/ts/dist/js/modules/form/field.divider.d.ts new file mode 100644 index 000000000..f57944c90 --- /dev/null +++ b/modules/ui-module/src/main/ts/dist/js/modules/form/field.divider.d.ts @@ -0,0 +1,4 @@ +import { FieldOptions, FormField } from "@cms/modules/form/forms.js"; +export interface DividerOptions extends FieldOptions { +} +export declare const Divider: FormField; diff --git a/modules/ui-module/src/main/ts/dist/js/modules/form/field.easymde.d.ts b/modules/ui-module/src/main/ts/dist/js/modules/form/field.easymde.d.ts new file mode 100644 index 000000000..9ac807575 --- /dev/null +++ b/modules/ui-module/src/main/ts/dist/js/modules/form/field.easymde.d.ts @@ -0,0 +1,4 @@ +import { FieldOptions, FormField } from "@cms/modules/form/forms.js"; +export interface EasyMDEFieldOptions extends FieldOptions { +} +export declare const EasyMDEField: FormField; diff --git a/modules/ui-module/src/main/ts/dist/js/modules/form/field.list.d.ts b/modules/ui-module/src/main/ts/dist/js/modules/form/field.list.d.ts new file mode 100644 index 000000000..7bfcc69a9 --- /dev/null +++ b/modules/ui-module/src/main/ts/dist/js/modules/form/field.list.d.ts @@ -0,0 +1,7 @@ +import { FieldOptions, FormField } from "@cms/modules/form/forms.js"; +export interface ListFieldOptions extends FieldOptions { + options: { + nameField?: string; + }; +} +export declare const ListField: FormField; diff --git a/modules/ui-module/src/main/ts/dist/js/modules/form/field.mail.d.ts b/modules/ui-module/src/main/ts/dist/js/modules/form/field.mail.d.ts new file mode 100644 index 000000000..36f178178 --- /dev/null +++ b/modules/ui-module/src/main/ts/dist/js/modules/form/field.mail.d.ts @@ -0,0 +1,5 @@ +import { FieldOptions, FormField } from "@cms/modules/form/forms.js"; +export interface MailFieldOptions extends FieldOptions { + placeholder?: string; +} +export declare const MailField: FormField; diff --git a/modules/ui-module/src/main/ts/dist/js/modules/form/field.markdown.d.ts b/modules/ui-module/src/main/ts/dist/js/modules/form/field.markdown.d.ts new file mode 100644 index 000000000..d654ccd81 --- /dev/null +++ b/modules/ui-module/src/main/ts/dist/js/modules/form/field.markdown.d.ts @@ -0,0 +1,6 @@ +import { FieldOptions, FormField } from "@cms/modules/form/forms.js"; +export interface MarkdownFieldOptions extends FieldOptions { + placeholder?: string; + height?: string; +} +export declare const MarkdownField: FormField; diff --git a/modules/ui-module/src/main/ts/dist/js/modules/form/field.media.d.ts b/modules/ui-module/src/main/ts/dist/js/modules/form/field.media.d.ts new file mode 100644 index 000000000..b359b73f0 --- /dev/null +++ b/modules/ui-module/src/main/ts/dist/js/modules/form/field.media.d.ts @@ -0,0 +1,4 @@ +import { FieldOptions, FormField } from "@cms/modules/form/forms.js"; +export interface MediaFieldOptions extends FieldOptions { +} +export declare const MediaField: FormField; diff --git a/modules/ui-module/src/main/ts/dist/js/modules/form/field.number.d.ts b/modules/ui-module/src/main/ts/dist/js/modules/form/field.number.d.ts new file mode 100644 index 000000000..c034ebbc7 --- /dev/null +++ b/modules/ui-module/src/main/ts/dist/js/modules/form/field.number.d.ts @@ -0,0 +1,10 @@ +import { FieldOptions, FormField } from "@cms/modules/form/forms.js"; +export interface NumberFieldOptions extends FieldOptions { + options: { + min?: number; + max?: number; + step?: number; + }; + placeholder?: string; +} +export declare const NumberField: FormField; diff --git a/modules/ui-module/src/main/ts/dist/js/modules/form/field.radio.d.ts b/modules/ui-module/src/main/ts/dist/js/modules/form/field.radio.d.ts new file mode 100644 index 000000000..a238a4826 --- /dev/null +++ b/modules/ui-module/src/main/ts/dist/js/modules/form/field.radio.d.ts @@ -0,0 +1,10 @@ +import { FieldOptions, FormField } from "@cms/modules/form/forms.js"; +export interface RadioFieldOptions extends FieldOptions { + options?: { + choices: Array<{ + label: string; + value: string; + }>; + }; +} +export declare const RadioField: FormField; diff --git a/modules/ui-module/src/main/ts/dist/js/modules/form/field.range.d.ts b/modules/ui-module/src/main/ts/dist/js/modules/form/field.range.d.ts new file mode 100644 index 000000000..47e6c847c --- /dev/null +++ b/modules/ui-module/src/main/ts/dist/js/modules/form/field.range.d.ts @@ -0,0 +1,9 @@ +import { FieldOptions, FormField } from "@cms/modules/form/forms.js"; +export interface RangeFieldOptions extends FieldOptions { + options?: { + min?: number; + max?: number; + step?: number; + }; +} +export declare const RangeField: FormField; diff --git a/modules/ui-module/src/main/ts/dist/js/modules/form/field.reference.d.ts b/modules/ui-module/src/main/ts/dist/js/modules/form/field.reference.d.ts new file mode 100644 index 000000000..7f1b0b8c4 --- /dev/null +++ b/modules/ui-module/src/main/ts/dist/js/modules/form/field.reference.d.ts @@ -0,0 +1,7 @@ +import { FieldOptions, FormField } from "@cms/modules/form/forms.js"; +export interface ReferenceFieldOptions extends FieldOptions { + options?: { + siteid?: string; + }; +} +export declare const ReferenceField: FormField; diff --git a/modules/ui-module/src/main/ts/dist/js/modules/form/field.select.d.ts b/modules/ui-module/src/main/ts/dist/js/modules/form/field.select.d.ts new file mode 100644 index 000000000..c781deccb --- /dev/null +++ b/modules/ui-module/src/main/ts/dist/js/modules/form/field.select.d.ts @@ -0,0 +1,10 @@ +import { FieldOptions, FormField } from "@cms/modules/form/forms.js"; +export interface SelectFieldOptions extends FieldOptions { + options?: { + choices?: Array; + }; +} +export declare const SelectField: FormField; diff --git a/modules/ui-module/src/main/ts/dist/js/modules/form/field.text.d.ts b/modules/ui-module/src/main/ts/dist/js/modules/form/field.text.d.ts new file mode 100644 index 000000000..b406c7cf8 --- /dev/null +++ b/modules/ui-module/src/main/ts/dist/js/modules/form/field.text.d.ts @@ -0,0 +1,5 @@ +import { FieldOptions, FormField } from "@cms/modules/form/forms.js"; +export interface TextFieldOptions extends FieldOptions { + placeholder?: string; +} +export declare const TextField: FormField; diff --git a/modules/ui-module/src/main/ts/dist/js/modules/form/field.textarea.d.ts b/modules/ui-module/src/main/ts/dist/js/modules/form/field.textarea.d.ts new file mode 100644 index 000000000..f83d21361 --- /dev/null +++ b/modules/ui-module/src/main/ts/dist/js/modules/form/field.textarea.d.ts @@ -0,0 +1,5 @@ +import { FieldOptions, FormField } from "@cms/modules/form/forms.js"; +export interface TextAreaFieldOptions extends FieldOptions { + rows?: number; +} +export declare const TextAreaField: FormField; diff --git a/modules/ui-module/src/main/ts/dist/js/modules/form/forms.d.ts b/modules/ui-module/src/main/ts/dist/js/modules/form/forms.d.ts new file mode 100644 index 000000000..a20eefd41 --- /dev/null +++ b/modules/ui-module/src/main/ts/dist/js/modules/form/forms.d.ts @@ -0,0 +1,20 @@ +declare const createForm: (options: any) => Form; +export { createForm }; +export interface FormContext { + formElement: HTMLFormElement | null; + fields: any[]; +} +export interface Form { + init: (container: Element | string) => void; + getData: () => any; + getRawData: () => any; +} +export interface FormField { + markup: (options: FieldOptions, value?: any) => string; + init: (context: FormContext) => void; + data: (context: FormContext) => any; +} +export interface FieldOptions { + name?: string; + title?: string; +} diff --git a/modules/ui-module/src/main/ts/dist/js/modules/form/utils.d.ts b/modules/ui-module/src/main/ts/dist/js/modules/form/utils.d.ts new file mode 100644 index 000000000..79c944de7 --- /dev/null +++ b/modules/ui-module/src/main/ts/dist/js/modules/form/utils.d.ts @@ -0,0 +1,6 @@ +declare const createID: () => string; +declare const utcToLocalDateTimeInputValue: (utcString: string) => string; +declare function getUTCDateTimeFromInput(inputElement: HTMLInputElement): string; +declare function utcToLocalDateInputValue(utcString: string): string; +declare function getUTCDateFromInput(inputElement: HTMLInputElement): string; +export { createID, utcToLocalDateTimeInputValue, getUTCDateTimeFromInput, utcToLocalDateInputValue, getUTCDateFromInput }; diff --git a/modules/ui-module/src/main/ts/dist/js/modules/frameMessenger.d.ts b/modules/ui-module/src/main/ts/dist/js/modules/frameMessenger.d.ts new file mode 100644 index 000000000..1d74a5193 --- /dev/null +++ b/modules/ui-module/src/main/ts/dist/js/modules/frameMessenger.d.ts @@ -0,0 +1,9 @@ +declare namespace _default { + export { send }; + export { on }; + export { off }; +} +export default _default; +declare function send(targetWindow: any, message: any, targetOrigin?: string): void; +declare function on(type: any, callback: any): void; +declare function off(type: any, callback: any): void; diff --git a/modules/ui-module/src/main/ts/dist/js/modules/locale-utils.d.ts b/modules/ui-module/src/main/ts/dist/js/modules/locale-utils.d.ts new file mode 100644 index 000000000..98374290b --- /dev/null +++ b/modules/ui-module/src/main/ts/dist/js/modules/locale-utils.d.ts @@ -0,0 +1,2 @@ +export function getLocale(): any; +export function setLocale(locale: any): void; diff --git a/modules/ui-module/src/main/ts/dist/js/modules/localization-actions.d.ts b/modules/ui-module/src/main/ts/dist/js/modules/localization-actions.d.ts new file mode 100644 index 000000000..43acad38a --- /dev/null +++ b/modules/ui-module/src/main/ts/dist/js/modules/localization-actions.d.ts @@ -0,0 +1,13 @@ +export namespace ACTION_LOCALIZATIONS { + let en: {}; + let de: { + "addsection.input.name": string; + "addsection.select.": string; + "addsection.titles.modal": string; + "addsection.titles.alert": string; + "addsection.alerts.success.message": string; + "addsection.alerts.error.message": string; + "addsection.alerts.notemplate.message": string; + "addsection.alerts.nameexists.message": string; + }; +} diff --git a/modules/ui-module/src/main/ts/dist/js/modules/localization-loader.d.ts b/modules/ui-module/src/main/ts/dist/js/modules/localization-loader.d.ts new file mode 100644 index 000000000..ea5b0a075 --- /dev/null +++ b/modules/ui-module/src/main/ts/dist/js/modules/localization-loader.d.ts @@ -0,0 +1,24 @@ +export function loadLocalizationsWithDefaults(): Promise<{ + en: { + "ui.filebrowser.filename": string; + "ui.filebrowser.title": string; + "menu.settings": string; + "menu.settings.logout": string; + "language.en": string; + "language.de": string; + "buttons.ok": string; + "buttons.cancle": string; + "menu.page.settings": string; + }; + de: { + "ui.filebrowser.filename": string; + "ui.filebrowser.title": string; + "menu.settings": string; + "menu.settings.logout": string; + "language.en": string; + "language.de": string; + "buttons.ok": string; + "buttons.cancle": string; + "menu.page.settings": string; + }; +}>; diff --git a/modules/ui-module/src/main/ts/dist/js/modules/localization-modules.d.ts b/modules/ui-module/src/main/ts/dist/js/modules/localization-modules.d.ts new file mode 100644 index 000000000..63d585fc5 --- /dev/null +++ b/modules/ui-module/src/main/ts/dist/js/modules/localization-modules.d.ts @@ -0,0 +1,16 @@ +export namespace MODULE_LOCALIZATIONS { + let en: {}; + let de: { + "alerts.select.title": string; + "alerts.select.placeholder": string; + "alerts.error.title": string; + "alerts.error.message": string; + "alerts.confirm.title": string; + "alerts.confirm.message": string; + "alerts.confirm.button.ok": string; + "alerts.confirm.button.cancel": string; + "alerts.prompt.title": string; + "alerts.prompt.lable": string; + "alerts.prompt.placeholder": string; + }; +} diff --git a/modules/ui-module/src/main/ts/dist/js/modules/localization.d.ts b/modules/ui-module/src/main/ts/dist/js/modules/localization.d.ts new file mode 100644 index 000000000..0b22efabb --- /dev/null +++ b/modules/ui-module/src/main/ts/dist/js/modules/localization.d.ts @@ -0,0 +1,32 @@ +export function localizeUi(): Promise; +export namespace i18n { + let _locale: any; + let _cache: any; + /** + * Loads and merges remote localizations with defaults. + */ + function init(): Promise; + /** + * Get current locale. + */ + function getLocale(): any; + /** + * Change the active locale and update cookie. + * @param {string} locale + */ + function setLocale(locale: string): void; + /** + * Returns the translation synchronously after init. + * @param {string} key + * @param {string} [defaultValue] + * @returns {string} + */ + function t(key: string, defaultValue?: string): string; + /** + * Returns the translation asynchronously (no need to call init beforehand). + * @param {string} key + * @param {string} [defaultValue] + * @returns {Promise} + */ + function tAsync(key: string, defaultValue?: string): Promise; +} diff --git a/modules/ui-module/src/main/ts/dist/js/modules/manager-ui.d.ts b/modules/ui-module/src/main/ts/dist/js/modules/manager-ui.d.ts new file mode 100644 index 000000000..3a4ec4800 --- /dev/null +++ b/modules/ui-module/src/main/ts/dist/js/modules/manager-ui.d.ts @@ -0,0 +1,2 @@ +export function updateStateButton(): void; +export function isPagePublishedExpired(contentResponse: any): boolean; diff --git a/modules/ui-module/src/main/ts/dist/js/modules/manager/manager.message.handlers.d.ts b/modules/ui-module/src/main/ts/dist/js/modules/manager/manager.message.handlers.d.ts new file mode 100644 index 000000000..dd88b9fe0 --- /dev/null +++ b/modules/ui-module/src/main/ts/dist/js/modules/manager/manager.message.handlers.d.ts @@ -0,0 +1,2 @@ +declare const initMessageHandlers: () => void; +export { initMessageHandlers }; diff --git a/modules/ui-module/src/main/ts/dist/js/modules/manager/media.inject.d.ts b/modules/ui-module/src/main/ts/dist/js/modules/manager/media.inject.d.ts new file mode 100644 index 000000000..ebd61d27b --- /dev/null +++ b/modules/ui-module/src/main/ts/dist/js/modules/manager/media.inject.d.ts @@ -0,0 +1,4 @@ +export declare const initMediaUploadOverlay: (img: HTMLImageElement) => void; +export declare const initContentMediaToolbar: (img: HTMLImageElement) => void; +export declare const initMediaToolbar: (img: HTMLImageElement) => void; +export declare const initToolbar: (img: HTMLImageElement, toolbarDefinition: any) => void; diff --git a/modules/ui-module/src/main/ts/dist/js/modules/manager/toolbar-icons.d.ts b/modules/ui-module/src/main/ts/dist/js/modules/manager/toolbar-icons.d.ts new file mode 100644 index 000000000..37904af59 --- /dev/null +++ b/modules/ui-module/src/main/ts/dist/js/modules/manager/toolbar-icons.d.ts @@ -0,0 +1,9 @@ +export declare const EDIT_PAGE_ICON = "\n\n \n \n"; +export declare const EDIT_ATTRIBUTES_ICON = "\n\n \n\n"; +export declare const SECTION_SORT_ICON = "\n\n \n \n\n"; +export declare const SECTION_ADD_ICON = "\n\n \n\n"; +export declare const SECTION_DELETE_ICON = "\n\n \n \n\n"; +export declare const IMAGE_ICON = "\n\n \n \n\n"; +export declare const SECTION_PUBLISHED_ICON = "\n\n \n \n\n"; +export declare const SECTION_UNPUBLISHED_ICON = "\n\n \n \n\n"; +export declare const MEDIA_CROP_ICON = "\n\n \n\n"; diff --git a/modules/ui-module/src/main/ts/dist/js/modules/manager/toolbar.inject.d.ts b/modules/ui-module/src/main/ts/dist/js/modules/manager/toolbar.inject.d.ts new file mode 100644 index 000000000..6e3a61bf4 --- /dev/null +++ b/modules/ui-module/src/main/ts/dist/js/modules/manager/toolbar.inject.d.ts @@ -0,0 +1 @@ +export declare const initToolbar: (container: HTMLElement) => void; diff --git a/modules/ui-module/src/main/ts/dist/js/modules/modal.d.ts b/modules/ui-module/src/main/ts/dist/js/modules/modal.d.ts new file mode 100644 index 000000000..a6bc8574c --- /dev/null +++ b/modules/ui-module/src/main/ts/dist/js/modules/modal.d.ts @@ -0,0 +1 @@ +export function openModal(optionsParam: any): any; diff --git a/modules/ui-module/src/main/ts/dist/js/modules/node.d.ts b/modules/ui-module/src/main/ts/dist/js/modules/node.d.ts new file mode 100644 index 000000000..ade17f827 --- /dev/null +++ b/modules/ui-module/src/main/ts/dist/js/modules/node.d.ts @@ -0,0 +1,14 @@ +/** + * Retrieves a nested value from an object using a dot-notated path like "meta.title" + * @param {object} sourceObj - The object to retrieve the value from + * @param {string} path - Dot-notated string path, e.g., "meta.title" + * @returns {*} - The value found at the given path, or undefined if not found + */ +export function getValueByPath(sourceObj: object, path: string): any; +/** + * Builds a values object from an array of form fields + * @param {Array} fields - Array of form field objects, each with a .name property + * @param {object} sourceObj - The source object to extract the values from + * @returns {object} values - An object mapping field names to their corresponding values + */ +export function buildValuesFromFields(fields: any[], sourceObj: object): object; diff --git a/modules/ui-module/src/main/ts/dist/js/modules/preview.history.d.ts b/modules/ui-module/src/main/ts/dist/js/modules/preview.history.d.ts new file mode 100644 index 000000000..02a1aa102 --- /dev/null +++ b/modules/ui-module/src/main/ts/dist/js/modules/preview.history.d.ts @@ -0,0 +1,7 @@ +export namespace PreviewHistory { + export { init }; + export { navigatePreview }; +} +declare function init(defaultUrl?: any): void; +declare function navigatePreview(url: any, usePush?: boolean): void; +export {}; diff --git a/modules/ui-module/src/main/ts/dist/js/modules/preview.utils.d.ts b/modules/ui-module/src/main/ts/dist/js/modules/preview.utils.d.ts new file mode 100644 index 000000000..f2f167f34 --- /dev/null +++ b/modules/ui-module/src/main/ts/dist/js/modules/preview.utils.d.ts @@ -0,0 +1,6 @@ +export function activatePreviewOverlay(): void; +export function deActivatePreviewOverlay(): void; +export function getPreviewUrl(): any; +export function reloadPreview(): void; +export function loadPreview(url: any): void; +export function getPreviewFrame(): HTMLElement; diff --git a/modules/ui-module/src/main/ts/dist/js/modules/rpc/rpc-content.d.ts b/modules/ui-module/src/main/ts/dist/js/modules/rpc/rpc-content.d.ts new file mode 100644 index 000000000..f33f4ad96 --- /dev/null +++ b/modules/ui-module/src/main/ts/dist/js/modules/rpc/rpc-content.d.ts @@ -0,0 +1,8 @@ +declare const getContentNode: (options: any) => Promise; +declare const getContent: (options: any) => Promise; +declare const setContent: (options: any) => Promise; +declare const setMeta: (options: any) => Promise; +declare const setMetaBatch: (options: any) => Promise; +declare const addSection: (options: any) => Promise; +declare const deleteSection: (options: any) => Promise; +export { getContentNode, getContent, setContent, setMeta, setMetaBatch, addSection, deleteSection }; diff --git a/modules/ui-module/src/main/ts/dist/js/modules/rpc/rpc-files.d.ts b/modules/ui-module/src/main/ts/dist/js/modules/rpc/rpc-files.d.ts new file mode 100644 index 000000000..d468fc607 --- /dev/null +++ b/modules/ui-module/src/main/ts/dist/js/modules/rpc/rpc-files.d.ts @@ -0,0 +1,7 @@ +declare const listFiles: (options: any) => Promise; +declare const deleteFile: (options: any, any: any) => Promise; +declare const deleteFolder: (options: any) => Promise; +declare const createFolder: (options: any) => Promise; +declare const createFile: (options: any) => Promise; +declare const renameFile: (options: any) => Promise; +export { listFiles, deleteFile, createFolder, createFile, deleteFolder, renameFile }; diff --git a/modules/ui-module/src/main/ts/dist/js/modules/rpc/rpc-i18n.d.ts b/modules/ui-module/src/main/ts/dist/js/modules/rpc/rpc-i18n.d.ts new file mode 100644 index 000000000..97184c7b3 --- /dev/null +++ b/modules/ui-module/src/main/ts/dist/js/modules/rpc/rpc-i18n.d.ts @@ -0,0 +1,2 @@ +declare const loadLocalizations: (options: any) => Promise; +export { loadLocalizations }; diff --git a/modules/ui-module/src/main/ts/dist/js/modules/rpc/rpc-manager.d.ts b/modules/ui-module/src/main/ts/dist/js/modules/rpc/rpc-manager.d.ts new file mode 100644 index 000000000..0fb0b33dd --- /dev/null +++ b/modules/ui-module/src/main/ts/dist/js/modules/rpc/rpc-manager.d.ts @@ -0,0 +1,23 @@ +declare const getSectionTemplates: (options: any) => Promise; +declare const getPageTemplates: (options: any) => Promise; +declare const getListItemTypes: (options: any) => Promise; +declare const getMediaForm: (options: any) => Promise; +export declare enum Format { + WEBP = 0, + JPEG = 1, + PNG = 2 +} +export interface MediaFormat { + name: string; + height?: number; + width?: number; + format: Format; + compression: boolean; + cropped: boolean; +} +export interface MediaFormatsResponse { + result: MediaFormat[]; +} +declare const getMediaFormats: (options: any) => Promise; +declare const getTagNames: (options: any) => Promise; +export { getSectionTemplates, getPageTemplates, getMediaForm, getTagNames, getMediaFormats, getListItemTypes }; diff --git a/modules/ui-module/src/main/ts/dist/js/modules/rpc/rpc-media.d.ts b/modules/ui-module/src/main/ts/dist/js/modules/rpc/rpc-media.d.ts new file mode 100644 index 000000000..e2f3eb480 --- /dev/null +++ b/modules/ui-module/src/main/ts/dist/js/modules/rpc/rpc-media.d.ts @@ -0,0 +1,3 @@ +declare const getMediaMetaData: (options: any) => Promise; +declare const setMediaMetaData: (options: any) => Promise; +export { getMediaMetaData, setMediaMetaData }; diff --git a/modules/ui-module/src/main/ts/dist/js/modules/rpc/rpc-page.d.ts b/modules/ui-module/src/main/ts/dist/js/modules/rpc/rpc-page.d.ts new file mode 100644 index 000000000..d161fc42d --- /dev/null +++ b/modules/ui-module/src/main/ts/dist/js/modules/rpc/rpc-page.d.ts @@ -0,0 +1,8 @@ +export interface PageCreateOptions { + uri: string; + name: string; + contentType: string; +} +declare const createPage: (options: PageCreateOptions) => Promise; +declare const deletePage: (options: any) => Promise; +export { createPage, deletePage }; diff --git a/modules/ui-module/src/main/ts/dist/js/modules/rpc/rpc-translation.d.ts b/modules/ui-module/src/main/ts/dist/js/modules/rpc/rpc-translation.d.ts new file mode 100644 index 000000000..0f2b8e64a --- /dev/null +++ b/modules/ui-module/src/main/ts/dist/js/modules/rpc/rpc-translation.d.ts @@ -0,0 +1,33 @@ +export interface GetTranslationsOptions { + uri: string; +} +export interface TranslationDto { + site: string; + lang: string; + country: string; + url?: string; + managerDeepLink?: string; +} +declare const getTranslations: (options: GetTranslationsOptions) => Promise<{ + translations: TranslationDto[]; +}>; +export interface AddTranslationOptions { + uri: string; + language: string; + translationUri: string; +} +export interface AddTranslationResult { + uri: string; + error?: boolean; +} +declare const addTranslation: (options: AddTranslationOptions) => Promise; +export interface RemoveTranslationOptions { + uri: string; + lang: string; +} +export interface RemoveTranslationResult { + uri: string; + error?: boolean; +} +declare const removeTranslation: (options: RemoveTranslationOptions) => Promise; +export { getTranslations, addTranslation, removeTranslation }; diff --git a/modules/ui-module/src/main/ts/dist/js/modules/rpc/rpc.d.ts b/modules/ui-module/src/main/ts/dist/js/modules/rpc/rpc.d.ts new file mode 100644 index 000000000..285cce376 --- /dev/null +++ b/modules/ui-module/src/main/ts/dist/js/modules/rpc/rpc.d.ts @@ -0,0 +1,7 @@ +interface Options { + method: string; + parameters?: any; +} +declare const executeRemoteCall: (options: Options) => Promise; +declare const executeRemoteMethodCall: (method: string, parameters: any) => Promise; +export { executeRemoteCall, executeRemoteMethodCall }; diff --git a/modules/ui-module/src/main/ts/dist/js/modules/sidebar.d.ts b/modules/ui-module/src/main/ts/dist/js/modules/sidebar.d.ts new file mode 100644 index 000000000..268aae235 --- /dev/null +++ b/modules/ui-module/src/main/ts/dist/js/modules/sidebar.d.ts @@ -0,0 +1 @@ +export function openSidebar(options: any): void; diff --git a/modules/ui-module/src/main/ts/dist/js/modules/state.d.ts b/modules/ui-module/src/main/ts/dist/js/modules/state.d.ts new file mode 100644 index 000000000..7d224a238 --- /dev/null +++ b/modules/ui-module/src/main/ts/dist/js/modules/state.d.ts @@ -0,0 +1,7 @@ +declare class State { + constructor(initialState?: {}); + state: {}; + observers: any[]; + observe(observer: any): void; + unobserve(observer: any): void; +} diff --git a/modules/ui-module/src/main/ts/dist/js/modules/toast.d.ts b/modules/ui-module/src/main/ts/dist/js/modules/toast.d.ts new file mode 100644 index 000000000..0fcd8a129 --- /dev/null +++ b/modules/ui-module/src/main/ts/dist/js/modules/toast.d.ts @@ -0,0 +1 @@ +export function showToast(options: any): void; diff --git a/modules/ui-module/src/main/ts/dist/js/modules/ui-state.d.ts b/modules/ui-module/src/main/ts/dist/js/modules/ui-state.d.ts new file mode 100644 index 000000000..cf3faa9ae --- /dev/null +++ b/modules/ui-module/src/main/ts/dist/js/modules/ui-state.d.ts @@ -0,0 +1,10 @@ +export namespace UIStateManager { + function setTabState(key: any, value: any): void; + function getTabState(key: any, defaultValue?: any): any; + function setLocale(locale: any): void; + function getLocale(): any; + function removeTabState(key: any): void; + function setAuthToken(token: any): void; + function getAuthToken(): string; + function clearAuthToken(): void; +} diff --git a/modules/ui-module/src/main/ts/dist/js/modules/upload.d.ts b/modules/ui-module/src/main/ts/dist/js/modules/upload.d.ts new file mode 100644 index 000000000..760c8f380 --- /dev/null +++ b/modules/ui-module/src/main/ts/dist/js/modules/upload.d.ts @@ -0,0 +1,8 @@ +export function uploadFileWithProgress({ uploadEndpoint, file, uri, onProgress, onSuccess, onError }: { + uploadEndpoint: any; + file: any; + uri: any; + onProgress: any; + onSuccess: any; + onError: any; +}): void; diff --git a/modules/ui-module/src/main/ts/dist/js/ui-actions.d.ts b/modules/ui-module/src/main/ts/dist/js/ui-actions.d.ts new file mode 100644 index 000000000..cb0ff5c3b --- /dev/null +++ b/modules/ui-module/src/main/ts/dist/js/ui-actions.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/modules/ui-module/src/main/ts/dist/public/manager-login.d.ts b/modules/ui-module/src/main/ts/dist/public/manager-login.d.ts new file mode 100644 index 000000000..5b5817d8a --- /dev/null +++ b/modules/ui-module/src/main/ts/dist/public/manager-login.d.ts @@ -0,0 +1,8 @@ +declare const ui: { + state: string; +}; +declare const setWarningMessage: (message: string) => void; +declare const clearMessage: () => void; +declare const signIn: (e: Event) => void; +declare const validate: (e: Event) => void; +declare const formSubmit: (e: Event) => void; diff --git a/modules/ui-module/src/main/ts/package.json b/modules/ui-module/src/main/ts/package.json new file mode 100644 index 000000000..4d6e1c306 --- /dev/null +++ b/modules/ui-module/src/main/ts/package.json @@ -0,0 +1,8 @@ +{ + "name": "condation-cms-ui", + "author": "CondationCMS", + "version": "0.2.0", + "dependencies": { + "typescript": "next" + } +} \ No newline at end of file diff --git a/modules/ui-module/src/main/ts/src/actions/media/edit-focal-point.ts b/modules/ui-module/src/main/ts/src/actions/media/edit-focal-point.ts index 683c20966..04bc381f6 100644 --- a/modules/ui-module/src/main/ts/src/actions/media/edit-focal-point.ts +++ b/modules/ui-module/src/main/ts/src/actions/media/edit-focal-point.ts @@ -20,11 +20,11 @@ * #L% */ -import { i18n } from "../../js/modules/localization.js"; -import { openModal } from "../../js/modules/modal.js"; -import { reloadPreview } from "../../js/modules/preview.utils.js"; -import { getMediaMetaData, setMediaMetaData } from "../../js/modules/rpc/rpc-media.js"; -import { showToast } from "../../js/modules/toast.js"; +import { i18n } from "@cms/modules/localization.js"; +import { openModal } from "@cms/modules/modal.js"; +import { reloadPreview } from "@cms/modules/preview.utils.js"; +import { getMediaMetaData, setMediaMetaData } from "@cms/modules/rpc/rpc-media.js"; +import { showToast } from "@cms/modules/toast.js"; export async function runAction(params) { diff --git a/modules/ui-module/src/main/ts/src/actions/media/edit-media-form.js b/modules/ui-module/src/main/ts/src/actions/media/edit-media-form.js index a35b91fc7..5eb0afd77 100644 --- a/modules/ui-module/src/main/ts/src/actions/media/edit-media-form.js +++ b/modules/ui-module/src/main/ts/src/actions/media/edit-media-form.js @@ -19,14 +19,14 @@ * . * #L% */ -import { openSidebar } from '../../js/modules/sidebar.js' -import { createForm } from '../../js/modules/form/forms.js' -import { showToast } from '../../js/modules/toast.js' -import { setMeta } from '../../js/modules/rpc/rpc-content.js' -import { reloadPreview } from '../../js/modules/preview.utils.js' -import { i18n } from '../../js/modules/localization.js' -import { getMediaForm } from '../../js/modules/rpc/rpc-manager.js' -import { getMediaMetaData, setMediaMetaData } from '../../js/modules/rpc/rpc-media.js' +import { openSidebar } from '@cms/modules/sidebar.js' +import { createForm } from '@cms/modules/form/forms.js' +import { showToast } from '@cms/modules/toast.js' +import { setMeta } from '@cms/modules/rpc/rpc-content.js' +import { reloadPreview } from '@cms/modules/preview.utils.js' +import { i18n } from '@cms/modules/localization.js' +import { getMediaForm } from '@cms/modules/rpc/rpc-manager.js' +import { getMediaMetaData, setMediaMetaData } from '@cms/modules/rpc/rpc-media.js' export async function runAction(params) { diff --git a/modules/ui-module/src/main/ts/src/actions/media/select-media.ts b/modules/ui-module/src/main/ts/src/actions/media/select-media.ts index 78ad3b912..46cdad3eb 100644 --- a/modules/ui-module/src/main/ts/src/actions/media/select-media.ts +++ b/modules/ui-module/src/main/ts/src/actions/media/select-media.ts @@ -20,11 +20,11 @@ * #L% */ -import { openFileBrowser } from "../../js/modules/filebrowser.js"; -import { i18n } from "../../js/modules/localization.js"; -import { getPreviewUrl, reloadPreview } from "../../js/modules/preview.utils.js"; -import { getContentNode, setMeta } from "../../js/modules/rpc/rpc-content.js"; -import { showToast } from "../../js/modules/toast.js"; +import { openFileBrowser } from "@cms/modules/filebrowser.js"; +import { i18n } from "@cms/modules/localization.js"; +import { getPreviewUrl, reloadPreview } from "@cms/modules/preview.utils.js"; +import { getContentNode, setMeta } from "@cms/modules/rpc/rpc-content.js"; +import { showToast } from "@cms/modules/toast.js"; export async function runAction(params) { diff --git a/modules/ui-module/src/main/ts/src/actions/page/add-section.js b/modules/ui-module/src/main/ts/src/actions/page/add-section.js index bc9275898..c83b7756d 100644 --- a/modules/ui-module/src/main/ts/src/actions/page/add-section.js +++ b/modules/ui-module/src/main/ts/src/actions/page/add-section.js @@ -19,13 +19,13 @@ * . * #L% */ -import { openModal } from '../../js/modules/modal.js' -import { showToast } from '../../js/modules/toast.js' -import { addSection, getContentNode } from '../../js/modules/rpc/rpc-content.js' -import { getPreviewUrl, reloadPreview } from '../../js/modules/preview.utils.js' -import Handlebars from '../../js/libs/handlebars.min.js'; -import { i18n } from '../../js/modules/localization.js' -import { getSectionTemplates } from '../../js/modules/rpc/rpc-manager.js'; +import { openModal } from '@cms/modules/modal.js' +import { showToast } from '@cms/modules/toast.js' +import { addSection, getContentNode } from '@cms/modules/rpc/rpc-content.js' +import { getPreviewUrl, reloadPreview } from '@cms/modules/preview.utils.js' +import Handlebars from 'https://cdn.jsdelivr.net/npm/handlebars@4.7.8/+esm' +import { i18n } from '@cms/modules/localization.js' +import { getSectionTemplates } from '@cms/modules/rpc/rpc-manager.js'; export async function runAction(params) { diff --git a/modules/ui-module/src/main/ts/src/actions/page/create-page.js b/modules/ui-module/src/main/ts/src/actions/page/create-page.js index a59f70f4c..9c2d628f6 100644 --- a/modules/ui-module/src/main/ts/src/actions/page/create-page.js +++ b/modules/ui-module/src/main/ts/src/actions/page/create-page.js @@ -19,7 +19,7 @@ * . * #L% */ -import {openFileBrowser} from '../../js/modules/filebrowser.js' +import {openFileBrowser} from '@cms/modules/filebrowser.js' // hook.js export async function runAction(params) { diff --git a/modules/ui-module/src/main/ts/src/actions/page/delete-section.js b/modules/ui-module/src/main/ts/src/actions/page/delete-section.js index fc36c5e8b..5e84d56d7 100644 --- a/modules/ui-module/src/main/ts/src/actions/page/delete-section.js +++ b/modules/ui-module/src/main/ts/src/actions/page/delete-section.js @@ -19,11 +19,11 @@ * . * #L% */ -import { i18n } from '../../js/modules/localization.js' -import { alertConfirm } from '../../js/modules/alerts.js'; -import { deleteSection } from '../../js/modules/rpc/rpc-content.js'; -import { showToast } from '../../js/modules/toast.js'; -import { reloadPreview } from '../../js/modules/preview.utils.js'; +import { i18n } from '@cms/modules/localization.js' +import { alertConfirm } from '@cms/modules/alerts.js'; +import { deleteSection } from '@cms/modules/rpc/rpc-content.js'; +import { showToast } from '@cms/modules/toast.js'; +import { reloadPreview } from '@cms/modules/preview.utils.js'; export async function runAction(params) { diff --git a/modules/ui-module/src/main/ts/src/actions/page/edit-content.js b/modules/ui-module/src/main/ts/src/actions/page/edit-content.js index 4a4fa7095..982c555ae 100644 --- a/modules/ui-module/src/main/ts/src/actions/page/edit-content.js +++ b/modules/ui-module/src/main/ts/src/actions/page/edit-content.js @@ -19,12 +19,12 @@ * . * #L% */ -import {openModal} from '../../js/modules/modal.js' -import {createForm} from '../../js/modules/form/forms.js' -import {getPreviewUrl, reloadPreview} from '../../js/modules/preview.utils.js' -import {getContentNode, getContent, setContent} from '../../js/modules/rpc/rpc-content.js' -import { i18n } from '../../js/modules/localization.js' -import { showToast } from '../../js/modules/toast.js' +import {openModal} from '@cms/modules/modal.js' +import {createForm} from '@cms/modules/form/forms.js' +import {getPreviewUrl, reloadPreview} from '@cms/modules/preview.utils.js' +import {getContentNode, getContent, setContent} from '@cms/modules/rpc/rpc-content.js' +import { i18n } from '@cms/modules/localization.js' +import { showToast } from '@cms/modules/toast.js' // hook.js export async function runAction(params) { diff --git a/modules/ui-module/src/main/ts/src/actions/page/edit-metaattribute-list.js b/modules/ui-module/src/main/ts/src/actions/page/edit-metaattribute-list.js index 0e3b25dfb..2bb836bfe 100644 --- a/modules/ui-module/src/main/ts/src/actions/page/edit-metaattribute-list.js +++ b/modules/ui-module/src/main/ts/src/actions/page/edit-metaattribute-list.js @@ -19,13 +19,13 @@ * . * #L% */ -import {createForm} from '../../js/modules/form/forms.js' -import {showToast} from '../../js/modules/toast.js' -import {getPreviewUrl, reloadPreview} from '../../js/modules/preview.utils.js' -import { getValueByPath } from '../../js/modules/node.js' -import {getContentNode, getContent, setMeta} from '../../js/modules/rpc/rpc-content.js' -import { i18n } from '../../js/modules/localization.js' -import { openSidebar } from '../../js/modules/sidebar.js' +import {createForm} from '@cms/modules/form/forms.js' +import {showToast} from '@cms/modules/toast.js' +import {getPreviewUrl, reloadPreview} from '@cms/modules/preview.utils.js' +import { getValueByPath } from '@cms/modules/node.js' +import {getContentNode, getContent, setMeta} from '@cms/modules/rpc/rpc-content.js' +import { i18n } from '@cms/modules/localization.js' +import { openSidebar } from '@cms/modules/sidebar.js' // hook.js export async function runAction(params) { diff --git a/modules/ui-module/src/main/ts/src/actions/page/edit-metaattribute.js b/modules/ui-module/src/main/ts/src/actions/page/edit-metaattribute.js index 25cecedbd..31e6d0ccb 100644 --- a/modules/ui-module/src/main/ts/src/actions/page/edit-metaattribute.js +++ b/modules/ui-module/src/main/ts/src/actions/page/edit-metaattribute.js @@ -19,13 +19,13 @@ * . * #L% */ -import {createForm} from '../../js/modules/form/forms.js' -import {showToast} from '../../js/modules/toast.js' -import {getPreviewUrl, reloadPreview} from '../../js/modules/preview.utils.js' -import { getValueByPath } from '../../js/modules/node.js' -import { getContentNode, setMeta, getContent} from '../../js/modules/rpc/rpc-content.js' -import { i18n } from '../../js/modules/localization.js' -import { openSidebar } from '../../js/modules/sidebar.js' +import {createForm} from '@cms/modules/form/forms.js' +import {showToast} from '@cms/modules/toast.js' +import {getPreviewUrl, reloadPreview} from '@cms/modules/preview.utils.js' +import { getValueByPath } from '@cms/modules/node.js' +import { getContentNode, setMeta, getContent} from '@cms/modules/rpc/rpc-content.js' +import { i18n } from '@cms/modules/localization.js' +import { openSidebar } from '@cms/modules/sidebar.js' // hook.js export async function runAction(params) { diff --git a/modules/ui-module/src/main/ts/src/actions/page/edit-page-settings.js b/modules/ui-module/src/main/ts/src/actions/page/edit-page-settings.js index 4c3d44b80..901ff3b78 100644 --- a/modules/ui-module/src/main/ts/src/actions/page/edit-page-settings.js +++ b/modules/ui-module/src/main/ts/src/actions/page/edit-page-settings.js @@ -19,14 +19,14 @@ * . * #L% */ -import { openSidebar } from '../../js/modules/sidebar.js' -import { createForm } from '../../js/modules/form/forms.js' -import { showToast } from '../../js/modules/toast.js' -import { getContentNode, setMeta, getContent } from '../../js/modules/rpc/rpc-content.js' -import { getPreviewUrl, reloadPreview } from '../../js/modules/preview.utils.js' -import { i18n } from '../../js/modules/localization.js' -import { getPageTemplates } from '../../js/modules/rpc/rpc-manager.js' -import { buildValuesFromFields } from '../../js/modules/node.js' +import { openSidebar } from '@cms/modules/sidebar.js' +import { createForm } from '@cms/modules/form/forms.js' +import { showToast } from '@cms/modules/toast.js' +import { getContentNode, setMeta, getContent } from '@cms/modules/rpc/rpc-content.js' +import { getPreviewUrl, reloadPreview } from '@cms/modules/preview.utils.js' +import { i18n } from '@cms/modules/localization.js' +import { getPageTemplates } from '@cms/modules/rpc/rpc-manager.js' +import { buildValuesFromFields } from '@cms/modules/node.js' const DEFAULT_FIELDS = [ { diff --git a/modules/ui-module/src/main/ts/src/actions/page/edit-sections.js b/modules/ui-module/src/main/ts/src/actions/page/edit-sections.js index 4066cc92f..ae10d03aa 100644 --- a/modules/ui-module/src/main/ts/src/actions/page/edit-sections.js +++ b/modules/ui-module/src/main/ts/src/actions/page/edit-sections.js @@ -19,12 +19,12 @@ * . * #L% */ -import { openModal } from '../../js/modules/modal.js' -import { showToast } from '../../js/modules/toast.js' -import { getPreviewUrl, reloadPreview } from '../../js/modules/preview.utils.js' -import { Sortable } from '../../js/libs/sortablejs.min.js' -import Handlebars from '../../js/libs/handlebars.min.js'; -import {getContentNode, setMetaBatch} from '../../js/modules/rpc/rpc-content.js' +import { openModal } from '@cms/modules/modal.js' +import { showToast } from '@cms/modules/toast.js' +import { getPreviewUrl, reloadPreview } from '@cms/modules/preview.utils.js' +import Sortable from 'https://cdn.jsdelivr.net/npm/sortablejs@1.15.6/+esm' +import Handlebars from 'https://cdn.jsdelivr.net/npm/handlebars@4.7.8/+esm' +import {getContentNode, setMetaBatch} from '@cms/modules/rpc/rpc-content.js' // hook.js export async function runAction(params) { diff --git a/modules/ui-module/src/main/ts/src/actions/page/manage-assets.js b/modules/ui-module/src/main/ts/src/actions/page/manage-assets.js index 92c648513..5c88b6f82 100644 --- a/modules/ui-module/src/main/ts/src/actions/page/manage-assets.js +++ b/modules/ui-module/src/main/ts/src/actions/page/manage-assets.js @@ -19,7 +19,7 @@ * . * #L% */ -import {openFileBrowser} from '../../js/modules/filebrowser.js' +import {openFileBrowser} from '@cms/modules/filebrowser.js' // hook.js export async function runAction(params) { diff --git a/modules/ui-module/src/main/ts/src/actions/page/section-set-published.ts b/modules/ui-module/src/main/ts/src/actions/page/section-set-published.ts index d95d1e666..4d895ec13 100644 --- a/modules/ui-module/src/main/ts/src/actions/page/section-set-published.ts +++ b/modules/ui-module/src/main/ts/src/actions/page/section-set-published.ts @@ -20,8 +20,8 @@ * #L% */ -import { reloadPreview } from "../../js/modules/preview.utils"; -import { setMeta } from "../../js/modules/rpc/rpc-content"; +import { reloadPreview } from "@cms/modules/preview.utils"; +import { setMeta } from "@cms/modules/rpc/rpc-content"; export async function runAction(params) { diff --git a/modules/ui-module/src/main/ts/src/actions/page/translations.ts b/modules/ui-module/src/main/ts/src/actions/page/translations.ts index a535952f0..db1137cda 100644 --- a/modules/ui-module/src/main/ts/src/actions/page/translations.ts +++ b/modules/ui-module/src/main/ts/src/actions/page/translations.ts @@ -19,13 +19,13 @@ * . * #L% */ -import { openFileBrowser } from '../../js/modules/filebrowser.js' -import { i18n } from '../../js/modules/localization.js' -import { openModal } from '../../js/modules/modal.js' -import { getPreviewUrl } from '../../js/modules/preview.utils.js' -import { getContentNode } from '../../js/modules/rpc/rpc-content.js' -import { addTranslation, getTranslations, TranslationDto } from '../../js/modules/rpc/rpc-translation.js' -import { showToast } from '../../js/modules/toast.js' +import { openFileBrowser } from '@cms/modules/filebrowser.js' +import { i18n } from '@cms/modules/localization.js' +import { openModal } from '@cms/modules/modal.js' +import { getPreviewUrl } from '@cms/modules/preview.utils.js' +import { getContentNode } from '@cms/modules/rpc/rpc-content.js' +import { addTranslation, getTranslations, TranslationDto } from '@cms/modules/rpc/rpc-translation.js' +import { showToast } from '@cms/modules/toast.js' // hook.js export async function runAction(params: any) { diff --git a/modules/ui-module/src/main/ts/src/actions/test-command.js b/modules/ui-module/src/main/ts/src/actions/test-command.js index 1d8039acb..3c91edbba 100644 --- a/modules/ui-module/src/main/ts/src/actions/test-command.js +++ b/modules/ui-module/src/main/ts/src/actions/test-command.js @@ -19,8 +19,8 @@ * . * #L% */ -import {executeCommand} from '../../js/modules/system-commands.js' -import {getPreviewUrl} from '../../js/modules/preview.utils.js' +import {executeCommand} from '@cms/modules/system-commands.js' +import {getPreviewUrl} from '@cms/modules/preview.utils.js' // hook.js export async function runAction(params) { diff --git a/modules/ui-module/src/main/ts/src/js/libs/handlebars.min.js b/modules/ui-module/src/main/ts/src/js/libs/handlebars.min.js deleted file mode 100644 index ca58ab9ff..000000000 --- a/modules/ui-module/src/main/ts/src/js/libs/handlebars.min.js +++ /dev/null @@ -1,8 +0,0 @@ -/** - * Bundled by jsDelivr using Rollup v2.79.2 and Terser v5.39.0. - * Original file: /npm/handlebars@4.7.8/dist/cjs/handlebars.js - * - * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files - */ -var t={exports:{}},e={exports:{}},r={},s={__esModule:!0};s.extend=l,s.indexOf=function(t,e){for(var r=0,s=t.length;r":">",'"':""","'":"'","`":"`","=":"="},n=/[&<>"'`=]/g,o=/[&<>"'`=]/;function a(t){return i[t]}function l(t){for(var e=1;e0?(s.ids&&(s.ids=[s.name]),t.helpers.each(e,s)):i(this);if(s.data&&s.ids){var o=r.createFrame(s.data);o.contextPath=r.appendContextPath(s.data.contextPath,s.name),s={data:o}}return n(e,s)}))},t.exports=e.default}(d,d.exports);var m={exports:{}};!function(t,e){e.__esModule=!0;var r,i=s,n=(r=u.exports)&&r.__esModule?r:{default:r};e.default=function(t){t.registerHelper("each",(function(t,e){if(!e)throw new n.default("Must pass iterator to #each");var r,s=e.fn,o=e.inverse,a=0,l="",c=void 0,p=void 0;function h(e,r,n){c&&(c.key=e,c.index=r,c.first=0===r,c.last=!!n,p&&(c.contextPath=p+e)),l+=s(t[e],{data:c,blockParams:i.blockParams([t[e],e],[p+e,null])})}if(e.data&&e.ids&&(p=i.appendContextPath(e.data.contextPath,e.ids[0])+"."),i.isFunction(t)&&(t=t.call(this)),e.data&&(c=i.createFrame(e.data)),t&&"object"==typeof t)if(i.isArray(t))for(var u=t.length;a=0?e:parseInt(t,10)}return t},log:function(t){if(t=i.lookupLevel(t),"undefined"!=typeof console&&i.lookupLevel(i.level)<=t){var e=i.methodMap[t];console[e]||(e="log");for(var r=arguments.length,s=Array(r>1?r-1:0),n=1;n= 2.0.0-beta.1",7:">= 4.0.0 <4.3.0",8:">= 4.3.0"};var Y="[object Object]";function X(t,e,r){this.helpers=t||{},this.partials=e||{},this.decorators=r||{},W.registerDefaultHelpers(this),J.registerDefaultDecorators(this)}X.prototype={constructor:X,logger:G.default,log:G.default.log,registerHelper:function(t,e){if(U.toString.call(t)===Y){if(e)throw new q.default("Arg not supported with multiple helpers");U.extend(this.helpers,t)}else this.helpers[t]=e},unregisterHelper:function(t){delete this.helpers[t]},registerPartial:function(t,e){if(U.toString.call(t)===Y)U.extend(this.partials,t);else{if(void 0===e)throw new q.default('Attempting to register a partial called "'+t+'" as undefined');this.partials[t]=e}},unregisterPartial:function(t){delete this.partials[t]},registerDecorator:function(t,e){if(U.toString.call(t)===Y){if(e)throw new q.default("Arg not supported with multiple decorators");U.extend(this.decorators,t)}else this.decorators[t]=e},unregisterDecorator:function(t){delete this.decorators[t]},resetLoggedPropertyAccesses:function(){z.resetLoggedProperties()}};var Z=G.default.log;r.log=Z,r.createFrame=U.createFrame,r.logger=G.default;var Q={exports:{}};!function(t,e){function r(t){this.string=t}e.__esModule=!0,r.prototype.toString=r.prototype.toHTML=function(){return""+this.string},e.default=r,t.exports=e.default}(Q,Q.exports);var tt={},et={};et.__esModule=!0,et.wrapHelper=function(t,e){if("function"!=typeof t)return t;return function(){return arguments[arguments.length-1]=e(arguments[arguments.length-1]),t.apply(this,arguments)}},tt.__esModule=!0,tt.checkRevision=function(t){var e=t&&t[0]||1,r=it.COMPILER_REVISION;if(e>=it.LAST_COMPATIBLE_COMPILER_REVISION&&e<=it.COMPILER_REVISION)return;if(e2&&y.push("'"+this.terminals_[m]+"'");S=this.lexer.showPosition?"Parse error on line "+(a+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+y.join(", ")+", got '"+(this.terminals_[h]||h)+"'":"Parse error on line "+(a+1)+": Unexpected "+(1==h?"end of input":"'"+(this.terminals_[h]||h)+"'"),this.parseError(S,{text:this.lexer.match,token:this.terminals_[h]||h,line:this.lexer.yylineno,loc:c,expected:y})}if(f[0]instanceof Array&&f.length>1)throw new Error("Parse Error: multiple actions possible at state: "+u+", token: "+h);switch(f[0]){case 1:r.push(h),s.push(this.lexer.yytext),i.push(this.lexer.yylloc),r.push(f[1]),h=null,l=this.lexer.yyleng,o=this.lexer.yytext,a=this.lexer.yylineno,c=this.lexer.yylloc;break;case 2:if(g=this.productions_[f[1]][1],_.$=s[s.length-g],_._$={first_line:i[i.length-(g||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(g||1)].first_column,last_column:i[i.length-1].last_column},p&&(_._$.range=[i[i.length-(g||1)].range[0],i[i.length-1].range[1]]),void 0!==(d=this.performAction.call(_,o,l,a,this.yy,f[1],s,i)))return d;g&&(r=r.slice(0,-1*g*2),s=s.slice(0,-1*g),i=i.slice(0,-1*g)),r.push(this.productions_[f[1]][0]),s.push(_.$),i.push(_._$),v=n[r[r.length-2]][r[r.length-1]],r.push(v);break;case 3:return!0}}return!0}},e=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t){return this._input=t,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,r=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e-1),this.offset-=e;var s=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:r?(r.length===s.length?this.yylloc.first_column:0)+s[s.length-r.length].length-r[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this},more:function(){return this._more=!0,this},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},next:function(){if(this.done)return this.EOF;var t,e,r,s,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var n=this._currentRules(),o=0;oe[0].length)||(e=r,s=o,this.options.flex));o++);return e?((i=e[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],t=this.performAction.call(this,this.yy,this,n[s],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),t||void 0):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return void 0!==t?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(t){this.begin(t)},options:{},performAction:function(t,e,r,s){function i(t,r){return e.yytext=e.yytext.substring(t,e.yyleng-r+t)}switch(r){case 0:if("\\\\"===e.yytext.slice(-2)?(i(0,1),this.begin("mu")):"\\"===e.yytext.slice(-1)?(i(0,1),this.begin("emu")):this.begin("mu"),e.yytext)return 15;break;case 1:case 5:return 15;case 2:return this.popState(),15;case 3:return this.begin("raw"),15;case 4:return this.popState(),"raw"===this.conditionStack[this.conditionStack.length-1]?15:(i(5,9),"END_RAW_BLOCK");case 6:case 22:return this.popState(),14;case 7:return 65;case 8:return 68;case 9:return 19;case 10:return this.popState(),this.begin("raw"),23;case 11:return 55;case 12:return 60;case 13:return 29;case 14:return 47;case 15:case 16:return this.popState(),44;case 17:return 34;case 18:return 39;case 19:return 51;case 20:case 23:return 48;case 21:this.unput(e.yytext),this.popState(),this.begin("com");break;case 24:return 73;case 25:case 26:case 41:return 72;case 27:return 87;case 28:break;case 29:return this.popState(),54;case 30:return this.popState(),33;case 31:return e.yytext=i(1,2).replace(/\\"/g,'"'),80;case 32:return e.yytext=i(1,2).replace(/\\'/g,"'"),80;case 33:return 85;case 34:case 35:return 82;case 36:return 83;case 37:return 84;case 38:return 81;case 39:return 75;case 40:return 77;case 42:return e.yytext=e.yytext.replace(/\\([\\\]])/g,"$1"),72;case 43:return"INVALID";case 44:return 5}},rules:[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:\{\{\{\{(?=[^/]))/,/^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,/^(?:[^\x00]+?(?=(\{\{\{\{)))/,/^(?:[\s\S]*?--(~)?\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{\{\{)/,/^(?:\}\}\}\})/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#>)/,/^(?:\{\{(~)?#\*?)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^\s*(~)?\}\})/,/^(?:\{\{(~)?\s*else\s*(~)?\}\})/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{(~)?!--)/,/^(?:\{\{(~)?![\s\S]*?\}\})/,/^(?:\{\{(~)?\*?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)|])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:undefined(?=([~}\s)])))/,/^(?:null(?=([~}\s)])))/,/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/,/^(?:as\s+\|)/,/^(?:\|)/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/,/^(?:\[(\\\]|[^\]])*\])/,/^(?:.)/,/^(?:$)/],conditions:{mu:{rules:[7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[6],inclusive:!1},raw:{rules:[3,4,5],inclusive:!1},INITIAL:{rules:[0,1,44],inclusive:!0}}};return t}();function r(){this.yy={}}return t.lexer=e,r.prototype=t,t.Parser=r,new r}();e.default=r,t.exports=e.default}(dt,dt.exports);var mt={exports:{}},gt={exports:{}};!function(t,e){e.__esModule=!0;var r=function(t){return t&&t.__esModule?t:{default:t}}(u.exports);function s(){this.parents=[]}function i(t){this.acceptRequired(t,"path"),this.acceptArray(t.params),this.acceptKey(t,"hash")}function n(t){i.call(this,t),this.acceptKey(t,"program"),this.acceptKey(t,"inverse")}function o(t){this.acceptRequired(t,"name"),this.acceptArray(t.params),this.acceptKey(t,"hash")}s.prototype={constructor:s,mutating:!1,acceptKey:function(t,e){var i=this.accept(t[e]);if(this.mutating){if(i&&!s.prototype[i.type])throw new r.default('Unexpected node type "'+i.type+'" found when accepting '+e+" on "+t.type);t[e]=i}},acceptRequired:function(t,e){if(this.acceptKey(t,e),!t[e])throw new r.default(t.type+" requires "+e)},acceptArray:function(t){for(var e=0,r=t.length;e0)throw new yt.default("Invalid path: "+s,{loc:r});".."===l&&n++}}return{type:"PathExpression",data:t,depth:n,parts:i,original:s,loc:r}},vt.prepareMustache=function(t,e,r,s,i,n){var o=s.charAt(3)||s.charAt(2),a="{"!==o&&"&"!==o;return{type:/\*/.test(s)?"Decorator":"MustacheStatement",path:t,params:e,hash:r,escaped:a,strip:i,loc:this.locInfo(n)}},vt.prepareRawBlock=function(t,e,r,s){kt(t,r),s=this.locInfo(s);var i={type:"Program",body:e,strip:{},loc:s};return{type:"BlockStatement",path:t.path,params:t.params,hash:t.hash,program:i,openStrip:{},inverseStrip:{},closeStrip:{},loc:s}},vt.prepareBlock=function(t,e,r,s,i,n){s&&s.path&&kt(t,s);var o=/\*/.test(t.open);e.blockParams=t.blockParams;var a=void 0,l=void 0;if(r){if(o)throw new yt.default("Unexpected inverse block on decorator",r);r.chain&&(r.program.body[0].closeStrip=s.strip),l=r.strip,a=r.program}i&&(i=a,a=e,e=i);return{type:o?"DecoratorBlock":"BlockStatement",path:t.path,params:t.params,hash:t.hash,program:e,inverse:a,openStrip:t.strip,inverseStrip:l,closeStrip:s&&s.strip,loc:this.locInfo(n)}},vt.prepareProgram=function(t,e){if(!e&&t.length){var r=t[0].loc,s=t[t.length-1].loc;r&&s&&(e={source:r.source,start:{line:r.start.line,column:r.start.column},end:{line:s.end.line,column:s.end.column}})}return{type:"Program",body:t,strip:{},loc:e}},vt.preparePartialBlock=function(t,e,r,s){return kt(t,r),{type:"PartialBlockStatement",name:t.path,params:t.params,hash:t.hash,program:e,openStrip:t.strip,closeStrip:r&&r.strip,loc:this.locInfo(s)}};var yt=function(t){return t&&t.__esModule?t:{default:t}}(u.exports);function kt(t,e){if(e=e.path?e.path.original:e,t.path.original!==e){var r={loc:t.path.loc};throw new yt.default(t.path.original+" doesn't match "+e,r)}}function _t(t){return t&&t.__esModule?t:{default:t}}ft.__esModule=!0,ft.parseWithoutProcessing=Et,ft.parse=function(t,e){var r=Et(t,e);return new xt.default(e).accept(r)};var St=_t(dt.exports),xt=_t(mt.exports),Pt=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}(vt),bt=s;ft.parser=St.default;var wt={};function Et(t,e){return"Program"===t.type?t:(St.default.yy=wt,wt.locInfo=function(t){return new wt.SourceLocation(e&&e.srcName,t)},St.default.parse(t))}bt.extend(wt,Pt);var Lt={};function Ct(t){return t&&t.__esModule?t:{default:t}}Lt.__esModule=!0,Lt.Compiler=Mt,Lt.precompile=function(t,e,r){if(null==t||"string"!=typeof t&&"Program"!==t.type)throw new It.default("You must pass a string or Handlebars AST to Handlebars.precompile. You passed "+t);"data"in(e=e||{})||(e.data=!0);e.compat&&(e.useDepths=!0);var s=r.parse(t,e),i=(new r.Compiler).compile(s,e);return(new r.JavaScriptCompiler).compile(i,e)},Lt.compile=function(t,e,r){void 0===e&&(e={});if(null==t||"string"!=typeof t&&"Program"!==t.type)throw new It.default("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+t);"data"in(e=Ot.extend({},e))||(e.data=!0);e.compat&&(e.useDepths=!0);var s=void 0;function i(){var s=r.parse(t,e),i=(new r.Compiler).compile(s,e),n=(new r.JavaScriptCompiler).compile(i,e,void 0,!0);return r.template(n)}function n(t,e){return s||(s=i()),s.call(this,t,e)}return n._setup=function(t){return s||(s=i()),s._setup(t)},n._child=function(t,e,r,n){return s||(s=i()),s._child(t,e,r,n)},n};var It=Ct(u.exports),Ot=s,Nt=Ct(ut.exports),At=[].slice;function Mt(){}function Bt(t,e){if(t===e)return!0;if(Ot.isArray(t)&&Ot.isArray(e)&&t.length===e.length){for(var r=0;r1)throw new It.default("Unsupported number of partial arguments: "+r.length,t);r.length||(this.options.explicitPartialContext?this.opcode("pushLiteral","undefined"):r.push({type:"PathExpression",parts:[],depth:0}));var s=t.name.original,i="SubExpression"===t.name.type;i&&this.accept(t.name),this.setupFullMustacheParams(t,e,void 0,!0);var n=t.indent||"";this.options.preventIndent&&n&&(this.opcode("appendContent",n),n=""),this.opcode("invokePartial",i,s,n),this.opcode("append")},PartialBlockStatement:function(t){this.PartialStatement(t)},MustacheStatement:function(t){this.SubExpression(t),t.escaped&&!this.options.noEscape?this.opcode("appendEscaped"):this.opcode("append")},Decorator:function(t){this.DecoratorBlock(t)},ContentStatement:function(t){t.value&&this.opcode("appendContent",t.value)},CommentStatement:function(){},SubExpression:function(t){Dt(t);var e=this.classifySexpr(t);"simple"===e?this.simpleSexpr(t):"helper"===e?this.helperSexpr(t):this.ambiguousSexpr(t)},ambiguousSexpr:function(t,e,r){var s=t.path,i=s.parts[0],n=null!=e||null!=r;this.opcode("getContext",s.depth),this.opcode("pushProgram",e),this.opcode("pushProgram",r),s.strict=!0,this.accept(s),this.opcode("invokeAmbiguous",i,n)},simpleSexpr:function(t){var e=t.path;e.strict=!0,this.accept(e),this.opcode("resolvePossibleLambda")},helperSexpr:function(t,e,r){var s=this.setupFullMustacheParams(t,e,r),i=t.path,n=i.parts[0];if(this.options.knownHelpers[n])this.opcode("invokeKnownHelper",s.length,n);else{if(this.options.knownHelpersOnly)throw new It.default("You specified knownHelpersOnly, but used the unknown helper "+n,t);i.strict=!0,i.falsy=!0,this.accept(i),this.opcode("invokeHelper",s.length,i.original,Nt.default.helpers.simpleId(i))}},PathExpression:function(t){this.addDepth(t.depth),this.opcode("getContext",t.depth);var e=t.parts[0],r=Nt.default.helpers.scopedId(t),s=!t.depth&&!r&&this.blockParamIndex(e);s?this.opcode("lookupBlockParam",s,t.parts):e?t.data?(this.options.data=!0,this.opcode("lookupData",t.depth,t.parts,t.strict)):this.opcode("lookupOnContext",t.parts,t.falsy,t.strict,r):this.opcode("pushContext")},StringLiteral:function(t){this.opcode("pushString",t.value)},NumberLiteral:function(t){this.opcode("pushLiteral",t.value)},BooleanLiteral:function(t){this.opcode("pushLiteral",t.value)},UndefinedLiteral:function(){this.opcode("pushLiteral","undefined")},NullLiteral:function(){this.opcode("pushLiteral","null")},Hash:function(t){var e=t.pairs,r=0,s=e.length;for(this.opcode("pushHash");r=0)return[e,i]}}};var Ht={exports:{}},$t={exports:{}};!function(t,e){e.__esModule=!0;var r=s,i=void 0;try{var n=require("source-map");i=n.SourceNode}catch(t){}function o(t,e,s){if(r.isArray(t)){for(var i=[],n=0,o=t.length;n0&&(r+=", "+s.join(", "));var i=0;Object.keys(this.aliases).forEach((function(t){var s=e.aliases[t];s.children&&s.referenceCount>1&&(r+=", alias"+ ++i+"="+t,s.children[0]="alias"+i)})),this.lookupPropertyFunctionIsUsed&&(r+=", "+this.lookupPropertyFunctionVarDeclaration());var n=["container","depth0","helpers","partials","data"];(this.useBlockParams||this.useDepths)&&n.push("blockParams"),this.useDepths&&n.push("depths");var o=this.mergeSource(r);return t?(n.push(o),Function.apply(this,n)):this.source.wrap(["function(",n.join(","),") {\n ",o,"}"])},mergeSource:function(t){var e=this.environment.isSimple,r=!this.forceBuffer,s=void 0,i=void 0,n=void 0,o=void 0;return this.source.each((function(t){t.appendToBuffer?(n?t.prepend(" + "):n=t,o=t):(n&&(i?n.prepend("buffer += "):s=!0,o.add(";"),n=o=void 0),i=!0,e||(r=!1))})),r?n?(n.prepend("return "),o.add(";")):i||this.source.push('return "";'):(t+=", buffer = "+(s?"":this.initializeBuffer()),n?(n.prepend("return buffer + "),o.add(";")):this.source.push("return buffer;")),t&&this.source.prepend("var "+t.substring(2)+(s?"":";\n")),this.source.merge()},lookupPropertyFunctionVarDeclaration:function(){return"\n lookupProperty = container.lookupProperty || function(parent, propertyName) {\n if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {\n return parent[propertyName];\n }\n return undefined\n }\n ".trim()},blockValue:function(t){var e=this.aliasable("container.hooks.blockHelperMissing"),r=[this.contextName(0)];this.setupHelperArgs(t,0,r);var s=this.popStack();r.splice(1,0,s),this.push(this.source.functionCall(e,"call",r))},ambiguousBlockValue:function(){var t=this.aliasable("container.hooks.blockHelperMissing"),e=[this.contextName(0)];this.setupHelperArgs("",0,e,!0),this.flushInline();var r=this.topStack();e.splice(1,0,r),this.pushSource(["if (!",this.lastHelper,") { ",r," = ",this.source.functionCall(t,"call",e),"}"])},appendContent:function(t){this.pendingContent?t=this.pendingContent+t:this.pendingLocation=this.source.currentLocation,this.pendingContent=t},append:function(){if(this.isInline())this.replaceStack((function(t){return[" != null ? ",t,' : ""']})),this.pushSource(this.appendToBuffer(this.popStack()));else{var t=this.popStack();this.pushSource(["if (",t," != null) { ",this.appendToBuffer(t,void 0,!0)," }"]),this.environment.isSimple&&this.pushSource(["else { ",this.appendToBuffer("''",void 0,!0)," }"])}},appendEscaped:function(){this.pushSource(this.appendToBuffer([this.aliasable("container.escapeExpression"),"(",this.popStack(),")"]))},getContext:function(t){this.lastContext=t},pushContext:function(){this.pushStackLiteral(this.contextName(this.lastContext))},lookupOnContext:function(t,e,r,s){var i=0;s||!this.options.compat||this.lastContext?this.pushContext():this.push(this.depthedLookup(t[i++])),this.resolvePath("context",t,i,e,r)},lookupBlockParam:function(t,e){this.useBlockParams=!0,this.push(["blockParams[",t[0],"][",t[1],"]"]),this.resolvePath("context",e,1)},lookupData:function(t,e,r){t?this.pushStackLiteral("container.data(data, "+t+")"):this.pushStackLiteral("data"),this.resolvePath("data",e,0,!0,r)},resolvePath:function(t,e,r,s,i){var n=this;if(this.options.strict||this.options.assumeObjects)this.push(function(t,e,r,s,i){var n=e.popStack(),o=r.length;t&&o--;for(;sthis.stackVars.length&&this.stackVars.push("stack"+this.stackSlot),this.topStackName()},topStackName:function(){return"stack"+this.stackSlot},flushInline:function(){var t=this.inlineStack;this.inlineStack=[];for(var e=0,r=t.length;e - * @author owenm - * @license MIT - */ -function t(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function e(e){for(var n=1;n=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function a(t){return function(t){if(Array.isArray(t))return l(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return l(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return l(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n"===e[0]&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch(t){return!1}return!1}}function y(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function w(t,e,n,o){if(t){n=n||document;do{if(null!=e&&(">"===e[0]?t.parentNode===n&&b(t,e):b(t,e))||o&&t===n)return t;if(t===n)break}while(t=y(t))}return null}var D,E=/\s+/g;function S(t,e,n){if(t&&e)if(t.classList)t.classList[n?"add":"remove"](e);else{var o=(" "+t.className+" ").replace(E," ").replace(" "+e+" "," ");t.className=(o+(n?" "+e:"")).replace(E," ")}}function _(t,e,n){var o=t&&t.style;if(o){if(void 0===n)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),void 0===e?n:n[e];e in o||-1!==e.indexOf("webkit")||(e="-webkit-"+e),o[e]=n+("string"==typeof n?"":"px")}}function C(t,e){var n="";if("string"==typeof t)n=t;else do{var o=_(t,"transform");o&&"none"!==o&&(n=o+" "+n)}while(!e&&(t=t.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(n)}function T(t,e,n){if(t){var o=t.getElementsByTagName(e),i=0,r=o.length;if(n)for(;i=r:i<=r))return o;if(o===x())break;o=k(o,!1)}return!1}function A(t,e,n,o){for(var i=0,r=0,a=t.children;r2&&void 0!==arguments[2]?arguments[2]:{},i=o.evt,a=r(o,q);G.pluginEvent.bind(Ht)(t,n,e({dragEl:$,parentEl:Q,ghostEl:J,rootEl:tt,nextEl:et,lastDownEl:nt,cloneEl:ot,cloneHidden:it,dragStarted:mt,putSortable:ut,activeSortable:Ht.active,originalEvent:i,oldIndex:rt,oldDraggableIndex:lt,newIndex:at,newDraggableIndex:st,hideGhostForTarget:Yt,unhideGhostForTarget:Bt,cloneNowHidden:function(){it=!0},cloneNowShown:function(){it=!1},dispatchSortableEvent:function(t){Z({sortable:n,name:t,originalEvent:i})}},a))};function Z(t){U(e({putSortable:ut,cloneEl:ot,targetEl:$,rootEl:tt,oldIndex:rt,oldDraggableIndex:lt,newIndex:at,newDraggableIndex:st},t))}var $,Q,J,tt,et,nt,ot,it,rt,at,lt,st,ct,ut,dt,ht,ft,pt,gt,vt,mt,bt,yt,wt,Dt,Et=!1,St=!1,_t=[],Ct=!1,Tt=!1,xt=[],Ot=!1,Mt=[],At="undefined"!=typeof document,Nt=f,It=u||c?"cssFloat":"float",Pt=At&&!p&&!f&&"draggable"in document.createElement("div"),kt=function(){if(At){if(c)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto","auto"===t.style.pointerEvents}}(),Rt=function(t,e){var n=_(t),o=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),i=A(t,0,e),r=A(t,1,e),a=i&&_(i),l=r&&_(r),s=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+O(i).width,c=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+O(r).width;if("flex"===n.display)return"column"===n.flexDirection||"column-reverse"===n.flexDirection?"vertical":"horizontal";if("grid"===n.display)return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(i&&a.float&&"none"!==a.float){var u="left"===a.float?"left":"right";return!r||"both"!==l.clear&&l.clear!==u?"horizontal":"vertical"}return i&&("block"===a.display||"flex"===a.display||"table"===a.display||"grid"===a.display||s>=o&&"none"===n[It]||r&&"none"===n[It]&&s+c>o)?"vertical":"horizontal"},Xt=function(t){function e(t,n){return function(o,i,r,a){var l=o.options.group.name&&i.options.group.name&&o.options.group.name===i.options.group.name;if(null==t&&(n||l))return!0;if(null==t||!1===t)return!1;if(n&&"clone"===t)return t;if("function"==typeof t)return e(t(o,i,r,a),n)(o,i,r,a);var s=(n?o:i).options.group.name;return!0===t||"string"==typeof t&&t===s||t.join&&t.indexOf(s)>-1}}var o={},i=t.group;i&&"object"==n(i)||(i={name:i}),o.name=i.name,o.checkPull=e(i.pull,!0),o.checkPut=e(i.put),o.revertClone=i.revertClone,t.group=o},Yt=function(){!kt&&J&&_(J,"display","none")},Bt=function(){!kt&&J&&_(J,"display","")};At&&!p&&document.addEventListener("click",(function(t){if(St)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),St=!1,!1}),!0);var Ft=function(t){if($){t=t.touches?t.touches[0]:t;var e=(i=t.clientX,r=t.clientY,_t.some((function(t){var e=t[L].options.emptyInsertThreshold;if(e&&!N(t)){var n=O(t),o=i>=n.left-e&&i<=n.right+e,l=r>=n.top-e&&r<=n.bottom+e;return o&&l?a=t:void 0}})),a);if(e){var n={};for(var o in t)t.hasOwnProperty(o)&&(n[o]=t[o]);n.target=n.rootEl=e,n.preventDefault=void 0,n.stopPropagation=void 0,e[L]._onDragOver(n)}}var i,r,a},jt=function(t){$&&$.parentNode[L]._isOutsideThisEl(t.target)};function Ht(t,e){if(!t||!t.nodeType||1!==t.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=e=i({},e),t[L]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Rt(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(t,e){t.setData("Text",e.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==Ht.supportPointer&&"PointerEvent"in window&&(!h||f),emptyInsertThreshold:5};for(var o in G.initializePlugins(this,t,n),n)!(o in e)&&(e[o]=n[o]);for(var r in Xt(e),this)"_"===r.charAt(0)&&"function"==typeof this[r]&&(this[r]=this[r].bind(this));this.nativeDraggable=!e.forceFallback&&Pt,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?v(t,"pointerdown",this._onTapStart):(v(t,"mousedown",this._onTapStart),v(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(v(t,"dragover",this),v(t,"dragenter",this)),_t.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),i(this,K())}function Lt(t,e,n,o,i,r,a,l){var s,d,h=t[L],f=h.options.onMove;return!window.CustomEvent||c||u?(s=document.createEvent("Event")).initEvent("move",!0,!0):s=new CustomEvent("move",{bubbles:!0,cancelable:!0}),s.to=e,s.from=t,s.dragged=n,s.draggedRect=o,s.related=i||e,s.relatedRect=r||O(e),s.willInsertAfter=l,s.originalEvent=a,t.dispatchEvent(s),f&&(d=f.call(h,s,a)),d}function Kt(t){t.draggable=!1}function Wt(){Ot=!1}function zt(t){for(var e=t.tagName+t.className+t.src+t.href+t.textContent,n=e.length,o=0;n--;)o+=e.charCodeAt(n);return o.toString(36)}function Gt(t){return setTimeout(t,0)}function Ut(t){return clearTimeout(t)}Ht.prototype={constructor:Ht,_isOutsideThisEl:function(t){this.el.contains(t)||t===this.el||(bt=null)},_getDirection:function(t,e){return"function"==typeof this.options.direction?this.options.direction.call(this,t,e,$):this.options.direction},_onTapStart:function(t){if(t.cancelable){var e=this,n=this.el,o=this.options,i=o.preventOnFilter,r=t.type,a=t.touches&&t.touches[0]||t.pointerType&&"touch"===t.pointerType&&t,l=(a||t).target,s=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||l,c=o.filter;if(function(t){Mt.length=0;var e=t.getElementsByTagName("input"),n=e.length;for(;n--;){var o=e[n];o.checked&&Mt.push(o)}}(n),!$&&!(/mousedown|pointerdown/.test(r)&&0!==t.button||o.disabled)&&!s.isContentEditable&&(this.nativeDraggable||!h||!l||"SELECT"!==l.tagName.toUpperCase())&&!((l=w(l,o.draggable,n,!1))&&l.animated||nt===l)){if(rt=I(l),lt=I(l,o.draggable),"function"==typeof c){if(c.call(this,t,l,this))return Z({sortable:e,rootEl:s,name:"filter",targetEl:l,toEl:n,fromEl:n}),V("filter",e,{evt:t}),void(i&&t.preventDefault())}else if(c&&(c=c.split(",").some((function(o){if(o=w(s,o.trim(),n,!1))return Z({sortable:e,rootEl:o,name:"filter",targetEl:l,fromEl:n,toEl:n}),V("filter",e,{evt:t}),!0}))))return void(i&&t.preventDefault());o.handle&&!w(s,o.handle,n,!1)||this._prepareDragStart(t,a,l)}}},_prepareDragStart:function(t,e,n){var o,i=this,r=i.el,a=i.options,l=r.ownerDocument;if(n&&!$&&n.parentNode===r){var s=O(n);if(tt=r,Q=($=n).parentNode,et=$.nextSibling,nt=n,ct=a.group,Ht.dragged=$,dt={target:$,clientX:(e||t).clientX,clientY:(e||t).clientY},gt=dt.clientX-s.left,vt=dt.clientY-s.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,$.style["will-change"]="all",o=function(){V("delayEnded",i,{evt:t}),Ht.eventCanceled?i._onDrop():(i._disableDelayedDragEvents(),!d&&i.nativeDraggable&&($.draggable=!0),i._triggerDragStart(t,e),Z({sortable:i,name:"choose",originalEvent:t}),S($,a.chosenClass,!0))},a.ignore.split(",").forEach((function(t){T($,t.trim(),Kt)})),v(l,"dragover",Ft),v(l,"mousemove",Ft),v(l,"touchmove",Ft),a.supportPointer?(v(l,"pointerup",i._onDrop),!this.nativeDraggable&&v(l,"pointercancel",i._onDrop)):(v(l,"mouseup",i._onDrop),v(l,"touchend",i._onDrop),v(l,"touchcancel",i._onDrop)),d&&this.nativeDraggable&&(this.options.touchStartThreshold=4,$.draggable=!0),V("delayStart",this,{evt:t}),!a.delay||a.delayOnTouchOnly&&!e||this.nativeDraggable&&(u||c))o();else{if(Ht.eventCanceled)return void this._onDrop();a.supportPointer?(v(l,"pointerup",i._disableDelayedDrag),v(l,"pointercancel",i._disableDelayedDrag)):(v(l,"mouseup",i._disableDelayedDrag),v(l,"touchend",i._disableDelayedDrag),v(l,"touchcancel",i._disableDelayedDrag)),v(l,"mousemove",i._delayedDragTouchMoveHandler),v(l,"touchmove",i._delayedDragTouchMoveHandler),a.supportPointer&&v(l,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(o,a.delay)}}},_delayedDragTouchMoveHandler:function(t){var e=t.touches?t.touches[0]:t;Math.max(Math.abs(e.clientX-this._lastX),Math.abs(e.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){$&&Kt($),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;m(t,"mouseup",this._disableDelayedDrag),m(t,"touchend",this._disableDelayedDrag),m(t,"touchcancel",this._disableDelayedDrag),m(t,"pointerup",this._disableDelayedDrag),m(t,"pointercancel",this._disableDelayedDrag),m(t,"mousemove",this._delayedDragTouchMoveHandler),m(t,"touchmove",this._delayedDragTouchMoveHandler),m(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||"touch"==t.pointerType&&t,!this.nativeDraggable||e?this.options.supportPointer?v(document,"pointermove",this._onTouchMove):v(document,e?"touchmove":"mousemove",this._onTouchMove):(v($,"dragend",this),v(tt,"dragstart",this._onDragStart));try{document.selection?Gt((function(){document.selection.empty()})):window.getSelection().removeAllRanges()}catch(t){}},_dragStarted:function(t,e){if(Et=!1,tt&&$){V("dragStarted",this,{evt:e}),this.nativeDraggable&&v(document,"dragover",jt);var n=this.options;!t&&S($,n.dragClass,!1),S($,n.ghostClass,!0),Ht.active=this,t&&this._appendGhost(),Z({sortable:this,name:"start",originalEvent:e})}else this._nulling()},_emulateDragOver:function(){if(ht){this._lastX=ht.clientX,this._lastY=ht.clientY,Yt();for(var t=document.elementFromPoint(ht.clientX,ht.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(ht.clientX,ht.clientY))!==e;)e=t;if($.parentNode[L]._isOutsideThisEl(t),e)do{if(e[L]){if(e[L]._onDragOver({clientX:ht.clientX,clientY:ht.clientY,target:t,rootEl:e})&&!this.options.dragoverBubble)break}t=e}while(e=y(e));Bt()}},_onTouchMove:function(t){if(dt){var e=this.options,n=e.fallbackTolerance,o=e.fallbackOffset,i=t.touches?t.touches[0]:t,r=J&&C(J,!0),a=J&&r&&r.a,l=J&&r&&r.d,s=Nt&&Dt&&P(Dt),c=(i.clientX-dt.clientX+o.x)/(a||1)+(s?s[0]-xt[0]:0)/(a||1),u=(i.clientY-dt.clientY+o.y)/(l||1)+(s?s[1]-xt[1]:0)/(l||1);if(!Ht.active&&!Et){if(n&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))i.right+r||t.clientY>o.bottom&&t.clientX>o.left:t.clientY>i.bottom+r||t.clientX>o.right&&t.clientY>o.top}(t,r,this)&&!v.animated){if(v===$)return K(!1);if(v&&a===t.target&&(l=v),l&&(o=O(l)),!1!==Lt(tt,a,$,n,l,o,t,!!l))return j(),v&&v.nextSibling?a.insertBefore($,v.nextSibling):a.appendChild($),Q=a,W(),K(!0)}else if(v&&function(t,e,n){var o=O(A(n.el,0,n.options,!0)),i=H(n.el,n.options,J),r=10;return e?t.clientXu+c*r/2:sd-wt)return-yt}else if(s>u+c*(1-i)/2&&sd-c*r/2))return s>u+c/2?1:-1;return 0}(t,l,o,r,C?1:s.swapThreshold,null==s.invertedSwapThreshold?s.swapThreshold:s.invertedSwapThreshold,Tt,bt===l),0!==b){var k=I($);do{k-=b,D=Q.children[k]}while(D&&("none"===_(D,"display")||D===J))}if(0===b||D===l)return K(!1);bt=l,yt=b;var R=l.nextElementSibling,X=!1,B=Lt(tt,a,$,n,l,o,t,X=1===b);if(!1!==B)return 1!==B&&-1!==B||(X=1===B),Ot=!0,setTimeout(Wt,30),j(),X&&!R?a.appendChild($):l.parentNode.insertBefore($,X?R:l),x&&Y(x,0,P-x.scrollTop),Q=$.parentNode,void 0===y||Tt||(wt=Math.abs(y-O(l)[T])),W(),K(!0)}if(a.contains($))return K(!1)}return!1}function F(s,c){V(s,p,e({evt:t,isOwner:d,axis:r?"vertical":"horizontal",revert:i,dragRect:n,targetRect:o,canSort:h,fromSortable:f,target:l,completed:K,onMove:function(e,o){return Lt(tt,a,$,n,e,O(e),t,o)},changed:W},c))}function j(){F("dragOverAnimationCapture"),p.captureAnimationState(),p!==f&&f.captureAnimationState()}function K(e){return F("dragOverCompleted",{insertion:e}),e&&(d?u._hideClone():u._showClone(p),p!==f&&(S($,ut?ut.options.ghostClass:u.options.ghostClass,!1),S($,s.ghostClass,!0)),ut!==p&&p!==Ht.active?ut=p:p===Ht.active&&ut&&(ut=null),f===p&&(p._ignoreWhileAnimating=l),p.animateAll((function(){F("dragOverAnimationComplete"),p._ignoreWhileAnimating=null})),p!==f&&(f.animateAll(),f._ignoreWhileAnimating=null)),(l===$&&!$.animated||l===a&&!l.animated)&&(bt=null),s.dragoverBubble||t.rootEl||l===document||($.parentNode[L]._isOutsideThisEl(t.target),!e&&Ft(t)),!s.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),g=!0}function W(){at=I($),st=I($,s.draggable),Z({sortable:p,name:"change",toEl:a,newIndex:at,newDraggableIndex:st,originalEvent:t})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){m(document,"mousemove",this._onTouchMove),m(document,"touchmove",this._onTouchMove),m(document,"pointermove",this._onTouchMove),m(document,"dragover",Ft),m(document,"mousemove",Ft),m(document,"touchmove",Ft)},_offUpEvents:function(){var t=this.el.ownerDocument;m(t,"mouseup",this._onDrop),m(t,"touchend",this._onDrop),m(t,"pointerup",this._onDrop),m(t,"pointercancel",this._onDrop),m(t,"touchcancel",this._onDrop),m(document,"selectstart",this)},_onDrop:function(t){var e=this.el,n=this.options;at=I($),st=I($,n.draggable),V("drop",this,{evt:t}),Q=$&&$.parentNode,at=I($),st=I($,n.draggable),Ht.eventCanceled||(Et=!1,Tt=!1,Ct=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Ut(this.cloneId),Ut(this._dragStartId),this.nativeDraggable&&(m(document,"drop",this),m(e,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),h&&_(document.body,"user-select",""),_($,"transform",""),t&&(mt&&(t.cancelable&&t.preventDefault(),!n.dropBubble&&t.stopPropagation()),J&&J.parentNode&&J.parentNode.removeChild(J),(tt===Q||ut&&"clone"!==ut.lastPutMode)&&ot&&ot.parentNode&&ot.parentNode.removeChild(ot),$&&(this.nativeDraggable&&m($,"dragend",this),Kt($),$.style["will-change"]="",mt&&!Et&&S($,ut?ut.options.ghostClass:this.options.ghostClass,!1),S($,this.options.chosenClass,!1),Z({sortable:this,name:"unchoose",toEl:Q,newIndex:null,newDraggableIndex:null,originalEvent:t}),tt!==Q?(at>=0&&(Z({rootEl:Q,name:"add",toEl:Q,fromEl:tt,originalEvent:t}),Z({sortable:this,name:"remove",toEl:Q,originalEvent:t}),Z({rootEl:Q,name:"sort",toEl:Q,fromEl:tt,originalEvent:t}),Z({sortable:this,name:"sort",toEl:Q,originalEvent:t})),ut&&ut.save()):at!==rt&&at>=0&&(Z({sortable:this,name:"update",toEl:Q,originalEvent:t}),Z({sortable:this,name:"sort",toEl:Q,originalEvent:t})),Ht.active&&(null!=at&&-1!==at||(at=rt,st=lt),Z({sortable:this,name:"end",toEl:Q,originalEvent:t}),this.save())))),this._nulling()},_nulling:function(){V("nulling",this),tt=$=Q=J=et=ot=nt=it=dt=ht=mt=at=st=rt=lt=bt=yt=ut=ct=Ht.dragged=Ht.ghost=Ht.clone=Ht.active=null,Mt.forEach((function(t){t.checked=!0})),Mt.length=ft=pt=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":$&&(this._onDragOver(t),function(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move");t.cancelable&&t.preventDefault()}(t));break;case"selectstart":t.preventDefault()}},toArray:function(){for(var t,e=[],n=this.el.children,o=0,i=n.length,r=this.options;o1&&(ge.forEach((function(t){o.addAnimationState({target:t,rect:be?O(t):i}),j(t),t.fromRect=i,e.removeAnimationState(t)})),be=!1,function(t,e){ge.forEach((function(n,o){var i=e.children[n.sortableIndex+(t?Number(o):0)];i?e.insertBefore(n,i):e.appendChild(n)}))}(!this.options.removeCloneOnHide,n))},dragOverCompleted:function(t){var e=t.sortable,n=t.isOwner,o=t.insertion,i=t.activeSortable,r=t.parentEl,a=t.putSortable,l=this.options;if(o){if(n&&i._hideClone(),me=!1,l.animation&&ge.length>1&&(be||!n&&!i.options.sort&&!a)){var s=O(he,!1,!0,!0);ge.forEach((function(t){t!==he&&(F(t,s),r.appendChild(t))})),be=!0}if(!n)if(be||Ee(),ge.length>1){var c=pe;i._showClone(e),i.options.animation&&!pe&&c&&ve.forEach((function(t){i.addAnimationState({target:t,rect:fe}),t.fromRect=fe,t.thisAnimationDuration=null}))}else i._showClone(e)}},dragOverAnimationCapture:function(t){var e=t.dragRect,n=t.isOwner,o=t.activeSortable;if(ge.forEach((function(t){t.thisAnimationDuration=null})),o.options.animation&&!n&&o.multiDrag.isMultiDrag){fe=i({},e);var r=C(he,!0);fe.top-=r.f,fe.left-=r.e}},dragOverAnimationComplete:function(){be&&(be=!1,Ee())},drop:function(t){var e=t.originalEvent,n=t.rootEl,o=t.parentEl,i=t.sortable,r=t.dispatchSortableEvent,a=t.oldIndex,l=t.putSortable,s=l||this.sortable;if(e){var c=this.options,u=o.children;if(!ye)if(c.multiDragKey&&!this.multiDragKeyDown&&this._deselectMultiDrag(),S(he,c.selectedClass,!~ge.indexOf(he)),~ge.indexOf(he))ge.splice(ge.indexOf(he),1),ue=null,U({sortable:i,rootEl:n,name:"deselect",targetEl:he,originalEvent:e});else{if(ge.push(he),U({sortable:i,rootEl:n,name:"select",targetEl:he,originalEvent:e}),e.shiftKey&&ue&&i.el.contains(ue)){var d=I(ue),h=I(he);~d&&~h&&d!==h&&function(){var t,r;h>d?(r=d,t=h):(r=h,t=d+1);for(var a=c.filter;r1){var f=O(he),p=I(he,":not(."+this.options.selectedClass+")");if(!me&&c.animation&&(he.thisAnimationDuration=null),s.captureAnimationState(),!me&&(c.animation&&(he.fromRect=f,ge.forEach((function(t){if(t.thisAnimationDuration=null,t!==he){var e=be?O(t):f;t.fromRect=e,s.addAnimationState({target:t,rect:e})}}))),Ee(),ge.forEach((function(t){u[p]?o.insertBefore(t,u[p]):o.appendChild(t),p++})),a===I(he))){var g=!1;ge.forEach((function(t){t.sortableIndex===I(t)||(g=!0)})),g&&(r("update"),r("sort"))}ge.forEach((function(t){j(t)})),s.animateAll()}de=s}(n===o||l&&"clone"!==l.lastPutMode)&&ve.forEach((function(t){t.parentNode&&t.parentNode.removeChild(t)}))}},nullingGlobal:function(){this.isMultiDrag=ye=!1,ve.length=0},destroyGlobal:function(){this._deselectMultiDrag(),m(document,"pointerup",this._deselectMultiDrag),m(document,"mouseup",this._deselectMultiDrag),m(document,"touchend",this._deselectMultiDrag),m(document,"keydown",this._checkKeyDown),m(document,"keyup",this._checkKeyUp)},_deselectMultiDrag:function(t){if(!(void 0!==ye&&ye||de!==this.sortable||t&&w(t.target,this.options.draggable,this.sortable.el,!1)||t&&0!==t.button))for(;ge.length;){var e=ge[0];S(e,this.options.selectedClass,!1),ge.shift(),U({sortable:this.sortable,rootEl:this.sortable.el,name:"deselect",targetEl:e,originalEvent:t})}},_checkKeyDown:function(t){t.key===this.options.multiDragKey&&(this.multiDragKeyDown=!0)},_checkKeyUp:function(t){t.key===this.options.multiDragKey&&(this.multiDragKeyDown=!1)}},i(t,{pluginName:"multiDrag",utils:{select:function(t){var e=t.parentNode[L];e&&e.options.multiDrag&&!~ge.indexOf(t)&&(de&&de!==e&&(de.multiDrag._deselectMultiDrag(),de=e),S(t,e.options.selectedClass,!0),ge.push(t))},deselect:function(t){var e=t.parentNode[L],n=ge.indexOf(t);e&&e.options.multiDrag&&~n&&(S(t,e.options.selectedClass,!1),ge.splice(n,1))}},eventProperties:function(){var t=this,e=[],n=[];return ge.forEach((function(o){var i;e.push({multiDragElement:o,index:o.sortableIndex}),i=be&&o!==he?-1:be?I(o,":not(."+t.options.selectedClass+")"):I(o),n.push({multiDragElement:o,index:i})})),{items:a(ge),clones:[].concat(ve),oldIndicies:e,newIndicies:n}},optionListeners:{multiDragKey:function(t){return"ctrl"===(t=t.toLowerCase())?t="Control":t.length>1&&(t=t.charAt(0).toUpperCase()+t.substr(1)),t}}})}function De(t,e){ve.forEach((function(n,o){var i=e.children[n.sortableIndex+(t?Number(o):0)];i?e.insertBefore(n,i):e.appendChild(n)}))}function Ee(){ge.forEach((function(t){t!==he&&t.parentNode&&t.parentNode.removeChild(t)}))}Ht.mount(new function(){function t(){for(var t in this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0},this)"_"===t.charAt(0)&&"function"==typeof this[t]&&(this[t]=this[t].bind(this))}return t.prototype={dragStarted:function(t){var e=t.originalEvent;this.sortable.nativeDraggable?v(document,"dragover",this._handleAutoScroll):this.options.supportPointer?v(document,"pointermove",this._handleFallbackAutoScroll):e.touches?v(document,"touchmove",this._handleFallbackAutoScroll):v(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(t){var e=t.originalEvent;this.options.dragOverBubble||e.rootEl||this._handleAutoScroll(e)},drop:function(){this.sortable.nativeDraggable?m(document,"dragover",this._handleAutoScroll):(m(document,"pointermove",this._handleFallbackAutoScroll),m(document,"touchmove",this._handleFallbackAutoScroll),m(document,"mousemove",this._handleFallbackAutoScroll)),oe(),ne(),clearTimeout(D),D=void 0},nulling:function(){Qt=Vt=qt=ee=Jt=Zt=$t=null,te.length=0},_handleFallbackAutoScroll:function(t){this._handleAutoScroll(t,!0)},_handleAutoScroll:function(t,e){var n=this,o=(t.touches?t.touches[0]:t).clientX,i=(t.touches?t.touches[0]:t).clientY,r=document.elementFromPoint(o,i);if(Qt=t,e||this.options.forceAutoScrollFallback||u||c||h){re(t,this.options,r,e);var a=k(r,!0);!ee||Jt&&o===Zt&&i===$t||(Jt&&oe(),Jt=setInterval((function(){var r=k(document.elementFromPoint(o,i),!0);r!==a&&(a=r,ne()),re(t,n.options,r,e)}),10),Zt=o,$t=i)}else{if(!this.options.bubbleScroll||k(r,!0)===x())return void ne();re(t,this.options,k(r,!1),!1)}}},i(t,{pluginName:"scroll",initializeByDefault:!0})}),Ht.mount(se,le);export{we as MultiDrag,Ht as Sortable,ce as Swap,Ht as default}; -//# sourceMappingURL=/sm/5d7e5cf4455b72a57c7259b1d7c4fa1fdb9f4cd69f516cb0361cb58f3f33668c.map \ No newline at end of file diff --git a/modules/ui-module/src/main/ts/src/js/modules/filebrowser.template.js b/modules/ui-module/src/main/ts/src/js/modules/filebrowser.template.js index 1c274cefb..3404feba9 100644 --- a/modules/ui-module/src/main/ts/src/js/modules/filebrowser.template.js +++ b/modules/ui-module/src/main/ts/src/js/modules/filebrowser.template.js @@ -20,7 +20,7 @@ * #L% */ -import Handlebars from '@cms/libs/handlebars.min.js'; +import Handlebars from 'https://cdn.jsdelivr.net/npm/handlebars@4.7.8/+esm' Handlebars.registerHelper("patchPathWithContext", patchPathWithContext); Handlebars.registerHelper('concat', function (...args) { diff --git a/modules/ui-module/src/main/ts/tsconfig.json b/modules/ui-module/src/main/ts/tsconfig.json index fd9ca7f79..db6dc5877 100644 --- a/modules/ui-module/src/main/ts/tsconfig.json +++ b/modules/ui-module/src/main/ts/tsconfig.json @@ -10,6 +10,7 @@ "checkJs": false, "lib": ["dom", "es2020"], "sourceMap": false, + "declaration": true, "paths": { "@cms/modules/*": ["js/modules/*"], "@cms/libs/*": ["js/libs/*"], diff --git a/test-server/modules/example-module/libs/example-module-8.0.0.jar b/test-server/modules/example-module/libs/example-module-8.0.0.jar index 29daf763b518b2872b31f916fef9033f5ebf036e..3466ef724e90575e6a420332b17713981640a049 100644 GIT binary patch delta 12256 zcmZv?WmsHIvo(zC;5N9sYjAgWhu{H%LvR>$kl=&6Lm&{`A!zX6ZowhAOGxq&?)!Pp z$$7u|v##FP>fYV6t5;W5S6CACR2npzx)LlL3KSF)6jX(8bRrrJ>>uC(!wNY@Cw8*F zzzO*ufM7r~zMv5F%VWq}XkOSt-)Kk?w8#r?LyQ0E455QzdO@u|^~lwL!_bh^ zn1lVKCMr+Gx!FVhEuJgalfc9)(YE(-GB?Bh$JcE4y@ri0@&I^__;8v`plR0hoXVkr z@zV5+%Bx8eyYM(9kJ^c~B9@D3gE|MO2<@`M2EteT zsJM}wGA+oocwRvLU`ojN9AcBvpo0}ZYkhGBf>aq8&M*q!QH>?ywDf%8p;T&V7`J3N z2kmrasteTX@O2L*amfeGu7R^S*;q@|9P8*F%9U}%m|DujML~-F5x9E1L|(p%_yu_g zcZCn5smNVc0$_VEhzIsU1B589Fs(xN&uxyz*&pVLL}WP&A(-<%T>3@c3H zt`wgv*)vsWJO03PBX$k=r3Z^`N}S1Av58RUst3XfTu4%1nKs-M^$N!pwXStk0e3Ot zAD7?J{X%;yEC}$)Nz{ZN*)OU4k&m|B0tx%dam}m}c)+-Vm*Szr!@D{lLPVG~NCrf& z7`6BFbJIJpK9M;!NKW4@Ol~(HE_WXC?YqIC<)nw1X;xBvoI|Nc#|Xjk?+_vV+3ctO z!5{R7*{SS2s6d1)T2?qhkWld8(0mdlm;MQ;2B#ow?LC)JNY6Q3<2GMymmu@?Lvy?s z(hPtaq*Fj+14K~Mqy21cO++_JrT(5vom2NZqhK%pYYFOFm@Xs3E#;G2?eg z)50Hy@2nuO0pi6hGIfIyk(0_Lnto&q~zHT??^ds<&MD1-*5=I1@S!h z2&IvtgQ#QJIqx0O9<`vYt3Q;+x#EGK{%msG=S_|TRrM~~==IDY{4NX>R3!owlp5p$ zngK!}$pos>TG7Ojz!bruK&ITp{#1^%j)RLJ6N4?yh*HTAYAEe}(L=;%3AAVbkYj-I zTQRTL{~Y#-VRU^BlMjxO%s(UJR3PB-+GFBOObi6A-&YCH1RSOAyNtRM_cBcErWUns z^THU}vtfkI)X`$#zJ4EXRN?ecVXgZS)A$Z%BMI~tQMN5}4Dd+E)ag-J5?O&Z?Qbnd z{93;h=dMSqdYEFo#?9Ad67O?kU@4eI>c*dkGx&7AC&5&+nrjpgP;$v9^}AvrLEyR| zVUWTNK+U^5;uTy^{WIQTFcmP6`3Bj~=$@%zwUrl(&q}u%TCs9e%%ZxZUP9K; z*kNQE?X0F;?acu=apSgCeBEX{Lrn%-!)z0eC8<{r}oVq!>2wP+Y z+>GpGNME~}Oh{X6Y3->V`uf2QaK=SQzpcLbjP0YyYinz~seX}h%db9?dQDpLPC1KS zmI#5HnK+t`cjdAHCFAixY(K93M&J|>>!x(im3_E*nwwaZW6tCm1{ZVx&f>8=Yadie zB~Yg=FG%JLRyak{<0+ZgrWu4KZ_W$O!C_?xd%z%SvGZByL(E^yVQCRv~5j-m!0RwWqw} z2(+ExjAqL{&6EntX^xduh|BDK2@6tx!~D-~cs{<2peeGcZDF7gphV!Hp!oi52avV5 zxuc7NHLJO$hn=$%o4tF0){4^>2WG%NvyG9CI6N}ba++tOCceabX~vNJXgP>7wq6|R z5;{-CYKk1_sC^sZ3SyZ7G$^ciH6?Q^M>l z*K`3bgljS82c{d0R9ZHzNsz&D0gxD5OR!?4aXt0{_e`XjwoSb9HY-mBI80$O-OZAB zV*x+d$czgu1z|boP3(3-qhV=z4?Yt9J3DdfU;BZr;eN^G89_Ro1j51aYU)IAHY5#h z?@POJZ)4@gvcW2q&^8rL;TTW?1H2^a#E%iK?GcuC0*K;uzGH&BMB2M90idLnAhTNl z8p)3HuL(Y_Z_}fU+A^sqTQm?kHn?Lf`%nW`gt(BTO&>BbVMoizR3Y!U`6FAxvr~p8 z{OCgOZXCR_TvrP^%S?rpguuabeiJn^BlK{;TGjr}hBk^yqYnd6ihZQ;oK>NRU9bt#PkFGSJEFA+%L3cw~R1T~*2 zH3lQox}QOkCQ@kLT>*;gU^x!(eldKka_T$x7Dj0O2wQTco-MDOu4loIE-PWKbTNb4 zVcc>E5Ypx-VeJqo8Pw;r+|04jPMK5@-SbILw$ZP6TJU! zmu_bTW59|N0c$ck1iE38Elk|&yWXsV^}uS^fPpQzTn{J5ZabuC*hf!CG`&9azb$K9 zM?PU2t;)xl&1s69(Ov6#BN_Fj=4k?V85Tz@s8khOu}}hMyqR5oMH_t{{26ZA@JG^W zuQw0T!>(7-{rbbRLq_-?vHs)j$Thag2|bJTmuKr#eDQY9We_23+{7R@O9yjz_bM$D zH5>_C5dxI<U+6<0LuhSLDCZNtt<(rLDS3MFwQCK4O4#S+w=mA- z2+x{OqZB2{7b9AQyiP^#R)yXK{`_@;BaVZHY8j>%haOfWrAMR|(Tj|YW!t=8DP4|3 zDBXoUUJy_e^YEm57o!OBv^scXa>@nb(Pi6E%6Z?4CB+EK4u@dZS}OCv@lUKSnA##i zCORj%*^#$XzC%+smzbms@|U8dchi_x?}podA|Uy2pCf#USFku8ca33nT=HWqgWH6i z(xJJ!@PmqESJ7B?3>Et^=J%BE@GZX^(q)_tTV%^)h;j#oOC4506#83`xPWHPSeey2 z7l``2s~p4NU7>W;c5?N>C5a4;%BzIL#WyQ)$y(ixEEh_jddK1}13I}J8j=UObf@34Vd1k`1SF{Ln?qN6_dh07 zD|x>rY)u*c#G+#jl8t}A#DL>~#W?d=Fh6^hc1TNJVn}g}WbG z>-`(?f3)zAv1!wF`Y${i+aWv@l*YftMg&2_p#Wh@NQjHKR#Fw3i^CVh=)(`e z3hP70695jL+h4;*#U2WGfA(OU7qR%g!it9JXR4}NJ3JIv6A5VZ13f+6l8U2T;a322 zS4@LfalgdVp{54onUmeMdy|XQ@L>AQ-s5oGi23DU& z2Y`A=H}~#G$Eq7*!wta~_2$wV8j;cT<5ypBAGiXTz5+jn%o^^{NVz}uAGTejWGQjY z?nzOEMwf|*4VIjg7pD5_5xMs_Uf-2WEbL?@&C)&4hp}n;`;Zk|CHE18Z(D_RrjaaL zM3$mE8UWlT@vAu+vW<`L!zk+xtgS^NV?aQb*|{RZ1=a?R>u?u6pVhCZua%?@)$w~L z*i!EV!MY8cvmML&z9IvY8KRaN5_Cl^!K$dFWen`~I8p>oT(i5y2K-!_+#ZAMo;(em zm@=su5p=~eqF5z~e+~QgH@8D@%Q2it~%6*)? z92NO83GyM=)ObRH1;B!)QmoAM+-MEiOG3X`$hMA*aW;IJP*v&HT`(Nxt)S3b4Jg6m zk%eu_;}F>jk4%S~cauJI)_#Kl z)Z(T2vkFSSRj`!u%6dq{=HSU?gK=$8++p)u&QB|?&Ri$*%?jNt0-4|q-$YI?i?<`4 zSlH4G(+Nnv{UJ|t0j+Z8dV;h3`P=+~9$<2KWzr+EE0{5%cq&^Wq*!_h&}R#TmbAmQ z+~G^$KMg@6%5<%@gFG~u;+L)mTGgpz|#l_sJ7^=T~?8THR2Bl z-&k@&%>xmi>?fF)-_H0LVW)h9_JR4q^?lFITTaOuSoc;_q5f+ETgn}fOXmay)ef-B z8N|{juflXe>A)NId6YQUjA6c^uT$i7^dOs`druqzkg^Qg_|VI-io16`#G%Wyfd0VQ zEK;56xpuF~%N*JwRpK^hK7`{tNKoz3Qh;Kkwh1ao%|J=7c z4R=lZ!2y6(n5;OO^y)VvYz+J!4X&1k0feJfshIh%2eOX^d%~jDr%#y28G7bQR#*nm z92*eIKGI}Ia}5D9tkWpwW# z9)MLI@KW2PJSkLF9xRjd&OTsI`V>~yZ$ziYQ;Jt{0#Enre|e;TR2Z$@bINJ<*&3go zWmxaOXa18E8>mYApCAo3IJ_n#Bq*qGl?ORZ=OP47JqZOSr58H^(YuB&i}L?Zl8ePH zQ*`aQMLNrz%i8Z&?$}>LTX8t&$8ENr;IXc_Ul}V+G#(e$MVodVBUwjDnX(A6&1TXoo*CaMD{`7N_o8Tr%sRVN{=k z)CFElnBj(Nc2EG9>*;^ZH?XfsCKb5S!*LDi&tIXY){q)#_AaAgHzuFog*#V8>sc3g zT&f}I6i#jl%Nr;SD!LC2yZW&cZdgUypgU@yOzR=Aad>3Yc!Hk5lu5Ujg@pZ~$gnEo zwu9ENqySjT)s$T8Gnd!MD!b}+^a&TE?qeeJ|yhU)wU@d?Hz z=Hv8(J{@pr$m9oVR$M92@m<`O(FcY{*S_wXJb3t;ZZ4hmb^NX{;q9{A(b$^rQ z#j!w*6)M`+X~rxP#PI*{A!4R>+}&i}X#_#aNVmJ<0IM^?i3c}n-M(_diLcBz7
bSAcX2l8)RM6Ik!994?A{Q!nqnu2D#X^N(I4T;!Boee0bD^|DdT^QHp!xy3KN^ zdneQsd5L2vT5Y}i@>Bl6B`l@Nf%geNlI!T)jN0<$2nb@NI+K<~uf~Z>TT>_!OJOgFvmk7)*)+>h|5^DB z#c3Oz5+{(V!;x*iE!|)>(b%mxOj9g|TCGcK7`pS}v&C!L%&?K_d9LM)aL#FdZ|VD* zYsaNVu5Xz*F6UwAu7}Jd@;E<+O+LGz5Xea|oGDoPakXwBVDy|p4X0VhpNWBtBB;|6 zfqJ=lMdv9w07Zu@ySgZ@m65P+eQO%y9;W*0($z+7D{egaipFJ(+4u?9ZDOau3>-fJ zYTZuUc0YsR_dI)`uIL4B96LeI_kN5=qGTLSF4;Wyz$04@QR|P~qEd-|P$-Aqus33V zpVDPrJ^PVJ&%$W*oVhakZ|av-1_jipZS*G$`h{TIT=gCv4wwBKd@<`tg}0KuKh#@W z%><;&Ahnq_WR~Nvvulh!zjs1uh;YcBpnoxJXE>&yG)_sI?z!Fi@B8nsaPP0&6@7wY z^0qIC-;Ax49MqZKUe=p-?OQ}nSpY~MN5Ycv!E9<9{s8Bvysa%1#?nS_NC4%sH$$Y9 zC!??Dli6=Pbly+)LiJ6uZS1Rd?>1c-wlG}+5oj>r`{YmVXWHTzlrzj5)Q@e*^b7qB zICdP06KsYS{26t#%uS?;JIH7@lSe~U$R76A`D_~O2Y?0kS9}PZ{WW^!ISQS-)wA3} z!t0#Zgpa5L6_i}|mOx8@5$KI<@kj#xS*CC#;TIIr2GcpO@XFBv);`PLFZ^uWaBl{R zj4Ui}$I`k2149gqYPM|9f2KFM!fQoYWX(!3OP(<}$I8v}8%k?yJDKoO>vdd@zc#&p z<#a{IC}X0nI4HOkt9#EMK{#gEGS2Z%nb}_PB%*Nq^NC$i5S3KZFK!S_pZOcsu2nt1 zUOOLl_rt`58QzlH%-GArBsJJq>#zDzvDyN0%TCv#% z?Q~}7piH&w!fX#AN7DnO+Ed6Y)l9gYQJX4C`6CfMfM4#dASYX|Dog%?;5{mr68_a3 z6X~X~3wFPtcwh1j&jHMN0irDl!Ad@iK@6)_rciH*DTC~%U8WpB#jNbE;%k>Go;$*& zKC!Lptm#-X*)-y)3p%GMCx}*5vSoT7=_>80yk?K^sd$Q&eglkk*y%&CbpeM`L6xgMp(6Uwg-g+D|JJVRBM%n{_)Pp znY5I<$fkPvk5`_f)5`Ib2Gh#pM&|Ok(JO$QN?n!WL~$Zvl zYKITT8+&p1*_PI2%|)#MwGq9x2y7@!0dTNnZO7#<)Zo3mS%@)};1x!Z&n!^Hm8 zt)|Cp>rw)9ZczqW$#4PaG|OJzN@P8G852+;Lle&C>>5EF!c@{wSUvf=m$%Rx<#W#( z=~jX)`WoX7Vex&Efc=RXf)vo^V5_N$oGT``V7*uQu*We*zNK%{Zx2iuV-fRc`D3wWVr>o|nK1aCWx5w2C=p(0;;=XL-7kYewi@1=$bowV6&eG4%shH&Jh6FO zdhYo#GwTZsKJ5@-yG)taePbENO`wBa;8IXeWK>}6+q1G=1Iw7edE-^_)YRu_PV)z- zSqw(=xz5cWjy{86LQ`Ll14}yin-=X&cH2y+gbS|eIVU*gY%*8IobcnP^9N}|k(D)f zwpr*1xjw0A@mC6ZnQSUDa4MTth+>!DP!qIIJ4kg2-1&(`V37FY&s^ z%n~enP^i4+(pD{qm{;BruS=tmB7YoaCVoT@qj(2%f|Lu2b{+~4{&I8aaQX$=3Ffsc zb1+7|ocS_TGdm4uDDGZDnFh-Fm4-u19@S1)!l`$*(DW+oXlZEgK>xnwR@Cb3l)$pP z%JYR-+O`b?K}lFBmUC{6i*LtG0;y(zyjJ`-I{--c_r`U;Dzas6*dd#uIiGWh-Pa1VAjC)nFk2 zap2_J2(~@^G zb|mCbdknY$h>OZ_%WOyRQ#*a`bnAUW3XW8z0y>4E|x+pi)vi$VoZ>2ufab5}9Z&#fd< z%@@pFYVygygkAG-bZ?xV6Ur`Ty9d8k)0lhUmb+U!SHFO(32U(5pHW$}tLhtUYVg&$+s^58KYms~`|P;V?^*Q=i)t%;3|pjl6|%Z8SbUiaT=c|#o^VRVDInnFz)%EQFaI@ z-~Xbc!880&On7*2fjAt$=^AZCwQAhMFzm4qe9bs5O&D_%vO!Hq$4X8)BP`kE6A6k^ zOFuQ+V<(76A5AAU-q3$MFS>@2mB+{GWBO7HCR`mrTctLTM!vfUx~BdZF=^Aj>o-~a zd_cy0rPl9NNz!16$k17(5>Yu~L782|<*W%3dVV?8oH5!@lnv;=HLb+*gR8~AFNVg$<4k<1Np7C3rlboTQo zPY479?4LmS4sd-jUkd)dp7fZ_6?L6?n)W_XrF1 zxr9$(s*1>7=`>ghJ&5hL(}Hm_o?eoU8KcX?Ww6E+Hob!5MdImO=Ic_O%Aty3k!BsBij3zo0FeQWX#b@ zzX^{5isN$V%)8mm!3D;B@Wu)N7?mSh0${7Dhw#AbyhfbSO?>vqzw$BhZd^4DP3)tI z3y-fx6roFTJDP0E&04+paCJju`5bjs1Pv7vs)yp2`z#f4Lfv)cHy8Obk zPlERITAm}x{fefVEkQ~sY+P1v@ijT4IbkF|Fs+2_1!P)a79t(7I%{Au5XgRwPy>r(?^L;`I_jU z$)%T@xz!a-I5y46aYjrg<+o?gmi4Juc8ak_=Uajt@oggt#=>xs&qfmR*{HI%POIx( zd;}wER;c;i7wU-KtwA90c9tVZzB{H0lxRr|V_};*&?v0yOIF}8jHeYi(yrwD4pBWm zuFZO5M=DjA@Yadv215}|+ecslFF1cE)4iyHnFgXx{4{?}}w(MEs%&rwt9 zT*{k|@0mou(C=s;ibidorTipRk{zK2NW95iW%hftr=Q0rF}l77t;8r-vuBxff|$AK z=quN!BQXr8m?t9GwT0u?@!|7uf=ibP2R8%xHLYUHb#I@wyVM2WGYJP+4x*!MdVz_%9wq!YZ`2SBXzKqTdq=y)5O0gKT^&v0$sR zY-tfEu~9cD>`ANWPYZ8GRG6A_uR-%hi=G5R)x~+OQE$>}+UeJH3aprtoeDiRdIH6N z{c3V(h@FL=pj6mgi8Hm}SEg42Ar-Q6;fBg@A)#Z@zpa84ly>$>t6+YlrmT5=(4MH< z>4(f-d_$Yvg6NA;{MxiPqf6S)0(t+)dE1Tj)V%PMIjFF66QiRmY}hDW&;>;72@~}? z&Adc`&?T9IM2g_?;8=`IQjjnsl5&`xTmr~U3bTt@6DKgHHMCMgfT~ZUVzLNszCdry z>~1fJy*m#i*;R|W;`WdFbpFn^IgYIWu#u0vvE}z9e|L~)@yhE7^>0BI?-VL7diDq+ zpFIK@C@4rhH1&%X3v-ZwO8!ltN>M~9B?I9HP+vj6%4b<;SCTLf>#gu+w7d{q0$7=Q z(KiYejJ-a5uY2(gQ9lr3eMU=1qzu0rahQ=SS~hWgJ9d{hxB=y0&KgPyMpJ47({>W+ zHC+Qn(Exh$nQ=&fi^O&`IiOMPTHiMN0<++84sVw^*_N#vsRP&fQ{upViTI)l=C zq4w40zIR(By6=Q2WOjcGrwu3E;Cuj#J|g>XVjaPqisl%sj&D&(Rp&@YiQ|>8r@6Jn zxPr0PZTVS2V7$)7G`AU)oD~)Jx>7K6`q($7zAZCJw-)dbfMEGe3ojV2)d>;@VU84)Y|cAC#sWJpRG24h?? z^fI}~65M`K(%>nVoS?&v94ef?{yddA`v&5-mM)o~M$^tC=_(zondbf`(&_P=ldhD6 zAj;p8ig=GipTa9f4fD;By}0!0{OQ9_NQb4&lZ&=ADK@rKlLDC|+Vuu`Ew&qN#c9>1a12f}Ovg_89R)~^?$lNU zZ%Uwpw9@HzehQZ!7Is|Euu!BGu;W9;h{zZw1}(5L-d-FJ4&Y)o?tx0hXp+jqit zY;uHRbSRD`K<1WP1)M*X9+!OuEa4jJgeXc}Bj6$7?`d~RpeFcw0iq5(` z6IBGfQ0}iqR^x9E&NB01Ws&P`NgPtZvk{dMG!(M9X5(ZW+tj70S*gcd8j$aHjE=tp zT(0#=3HNTxI=eT&P(|P4vpkH7q6q zU%Ts@-rYR^smovA5brfoJG1bjVPY{1Ka5{r=XT|suAhl@1;Qo_bOZ~6c}H0@Qjc(3 zQmZWuX{}RNB?s_FaOFC*o5C}ya@oV?2P>UqP#gPmLRdSF6Y=Ay>I*QjzoSWmfNW%r$^Iu~tJ$*RAR3r27ajp07n+GU}xHeIbQtI;~&sli#F zQ7+B9tV`?asXO=|ImLBIeLKb`a~8kSxD#|wj{|#2VVggE&GZ=Le9nK*`5Y*yh-9le zm>kr3YVi>ox=&*1nSQPWtH&v;}Sa|Twuu3-b8_L(o$4xHr z5-D`b9SIpfL{?9r=mjUl{%I?Ud%m>$#6!^k+)?~b88SpmB7oxmDXe^s1pf0Y4h{i8dMIfi zxRL@C|EuQgpOUlxu%59vcoyRiQT&}9`~Opfrmh4HgA4ml8Rwq~{8btB*B}YlkSQq+ zh#4jcBwq$V@rV3ZWyfD+ZoKC=GD9$>cwUJAy$OGgXvF>^`T$?n5Glp@Lj3EJ@-Lz^ z@$>7gk^g&<0}+$PgNY@3?#%)bMy7+5OJl!`@RH7dKBr%@`G1XYPw_9A9>OYv|3dyN zi~1M&f%=&&^52#Im16pf$VvZ9{IgOV2%6kKQ}`=+@E5s*@xN1umnC|c!v78Q{=+X0 zPGWgpvGku&$^WeS|2QE3;XQxe=L#;l=Rbji1kx(`&xiRV?TgQU0^GB+V(?$)A5&20 z{r4;4KUd)3LD1xxVDk7OXZ)fNFL{iYEfXbA3?nS`{74>hDvyLt2So=pj{ya>EA(fa F{|`)xB98z7 delta 11672 zcmZ{~1ymf}(lyNBG6Z)C?l!o)yF0-(xC9a)gHD3W;O+#M0KtO=32wpNod5xXeuVqn z``+At{j=7rJw07@`gE_|`&8Ab@nk?qJOEu?2@W0=1_l`hro``K96Al$AK-?-eR_g6 zRybG9k8wvY{{R#N!1#%@CXa|-Xoum?@I zM3**zkUflO9tC)KJhfzy|2Tl8!c8Z94R@!}%hh6ZjIC0R(Zc1iZQOpI$;Bo1o(+to z-kZ;6HD;5$B#Tc5Y>T)f^EN&n71GKp3KEp+`*cxAZfVC11P{NV`k;zt!rN@lC0xZg zTEh5sq+YvS>s+!=>sLQsF7>iU)f#GXMkH6zgK7fFM>Xfk3NV< zbSJ)`s?=dIb1RVhKzp{5fF|xT&pHDHERVU(9gkeP1?%r3=wxpKu0rr72(JzwsW|A$ zzE;aH_Z7EwRku`ob*6G!InPs>PcAqp5GL`W7|r3DOfsQ5thaN+o8Aer?*Nqr+tj2# z(QAKVHMUB*o6+C<#OpG%+@iRrj?^0GDVfr(13A9FWd1f|l+~G6MZXfLNg(Ss*_9Gy z)Hv*F1+IsY*nGVgR)<-_E|}t>as|wu`Js7pG8ONN{SD=KhB3XfR8vVKzpjalmn4n6 zoxaPEg2WKvHD0d?ImGDNr{4d5pV4V@5HZI#<%TX1Twut z)FpjDE%P~LekTh3gx;s=waObk`Dm9Hjzb8)Zh+l26nPF*ooHp;E6M>D+byT&hGJ35 zcn}Niv9gXebaF`MgKEMDY5I!wtt}6G$`X5*6{=Rp@V8q6W58DLVZKfICDfr?Hm#p> zf-mn!-cyVlD2RM8&j^F_-e5T*Qd32xF}j0&-NI5^k{%N2K{Hro_4$Xw=$j_)Osjz& zyG(kjAs;}pX6wO0w)P{ZzmWVpxTAz_JmYS!MUabdBClM7cUX`c@gVndA3V9m3i}_u zz5$sNL%*MhMddJg3Q4tznzSep}Fj@ z?T;`4#KNPJu#kz^p-zqhm5nyMW_Vr`7@5h-HR*O2S^NV1fXPhFa z!zc5W>Anal%P%FS1QbUWu5kwLe^b5{u{v>nz}sdD{BFj96|nDO=-zGb28-iG`I}_L z+1=#>4{O5aLG(bm$adH&IU1ChM10lj{wqj>l4EXLL=ecKbLavS7zeRaD)PqwpX(pZ zRC(1`=Za7+B%a56NfSk#FRV|{bKH+48_xQvF$5y$7J7Q>V{cb`O2mO`4u_%<#d%8F zaNyNG;=9xQ{EaQ&H*G1O?AxHu6f{gp^`mmIl{WS<@_+%00)36!W>j|D|Dw{Z)Ro+4 ztR&i|CZDM4SEM+MIHsvroQm07a5Yo2P)KM&o-=kzAuqIiScDis;J}4@0)96D@WO4E z&o64V+i(}=mitk)(*E0q7VkThDrqx4;!U!|VCQa9<+T|WK=LYTZ5%wd-=u3BgfCpE z)8FTTIhNf=zQfB{E7z60$Zc2#(G|`a(W;9zMWU?ZH|RK!4XU;y*WS4c-VuFtPX^On zekGe9${P|dL$;;t2|Y(?-G!w9b&x*Tp6Yfe9y3Tcm93I5t{~;D0&w|qL%#n8Te>^~ zd5mkW1Yipj*>~vSYSp}f-;=NpfAAVOH4EE1lb^>J3Zw4`*p}h z@_pokMS_9pg@=Jr{AX=q0xvjEierkT7t|jVF%lZ)ED|$p>NZOY=fbel>PXn@U}=}M zIvvrvS^Kj3c5hX!hEg#71o+`vWbh|qCdMnyPDEcF8joaJ}J&e;D)@ zq45;M#1f-eh$`q-_jy?su=cjzgGvFv$tOR;Q+|IQzNQ8ZNR)v z=N#A2NL>cyXu zO=8H=)_1z3w;{7+TgZ>iGw?2$5lYZw;DL|JjtX7v#HwE*fH+CAB>Utl=y<^3pdg0 zjEB^>`OvNoXRuMljc2_4rc$R)9fUq@-yPXDgikx5e;?-c;== zS{9JtD)NG-ll@0Bcz=bcymrbEmsSewY;=fvjPkXAM)}j7MG=X~ZiAT+KjH^-7Q}0& zRcD0|L*gzCQY?IY2an;gpBDam(=6So#yE{HzR&JTRE3Hn(T|Oed2_Hz>1m`L8c{PY z|K3~+)J!)ZDdsRUAM3Aann$~m)Z4mc2x;NmEYsA3HH8|Ixky^~FDtb>5^>Iu<~t{hUyPnFOz;3RJ-+L01EhR8>&@3VyX&{tBf|5#W)8~U4y2%(7U|{p zWERd^st@27gB>`0O%mtp1g`+cayggr+@{E=3AKF1e!t5NM+RL@HrpD9VfB1SsI4SBu| zwc0EP9+|&i%f>x+VxfZ>^1$6#NhwMQKG;TInoQsjK2#pc}pLf^<19 z`r07`wI7>br$U}LTXN0&i(nUcNA{M4{@95%(Y(J>k#?9^s#$xPtd|4D*bA-4ZjLZ? zI2J^e(~+v#^rj=G5r=qBz&F?3a^9=yD5A)-2`iD*nX8qErK}=7mmZcW>Wfg8>vHL_ zOd*zz4j)3dz6#S%kRxBn*KQJW15}g#p;f)^$~Rb_)SnyrKfHDDok%|GZkL{I!MZA|%s zg~_9>L9f^F!+Gf}kD5ZkZxh@Z7W6yNn%QhOHOcm*)~42v84y-B*sM<`P8aUyvmZop z)MMPBWpre=HATP7XG?(OSUxE4;9AkpAX;MP@{&s8hvl!T5&Hl->sHo44Qe{hM z;s9^^;=!1o@T~~}lc9@O9%H{n?QU=dC6cs(CJH%omXRbePVMx_~$$?BwQ5$0DJ9G~)}Q^fi~bqu5yjwJMg7hlufX*(BPuVI}1UxWCDW zuFspUI{C!LyC)&m`$vd@&{z^4Flaq`v9G)D+W^<0z? z4%_2qMA8+KSVv6l;Zje6I7|72qEoZ&j^|azWZU_D-;4_kr@oyG95K4IGIwt3TIdlT z>w?F*vC?S$VP0+ctM)@=>oDq9ECOBMwGYF`ZhRCDCa}HFqffcy3>(9Pz`bPw`@V?z z3<>K9onwhh8%T@pjYic!>e-hhYw=j^crba!5uxTZ@Qo9n4^57lb5Z2pHfF2o{Rq$9 z+v;5}BZ34T61n0fMCOr^AquJ(OA|=#?9~EU5puQq4At9nXR~p>ebLe|mW&B}h2!5i zG-lF`xK?sDqS^s+-#vfI8^Ml3c%wfgXcjmEB;fRvjlW_3ytoUZb(Bj=sJ?_{WTm}> zTQhnsnJBCmXQ=X_eagz#(#T88W^|k3^`5@{F~5NG3H?U82GFvn<5L(YGJ9<8t+U!} zTJBrbX3bG9?%wruL}w1=EHc2W_^Ag6aN;kc8OBcMT~NP%Cfu}q8<-8P@PO<$?$KAX zdKvfPHsQp>enq|VqzHjEm(vU!)f8I~Tj(vPzMiSo^S5N?+?0{0L6cDoEC0Q%of_n~Y8Y zvh2T3{LML%O$4>)*Ax+6dfg7lnui=WnUA6D?V%nEHa`&ee+?s?G*%<=wg>d5?ee z-ITLC5f!oY(PtG=;}w^|$#!K0{RA93RTz4tFyiU%SL8S(=22onQkjmi=46K;H3~za zm!PZ=dHfr-@f)1KNuNIn8hwQ3kh_3i57yU-!y=m?+5cTG{s937n>#oS8T{9dNixaXQywpY6ak9rxPo+ERhSL#YM?_8Cv;r zFOY+2qVgqOB_X5Udu~noNSfm~pj;qFEeX2Ss)1k5#aIgksk9=Aq??hw^&4dHZ<~Y0 z5bWFpd92%F&Nu3m8ACfL`4YtaAs#3r6ecc*k8z`u!7N)gE>xxxM8BE#8#m3GAcOjp zQ=>gdYeljM&U%r^O}ip%I-jAPfn!ovDv!!HMIteEg5V4%p+-r5ea~MZU2I&)gJgwU z?};z1{b+6g)KRLN5v%$=-+OVu)n=+XlKh7(&9S_XpK`g0BC01coU+xAOLFn)qM9Nr z=1vy0;0{w$xbCbAgvvFmXM)xDWb6+IXTJ0PI(t;~cMe6F_D@Zztiw?v6{cu4xt^Zq z;`FRm@cH7pCzVfYGfkP@h3Y->b<;|j+&hof85%i`<9j03lizC-eze&^GBiKEHL{?CkY zH`1HBy-mZjnJbCH!#yC=ZxM`uG~`V;KFg(U|4Z8FnVL?LyV!i5=x5vefq{9wEd;3=LWdAWL3ho) zlsOiTVeud6R zW^YA^*l_)VkM!7y*d>(FKZ26$wQob3x|98C)u&j#O-|M7eRNO)8+x_+E*fW$l|jPM0$lZd)P0ptYexYYa)~GwI~e z7Rviv>W9jJfpv5)ct&W}&qQQI)PPoBsm@3sq(wO42I!W~?F{aP1%Mnqqa=BTd^GwP z*ffNC`tZGB5sQs}&*OeAaY4}nCq|F}sY9WO43%1C7QcR{9ffTr84)}XR|#pH7Yt;2 z9WSg2fQq!c>5flYq%#qH6h1-fbQ{%h3PRKdAZTQ1gi#*9FbtgBQ-wv}53oZPOC5g~ z`8a)Ww|R)#)czo&l~fx4-)AtC9qlyQ??ScA<9Q*;_6)rC1p-I7?#C)@<_> zbCQ^RFQwBGLLz5)pH%FqN0SDXhqT`S2)keT&N;fsIipd(G2YCQS?qhQ>HH;a3z{fK z)OcCK_$sX9;;1P8eM@&xcW@3|?}y3HFI(zAWKNc4(cd9!#%5^qgNU=Zlrt2k3t*?2hu8Hr>K~8%tHf2sDJyBRSrm7XEDrq*6^0D=J{Z$>l zdU%e3=KTPT1!|jBTMUv9w&=!YD(y<~RI;s4AZPFU|5?co7*u>WpLjeA#iWr0w`sqA zjw_`CSqsHW3;}omw7OROm&o&mQSdRqL%d zYDLItC+`!VJx-czkK4G!z}a^&)et=tPYSwRt}r%FE?iu#WW32wZhAcE2IFL@Mx`t- zjLrE&_|JUD)yec`U;1<#fQ3T8C{Mc*HAj@@Hq%1%*}k$;j&L*%UNs#ymD0Jm+S)>m zP~<;;8y}RYNUiFoq}(B-V6dpG-pRS_K@e7GiEP?j zpUsrnu#-MVQiF1YHX&a7l-5|9bBC7Hu$WUcn~#-ut9*UFbezFhx6*>-*L$OJln^=> zxAcP`!_u+uhIwLAYG4^B!o^>XnrB<<5)Yq~M57L-iAQhjhuJ2g22A2OR=&&g^`2do zh)(KRnagV{kLva`@6T9&QW+<>;|G?^6zvIC4p*qG9jEZnhax~qc)jz6(Fu2ZEnua5 zQhIQUv{L9+6=0Qon9K#j@PsW>_|G+?{5{nAwjvqT52-OqJ zf`3OX$Ie%{j2s10_1X=1j0pTa%Iz;_M?2YXcbF!Cc&i9~v6$=P4Wqio<`2yU9GfS| zzS9NC>b84i_JjQI7oOBc`8_L9Yg=^g=y_vfEtu7@jOJrCu( zmp0C}wpppRHkS)m?4|(jPOl-#LP{qyaw3TTq<7PvZ<2b$iQ8mUBeEmg3ge!PRoJz7 zNx)0b=og{30-TOuRTshbBSy$j*3q0pHli7o0t3f$4|#!PD{yK>`;9 z?~s`t6FkkdclA8fiXsu|J-agJ(%snIgM*RAE5w4FRJvVYbkc!z9DmGN@TEO}1hb;(-yY3(!8PD`g1%`Vgg3?pAu&Uf5XlXc(vh@r`uZJDH}>^c7sY z{w48ImOh5yk`ejGWEon_;Y=#w-^D&{2N+UXqF*d+3ct>@;HX7VdMgi(C%Hv@Lg+HAh@+v`jYpU+lTIm)3gCaI*Y)D!f4J4P;p3?B#I5_MOv&^=)Oy;hgBmNm z0M~0fJqhj;wOnSBa2yKTbEqgBBKk}8#}ZOvH7%h*Aroo)#Rp5Ma>p_!4T#|IN6D}H zRAGNYh>SL7#2yTX?5{22idJh?!M1)fRDLBB=Ktr%4=8C&5q|lDcjvl zJNG5NH%+6lpW+$2^}F4F%Z~23gN;t+3kLXvrM@gQyA1pmPsMD}?Ko|Avx#K#90_(E zTD>c=?ZzO>e2bdlH?#2oMoPUYsqXoXG5m?dwx43*;$3@Zwn6P|#N)QLM0}A_O()#X zMYLUPF{@cpUOmM6MZ@3ijnRV~sU2sa7fpjE^J>D-gZMCR_5 z7?%RZS+uFBi4l!5no&Sk5^rRpa0YZ4#g_N!NNSEKtL z^QAgx2mBr$u~=R)os>RZ2A#3wHvQk?CdIV2qWwfZ5IPKuJPZtsrHd20rHiwbxu?Ag zv;%CH^F70+$^Lul(ZwM?z&znL z;|?!1$T(QjV-MMuc2|^$q^zlI0d=3V*z&$W7zWkFG7*Ax^TK>@+9=KrB)Y#>M|CRz` zET?V-$q%a!NW441Nm`8|)}SP_+O2X)+<-9Lv~o@qef$x&C4Sl^uYlV}Nvi8A{Y`_^ za*U5K6BW`R@!_49Ir^L|X1RhJf)){s+rkGNrdQHpQo^R+`o`Mmh%{gSdZh^hs!!`R z5`?fvgS7~?T@Akxwf2lnr%;zFxAzR^qV6=#mncfS`8YSWd<6Nn${>1{Lehft95x zU1dNJQ_KaYb%?pQg%fo1mnZ2AN5yJ$_{>kl?#t3jZZ!fAfn%)$lMD2iToE^s%%Q1q ziZ{-ytO$^BBK5N4PfnJAD}u%<)3rdkz6@+KlMB|=)4(22lVmSLbNQ=S^93%5fSO7a zH~_uL;H-wnQsB;_hNJsl!BX~;nRO!#B4T}=l#v{Y75C+1oX4XabH0`oX)?P2WSK`z zF`xMB1LSVLA0z)9UBEi_ibz$Qll*#*gvSj;(PYl+x+PUQpJZJ0j`vaX}iM?QTQ<^uujVyXheGPR7;o@T`BpXyGHo?67M)}wB%kN*7 zF^rWXWcU6g64g5m4QKy}SM!J&wZ+nSZaf-ND8Uw)VU9XuTErhZ{rRh|_m5f)Mz95n z%~&dBR`{#Zq^NozeX_{I3BD3#wqts^Nn%Oz4CR)b$O-=<2D`}Ic7yN@h1MzAR(|e1 z({*6;CRAsSR$EgR$+{5btcplkv|=y4FjbX0A2jbza>#cx4zIeBq(1wB)PFi2)+Vkv zZiIFFd+*D5Z9%eDjIDVm$L|+*KfyxkCsHj%B3>jydSlD^BBpVz>T#a21-Imv0QZ~M zJiDsyNTjkrx$21HvR9;1;m(`JjrfR6!5`Q7x6Om=c?Kl&c~Ew2rIGn#_g{4aDqIk5 z;Kr^R-?$@`1j_qbA=sv$tZ&f?i`!7lli0^RL`N{Evh< zOPHarIVHiF+D2NF;G$zQo+iI;n0_hy-ZNE6N?V!73>_H_=zWVoVX#h&m+~#aujJ6 z(upaz_`0b}lS&)Gp`3&;v@>?ABFT5C+99d*UWl*6#I9l?&g1h@UqiViaD(^^kxt!A zpHzE(YmfuKAOT01c&7aLT*|p=apkiElj~jEnaoG&a}(4XcpLA@PY^~3pY6Et zoLvi;s!lM^k>;|l8lcAiLeENyBT|pd)X&k^3(N7mSt(0WXMS;MEfB}Qc*K0#QJpIDB`3m>!?6sGn3w^9V!JP$LtMe0ccA+iK!x}-n-+WGPsXjFd zgMl)i))>3HntCTsGt6yVnU-EDaBkbZgkXvgRqwhN{37-@up*i}oWQ7dx!?>rsN1%% z#hR=mR)BS0r89sSHD=;}rLIPv(r2@yZ-n>j+hT)|_bE3MD}hF|o6%IRNS(Yah&;5 z?5jUgY_BF7@t7S2t_)5WFg?kLgLP)Wjn$;D4)r@rV^ch90;B5NTst%_lLq$CAGRdU z3TXA;Gc#CQFG}#E!Fkm+s0C+Poeao@KCd`DZC?Ba@i`rD4yzm~&}TbJa2W!n^Xz02 z%=uyXC!YGojv1e8|H(>;GvT@RzOT1_u}Fc75RCz})OJ!Wfzb?=dC=SqKLf~i>)4>J zryrzqb_M6#RT6b0#2HRR<6>PUJA%`n< zcse0XR%J3@sP$kT_I56NQAvn5i?D~(r@R9O&9c27XxgE%;}_@e%1+VoNe!v%4Vha% zG&tLFIx!*Wk8Zl3wL=oI18{|ONs0{3p!&JgYo9o#|ot^KGqT52_{e4(t;4;#)=UquG-ZK8^d}l}#{ul2?`g^Y} zYx$S*`{!@A#Uj1qw-=Z{TM{90{%5V358?bYVQrO8iEnASPJ(_u0HN<6e@m zQn|e8!OsZ1j7v0}3a<&vX`OkPsFic@I0|@Iex<@<<^H z$^eZ(K6I$&?Xt-t+E`m-43b@s)R|P>)yFIi;mU+pGza-qVWW+SDc8uCm4>XOR%s|q zzY;X272^VsyB!g(LL8~LgJx;A;aUQU0r3bATy=M_pR@UkVV@g56@)%LH*#JGaX%xo zu-J1$rjxM9^Z5#4_GerX7I;P{VG<~>2-Wj%BN3TrpL`LOXFL~Ce@0nR!DkE>)qci# zQOoBs#l_w~W9L68Den7x+#&A$jDiwA&sZ-J@QnPD|2qCG`R4hUMJnjU-%X;>Rw;jq z|4*;l(~9%&PeEWO5DJo|f%;1eJRAP2i|3yvo_||CVL>1+=Ck1#HUo530r+hES5wAc z#-FkOF-C$e$#B2?Gll7ib7*w1(Hf5m(l7^A-&{K@~z zfs^HbXZD}!>5~u&{pDCl`5#Ad8tgyM3i;3N|EV-V1Lg5y*J=K9eo5v}ndx6M`Kwy+ z*MLs+|8e+N@qqYw>i?VF{oAJ?P>AUthks{x|GL8eMjij>@QeM~fkTn~dE~!D{@+$l zSP;0w`D_@=!}s*anP7Q&p*f<=&@3e!b{{9l|9(VIJ<~=~*AlgVq8r7huk2sLO!EKZ UNBe>nh8D&h0|v%V;E%=s1BjF}%>V!Z From a8fe62897365855c66660a59cbddbdaba7bc3fa4 Mon Sep 17 00:00:00 2001 From: Thorsten Marx Date: Wed, 10 Dec 2025 15:35:10 +0100 Subject: [PATCH 04/11] append preview token to stored url --- .../src/main/resources/manager/index.html | 1 + .../resources/manager/js/manager-globals.d.ts | 38 ------------------- .../manager/js/manager-inject-init.d.ts | 23 ----------- .../resources/manager/js/manager-inject.d.ts | 21 ---------- .../main/resources/manager/js/manager.d.ts | 22 ----------- .../manager/js/modules/preview.utils.js | 2 + .../main/resources/manager/js/ui-actions.d.ts | 22 ----------- .../main/ts/dist/js/modules/preview.utils.js | 2 + modules/ui-module/src/main/ts/globals.d.ts | 3 +- .../main/ts/src/js/modules/preview.utils.js | 2 + 10 files changed, 9 insertions(+), 127 deletions(-) delete mode 100644 modules/ui-module/src/main/resources/manager/js/manager-globals.d.ts delete mode 100644 modules/ui-module/src/main/resources/manager/js/manager-inject-init.d.ts delete mode 100644 modules/ui-module/src/main/resources/manager/js/manager-inject.d.ts delete mode 100644 modules/ui-module/src/main/resources/manager/js/manager.d.ts delete mode 100644 modules/ui-module/src/main/resources/manager/js/ui-actions.d.ts diff --git a/modules/ui-module/src/main/resources/manager/index.html b/modules/ui-module/src/main/resources/manager/index.html index 9e17778ba..3e1a0734b 100644 --- a/modules/ui-module/src/main/resources/manager/index.html +++ b/modules/ui-module/src/main/resources/manager/index.html @@ -91,6 +91,7 @@ window.manager = { csrfToken: '{{ csrfToken }}', + previewToken: '{{ previewToken }}' baseUrl: '{{ managerBaseURL }}', contextPath: '{{ contextPath }}', siteId: '{{ siteId }}', diff --git a/modules/ui-module/src/main/resources/manager/js/manager-globals.d.ts b/modules/ui-module/src/main/resources/manager/js/manager-globals.d.ts deleted file mode 100644 index b0099043b..000000000 --- a/modules/ui-module/src/main/resources/manager/js/manager-globals.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -/*- - * #%L - * ui-module - * %% - * Copyright (C) 2023 - 2025 CondationCMS - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program. If not, see - * . - * #L% - */ -declare function executeScriptAction(action: any): Promise; -declare function executeHookAction(action: any): Promise; -/** - * Patches a relative path so that it's correctly prefixed with the given manager base path. - * - * @param {string} relativePath e.g. "/manager/module" - * @param {string} managerBasePath e.g. "/manager" or "/de/manager" - * @returns {string} e.g. "/de/manager/module" - */ -declare function patchManagerPath(relativePath: string, managerBasePath: string): string; -/** - * Patches a path with the context path, if not already present. - * - * @param {string} path - The original path (e.g. "/assets/images/test.jpg"). - * @returns {string} - The patched path with context prefix if needed. - */ -declare function patchPathWithContext(path: string): string; diff --git a/modules/ui-module/src/main/resources/manager/js/manager-inject-init.d.ts b/modules/ui-module/src/main/resources/manager/js/manager-inject-init.d.ts deleted file mode 100644 index 274b55400..000000000 --- a/modules/ui-module/src/main/resources/manager/js/manager-inject-init.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -/*- - * #%L - * ui-module - * %% - * Copyright (C) 2023 - 2025 CondationCMS - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program. If not, see - * . - * #L% - */ -export function initIframe(): void; -export function isSectionPublishedExpired(section: any): boolean; diff --git a/modules/ui-module/src/main/resources/manager/js/manager-inject.d.ts b/modules/ui-module/src/main/resources/manager/js/manager-inject.d.ts deleted file mode 100644 index 3b06342ad..000000000 --- a/modules/ui-module/src/main/resources/manager/js/manager-inject.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -/*- - * #%L - * ui-module - * %% - * Copyright (C) 2023 - 2025 CondationCMS - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program. If not, see - * . - * #L% - */ diff --git a/modules/ui-module/src/main/resources/manager/js/manager.d.ts b/modules/ui-module/src/main/resources/manager/js/manager.d.ts deleted file mode 100644 index 4e9fd1670..000000000 --- a/modules/ui-module/src/main/resources/manager/js/manager.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -/*- - * #%L - * ui-module - * %% - * Copyright (C) 2023 - 2025 CondationCMS - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program. If not, see - * . - * #L% - */ -export {}; diff --git a/modules/ui-module/src/main/resources/manager/js/modules/preview.utils.js b/modules/ui-module/src/main/resources/manager/js/modules/preview.utils.js index 1f288a0e9..7a86f5464 100644 --- a/modules/ui-module/src/main/resources/manager/js/modules/preview.utils.js +++ b/modules/ui-module/src/main/resources/manager/js/modules/preview.utils.js @@ -63,6 +63,8 @@ const loadPreview = (url) => { if (!parsedUrl.searchParams.has("preview")) { parsedUrl.searchParams.append("preview", "manager"); } + parsedUrl.searchParams.delete("preview-token"); + parsedUrl.searchParams.append("preview-token", window.manager.previewToken); parsedUrl.searchParams.delete("nocache"); parsedUrl.searchParams.append("nocache", Date.now()); // Setze zusammengesetzten Pfad + Query zurück in das iframe diff --git a/modules/ui-module/src/main/resources/manager/js/ui-actions.d.ts b/modules/ui-module/src/main/resources/manager/js/ui-actions.d.ts deleted file mode 100644 index 4e9fd1670..000000000 --- a/modules/ui-module/src/main/resources/manager/js/ui-actions.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -/*- - * #%L - * ui-module - * %% - * Copyright (C) 2023 - 2025 CondationCMS - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program. If not, see - * . - * #L% - */ -export {}; diff --git a/modules/ui-module/src/main/ts/dist/js/modules/preview.utils.js b/modules/ui-module/src/main/ts/dist/js/modules/preview.utils.js index 1f288a0e9..7a86f5464 100644 --- a/modules/ui-module/src/main/ts/dist/js/modules/preview.utils.js +++ b/modules/ui-module/src/main/ts/dist/js/modules/preview.utils.js @@ -63,6 +63,8 @@ const loadPreview = (url) => { if (!parsedUrl.searchParams.has("preview")) { parsedUrl.searchParams.append("preview", "manager"); } + parsedUrl.searchParams.delete("preview-token"); + parsedUrl.searchParams.append("preview-token", window.manager.previewToken); parsedUrl.searchParams.delete("nocache"); parsedUrl.searchParams.append("nocache", Date.now()); // Setze zusammengesetzten Pfad + Query zurück in das iframe diff --git a/modules/ui-module/src/main/ts/globals.d.ts b/modules/ui-module/src/main/ts/globals.d.ts index d2a936714..699f864c4 100644 --- a/modules/ui-module/src/main/ts/globals.d.ts +++ b/modules/ui-module/src/main/ts/globals.d.ts @@ -7,7 +7,8 @@ declare global { manager_url: string; }; manager : { - csrfToken: string + csrfToken: string, + previewToken: string, baseUrl: string, contextPath: string, siteId: string, diff --git a/modules/ui-module/src/main/ts/src/js/modules/preview.utils.js b/modules/ui-module/src/main/ts/src/js/modules/preview.utils.js index c272b35b5..489922bf0 100644 --- a/modules/ui-module/src/main/ts/src/js/modules/preview.utils.js +++ b/modules/ui-module/src/main/ts/src/js/modules/preview.utils.js @@ -71,6 +71,8 @@ const loadPreview = (url) => { if (!parsedUrl.searchParams.has("preview")) { parsedUrl.searchParams.append("preview", "manager"); } + parsedUrl.searchParams.delete("preview-token") + parsedUrl.searchParams.append("preview-token", window.manager.previewToken); parsedUrl.searchParams.delete("nocache"); parsedUrl.searchParams.append("nocache", Date.now()); From 0e791ff4fbe1cdb31ee26384b1c8cfa3608fff73 Mon Sep 17 00:00:00 2001 From: Thorsten Marx Date: Wed, 10 Dec 2025 15:40:29 +0100 Subject: [PATCH 05/11] fix global js --- modules/ui-module/src/main/resources/manager/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ui-module/src/main/resources/manager/index.html b/modules/ui-module/src/main/resources/manager/index.html index 3e1a0734b..981ccf58d 100644 --- a/modules/ui-module/src/main/resources/manager/index.html +++ b/modules/ui-module/src/main/resources/manager/index.html @@ -91,7 +91,7 @@ window.manager = { csrfToken: '{{ csrfToken }}', - previewToken: '{{ previewToken }}' + previewToken: '{{ previewToken }}', baseUrl: '{{ managerBaseURL }}', contextPath: '{{ contextPath }}', siteId: '{{ siteId }}', From d2f41a35937ab051345e0dabc4da645a590b0ffd Mon Sep 17 00:00:00 2001 From: Thorsten Marx Date: Thu, 11 Dec 2025 14:48:21 +0100 Subject: [PATCH 06/11] update token handling --- .../UIJettyHttpHandlerExtension.java | 4 +- .../cms/modules/ui/http/JettyHandler.java | 22 +-- .../modules/ui/http/RemoteCallHandler.java | 4 +- .../cms/modules/ui/http/ResourceHandler.java | 7 +- .../ui/http/auth/AjaxLoginHandler.java | 41 +---- .../ui/http/auth/LoginResourceHandler.java | 3 +- .../modules/ui/http/auth/LogoutHandler.java | 36 +--- .../modules/ui/http/auth/UIAuthHandler.java | 14 +- .../ui/http/auth/UIAuthRedirectHandler.java | 13 +- .../cms/modules/ui/utils/AuthUtil.java | 172 ++++++++++++++++++ .../cms/modules/ui/utils/CookieUtil.java | 78 ++++++++ .../cms/modules/ui/utils/TokenUtils.java | 42 ++++- .../cms/modules/ui/utils/UIConstants.java | 35 ++++ .../actions/media/edit-focal-point.d.ts | 22 +++ .../actions/media/edit-media-form.d.ts | 22 +++ .../manager/actions/media/select-media.d.ts | 22 +++ .../manager/actions/page/add-section.d.ts | 22 +++ .../manager/actions/page/create-page.d.ts | 22 +++ .../manager/actions/page/delete-section.d.ts | 22 +++ .../manager/actions/page/edit-content.d.ts | 22 +++ .../actions/page/edit-metaattribute-list.d.ts | 22 +++ .../actions/page/edit-metaattribute.d.ts | 22 +++ .../actions/page/edit-page-settings.d.ts | 22 +++ .../manager/actions/page/edit-sections.d.ts | 22 +++ .../manager/actions/page/manage-assets.d.ts | 22 +++ .../actions/page/section-set-published.d.ts | 22 +++ .../manager/actions/page/translations.d.ts | 22 +++ .../manager/actions/reload-preview.d.ts | 22 +++ .../manager/actions/site-change.d.ts | 22 +++ .../manager/actions/test-command.d.ts | 22 +++ .../resources/manager/js/manager-globals.d.ts | 38 ++++ .../manager/js/manager-inject-init.d.ts | 23 +++ .../resources/manager/js/manager-inject.d.ts | 21 +++ .../main/resources/manager/js/manager.d.ts | 22 +++ .../resources/manager/js/modules/alerts.d.ts | 25 +++ .../manager/js/modules/event-bus.d.ts | 25 +++ .../js/modules/filebrowser.actions.d.ts | 45 +++++ .../manager/js/modules/filebrowser.d.ts | 26 +++ .../js/modules/filebrowser.template.d.ts | 23 +++ .../js/modules/filebrowser.upload.d.ts | 23 +++ .../js/modules/form/field.checkbox.d.ts | 32 ++++ .../manager/js/modules/form/field.code.d.ts | 30 +++ .../manager/js/modules/form/field.color.d.ts | 25 +++ .../manager/js/modules/form/field.date.d.ts | 26 +++ .../js/modules/form/field.datetime.d.ts | 26 +++ .../js/modules/form/field.divider.d.ts | 25 +++ .../js/modules/form/field.easymde.d.ts | 25 +++ .../manager/js/modules/form/field.list.d.ts | 28 +++ .../manager/js/modules/form/field.mail.d.ts | 26 +++ .../js/modules/form/field.markdown.d.ts | 27 +++ .../manager/js/modules/form/field.media.d.ts | 25 +++ .../manager/js/modules/form/field.number.d.ts | 31 ++++ .../manager/js/modules/form/field.radio.d.ts | 31 ++++ .../manager/js/modules/form/field.range.d.ts | 30 +++ .../js/modules/form/field.reference.d.ts | 28 +++ .../manager/js/modules/form/field.select.d.ts | 31 ++++ .../manager/js/modules/form/field.text.d.ts | 26 +++ .../js/modules/form/field.textarea.d.ts | 26 +++ .../manager/js/modules/form/forms.d.ts | 41 +++++ .../manager/js/modules/form/utils.d.ts | 27 +++ .../manager/js/modules/frameMessenger.d.ts | 30 +++ .../manager/js/modules/locale-utils.d.ts | 23 +++ .../js/modules/localization-actions.d.ts | 34 ++++ .../js/modules/localization-loader.d.ts | 45 +++++ .../js/modules/localization-modules.d.ts | 37 ++++ .../manager/js/modules/localization.d.ts | 53 ++++++ .../manager/js/modules/manager-ui.d.ts | 23 +++ .../manager/manager.message.handlers.d.ts | 23 +++ .../js/modules/manager/media.inject.d.ts | 25 +++ .../js/modules/manager/toolbar-icons.d.ts | 30 +++ .../js/modules/manager/toolbar.inject.d.ts | 22 +++ .../resources/manager/js/modules/modal.d.ts | 22 +++ .../resources/manager/js/modules/node.d.ts | 35 ++++ .../manager/js/modules/preview.history.d.ts | 28 +++ .../manager/js/modules/preview.utils.d.ts | 27 +++ .../manager/js/modules/preview.utils.js | 2 +- .../manager/js/modules/rpc/rpc-content.d.ts | 29 +++ .../manager/js/modules/rpc/rpc-files.d.ts | 28 +++ .../manager/js/modules/rpc/rpc-i18n.d.ts | 23 +++ .../manager/js/modules/rpc/rpc-manager.d.ts | 44 +++++ .../manager/js/modules/rpc/rpc-media.d.ts | 24 +++ .../manager/js/modules/rpc/rpc-page.d.ts | 29 +++ .../js/modules/rpc/rpc-translation.d.ts | 54 ++++++ .../resources/manager/js/modules/rpc/rpc.d.ts | 28 +++ .../resources/manager/js/modules/sidebar.d.ts | 22 +++ .../resources/manager/js/modules/state.d.ts | 28 +++ .../resources/manager/js/modules/toast.d.ts | 22 +++ .../manager/js/modules/ui-state.d.ts | 31 ++++ .../resources/manager/js/modules/upload.d.ts | 29 +++ .../main/resources/manager/js/ui-actions.d.ts | 22 +++ .../manager/public/manager-login.d.ts | 29 +++ .../main/ts/dist/js/modules/preview.utils.js | 2 +- .../main/ts/src/js/modules/preview.utils.js | 2 +- .../cms/modules/ui/utils/TokenUtilsTest.java | 5 +- 94 files changed, 2484 insertions(+), 108 deletions(-) create mode 100644 modules/ui-module/src/main/java/com/condation/cms/modules/ui/utils/AuthUtil.java create mode 100644 modules/ui-module/src/main/java/com/condation/cms/modules/ui/utils/CookieUtil.java create mode 100644 modules/ui-module/src/main/java/com/condation/cms/modules/ui/utils/UIConstants.java create mode 100644 modules/ui-module/src/main/resources/manager/actions/media/edit-focal-point.d.ts create mode 100644 modules/ui-module/src/main/resources/manager/actions/media/edit-media-form.d.ts create mode 100644 modules/ui-module/src/main/resources/manager/actions/media/select-media.d.ts create mode 100644 modules/ui-module/src/main/resources/manager/actions/page/add-section.d.ts create mode 100644 modules/ui-module/src/main/resources/manager/actions/page/create-page.d.ts create mode 100644 modules/ui-module/src/main/resources/manager/actions/page/delete-section.d.ts create mode 100644 modules/ui-module/src/main/resources/manager/actions/page/edit-content.d.ts create mode 100644 modules/ui-module/src/main/resources/manager/actions/page/edit-metaattribute-list.d.ts create mode 100644 modules/ui-module/src/main/resources/manager/actions/page/edit-metaattribute.d.ts create mode 100644 modules/ui-module/src/main/resources/manager/actions/page/edit-page-settings.d.ts create mode 100644 modules/ui-module/src/main/resources/manager/actions/page/edit-sections.d.ts create mode 100644 modules/ui-module/src/main/resources/manager/actions/page/manage-assets.d.ts create mode 100644 modules/ui-module/src/main/resources/manager/actions/page/section-set-published.d.ts create mode 100644 modules/ui-module/src/main/resources/manager/actions/page/translations.d.ts create mode 100644 modules/ui-module/src/main/resources/manager/actions/reload-preview.d.ts create mode 100644 modules/ui-module/src/main/resources/manager/actions/site-change.d.ts create mode 100644 modules/ui-module/src/main/resources/manager/actions/test-command.d.ts create mode 100644 modules/ui-module/src/main/resources/manager/js/manager-globals.d.ts create mode 100644 modules/ui-module/src/main/resources/manager/js/manager-inject-init.d.ts create mode 100644 modules/ui-module/src/main/resources/manager/js/manager-inject.d.ts create mode 100644 modules/ui-module/src/main/resources/manager/js/manager.d.ts create mode 100644 modules/ui-module/src/main/resources/manager/js/modules/alerts.d.ts create mode 100644 modules/ui-module/src/main/resources/manager/js/modules/event-bus.d.ts create mode 100644 modules/ui-module/src/main/resources/manager/js/modules/filebrowser.actions.d.ts create mode 100644 modules/ui-module/src/main/resources/manager/js/modules/filebrowser.d.ts create mode 100644 modules/ui-module/src/main/resources/manager/js/modules/filebrowser.template.d.ts create mode 100644 modules/ui-module/src/main/resources/manager/js/modules/filebrowser.upload.d.ts create mode 100644 modules/ui-module/src/main/resources/manager/js/modules/form/field.checkbox.d.ts create mode 100644 modules/ui-module/src/main/resources/manager/js/modules/form/field.code.d.ts create mode 100644 modules/ui-module/src/main/resources/manager/js/modules/form/field.color.d.ts create mode 100644 modules/ui-module/src/main/resources/manager/js/modules/form/field.date.d.ts create mode 100644 modules/ui-module/src/main/resources/manager/js/modules/form/field.datetime.d.ts create mode 100644 modules/ui-module/src/main/resources/manager/js/modules/form/field.divider.d.ts create mode 100644 modules/ui-module/src/main/resources/manager/js/modules/form/field.easymde.d.ts create mode 100644 modules/ui-module/src/main/resources/manager/js/modules/form/field.list.d.ts create mode 100644 modules/ui-module/src/main/resources/manager/js/modules/form/field.mail.d.ts create mode 100644 modules/ui-module/src/main/resources/manager/js/modules/form/field.markdown.d.ts create mode 100644 modules/ui-module/src/main/resources/manager/js/modules/form/field.media.d.ts create mode 100644 modules/ui-module/src/main/resources/manager/js/modules/form/field.number.d.ts create mode 100644 modules/ui-module/src/main/resources/manager/js/modules/form/field.radio.d.ts create mode 100644 modules/ui-module/src/main/resources/manager/js/modules/form/field.range.d.ts create mode 100644 modules/ui-module/src/main/resources/manager/js/modules/form/field.reference.d.ts create mode 100644 modules/ui-module/src/main/resources/manager/js/modules/form/field.select.d.ts create mode 100644 modules/ui-module/src/main/resources/manager/js/modules/form/field.text.d.ts create mode 100644 modules/ui-module/src/main/resources/manager/js/modules/form/field.textarea.d.ts create mode 100644 modules/ui-module/src/main/resources/manager/js/modules/form/forms.d.ts create mode 100644 modules/ui-module/src/main/resources/manager/js/modules/form/utils.d.ts create mode 100644 modules/ui-module/src/main/resources/manager/js/modules/frameMessenger.d.ts create mode 100644 modules/ui-module/src/main/resources/manager/js/modules/locale-utils.d.ts create mode 100644 modules/ui-module/src/main/resources/manager/js/modules/localization-actions.d.ts create mode 100644 modules/ui-module/src/main/resources/manager/js/modules/localization-loader.d.ts create mode 100644 modules/ui-module/src/main/resources/manager/js/modules/localization-modules.d.ts create mode 100644 modules/ui-module/src/main/resources/manager/js/modules/localization.d.ts create mode 100644 modules/ui-module/src/main/resources/manager/js/modules/manager-ui.d.ts create mode 100644 modules/ui-module/src/main/resources/manager/js/modules/manager/manager.message.handlers.d.ts create mode 100644 modules/ui-module/src/main/resources/manager/js/modules/manager/media.inject.d.ts create mode 100644 modules/ui-module/src/main/resources/manager/js/modules/manager/toolbar-icons.d.ts create mode 100644 modules/ui-module/src/main/resources/manager/js/modules/manager/toolbar.inject.d.ts create mode 100644 modules/ui-module/src/main/resources/manager/js/modules/modal.d.ts create mode 100644 modules/ui-module/src/main/resources/manager/js/modules/node.d.ts create mode 100644 modules/ui-module/src/main/resources/manager/js/modules/preview.history.d.ts create mode 100644 modules/ui-module/src/main/resources/manager/js/modules/preview.utils.d.ts create mode 100644 modules/ui-module/src/main/resources/manager/js/modules/rpc/rpc-content.d.ts create mode 100644 modules/ui-module/src/main/resources/manager/js/modules/rpc/rpc-files.d.ts create mode 100644 modules/ui-module/src/main/resources/manager/js/modules/rpc/rpc-i18n.d.ts create mode 100644 modules/ui-module/src/main/resources/manager/js/modules/rpc/rpc-manager.d.ts create mode 100644 modules/ui-module/src/main/resources/manager/js/modules/rpc/rpc-media.d.ts create mode 100644 modules/ui-module/src/main/resources/manager/js/modules/rpc/rpc-page.d.ts create mode 100644 modules/ui-module/src/main/resources/manager/js/modules/rpc/rpc-translation.d.ts create mode 100644 modules/ui-module/src/main/resources/manager/js/modules/rpc/rpc.d.ts create mode 100644 modules/ui-module/src/main/resources/manager/js/modules/sidebar.d.ts create mode 100644 modules/ui-module/src/main/resources/manager/js/modules/state.d.ts create mode 100644 modules/ui-module/src/main/resources/manager/js/modules/toast.d.ts create mode 100644 modules/ui-module/src/main/resources/manager/js/modules/ui-state.d.ts create mode 100644 modules/ui-module/src/main/resources/manager/js/modules/upload.d.ts create mode 100644 modules/ui-module/src/main/resources/manager/js/ui-actions.d.ts create mode 100644 modules/ui-module/src/main/resources/manager/public/manager-login.d.ts diff --git a/modules/ui-module/src/main/java/com/condation/cms/modules/ui/extensionpoints/UIJettyHttpHandlerExtension.java b/modules/ui-module/src/main/java/com/condation/cms/modules/ui/extensionpoints/UIJettyHttpHandlerExtension.java index 69a1e7f17..537170694 100644 --- a/modules/ui-module/src/main/java/com/condation/cms/modules/ui/extensionpoints/UIJettyHttpHandlerExtension.java +++ b/modules/ui-module/src/main/java/com/condation/cms/modules/ui/extensionpoints/UIJettyHttpHandlerExtension.java @@ -139,7 +139,7 @@ public Mapping getMapping() { mapping.add(PathSpec.from("/manager/login"), new LoginResourceHandler(getContext(), getRequestContext())); //mapping.add(PathSpec.from("/manager/login.action"), new LoginHandler(getContext(), getRequestContext(), failedLoginsCounter)); mapping.add(PathSpec.from("/manager/login.action"), new AjaxLoginHandler(getContext(), getRequestContext(), failedLoginsCounter, logins)); - mapping.add(PathSpec.from("/manager/logout"), new LogoutHandler(getRequestContext())); + mapping.add(PathSpec.from("/manager/logout"), new LogoutHandler(getContext(), getRequestContext())); mapping.add(PathSpec.from("/manager/upload"), new CompositeHttpHandler(List.of( @@ -163,7 +163,7 @@ public Mapping getMapping() { new CompositeHttpHandler(List.of( new UIAuthHandler(getContext(), getRequestContext()), new CSRFHandler(getContext()), - new RemoteCallHandler(remoteCallService, getContext()) + new RemoteCallHandler(remoteCallService, getContext(), getRequestContext()) ))); mapping.add(PathSpec.from("/manager/hooks"), diff --git a/modules/ui-module/src/main/java/com/condation/cms/modules/ui/http/JettyHandler.java b/modules/ui-module/src/main/java/com/condation/cms/modules/ui/http/JettyHandler.java index 3d76adda4..645658cb9 100644 --- a/modules/ui-module/src/main/java/com/condation/cms/modules/ui/http/JettyHandler.java +++ b/modules/ui-module/src/main/java/com/condation/cms/modules/ui/http/JettyHandler.java @@ -65,31 +65,21 @@ public void setAuthFeature (String username, SiteRequestContext requestContext) requestContext.add(AuthFeature.class, new AuthFeature(username)); } - public Optional getUser(Request request, SiteModuleContext moduleContext) { + public Optional getUser(Request request, SiteModuleContext moduleContext, SiteRequestContext requestContext) { try { - var tokenCookie = Request.getCookies(request).stream().filter(cookie -> "cms-token".equals(cookie.getName())).findFirst(); + + var username = requestContext.get(AuthFeature.class).username(); - if (tokenCookie.isEmpty()) { - Optional.empty(); - } - var token = tokenCookie.get().getValue(); - var secret = moduleContext.get(ConfigurationFeature.class).configuration().get(ServerConfiguration.class).serverProperties().secret(); - var username = TokenUtils.getPayload(token, secret); - - if (username.isEmpty()) { - return Optional.empty(); - } - - return moduleContext.get(InjectorFeature.class).injector().getInstance(UserService.class).byUsername(Realm.of("manager-users"), username.get().username()); + return moduleContext.get(InjectorFeature.class).injector().getInstance(UserService.class).byUsername(Realm.of("manager-users"), username); } catch (Exception e) { log.error("error getting user", e); } return Optional.empty(); } - protected String getUsername (Request request, SiteModuleContext moduleContext) { - var user = getUser(request, moduleContext); + protected String getUsername (Request request, SiteModuleContext moduleContext, SiteRequestContext requestContext) { + var user = getUser(request, moduleContext, requestContext); if (user.isPresent()) { return user.get().username(); } diff --git a/modules/ui-module/src/main/java/com/condation/cms/modules/ui/http/RemoteCallHandler.java b/modules/ui-module/src/main/java/com/condation/cms/modules/ui/http/RemoteCallHandler.java index a080ef98e..06717c8fb 100644 --- a/modules/ui-module/src/main/java/com/condation/cms/modules/ui/http/RemoteCallHandler.java +++ b/modules/ui-module/src/main/java/com/condation/cms/modules/ui/http/RemoteCallHandler.java @@ -22,6 +22,7 @@ * #L% */ import com.condation.cms.api.module.SiteModuleContext; +import com.condation.cms.api.module.SiteRequestContext; import com.condation.cms.api.ui.rpc.RPCError; import com.condation.cms.api.ui.rpc.RPCResult; import com.condation.cms.modules.ui.model.RemoteCall; @@ -47,6 +48,7 @@ public class RemoteCallHandler extends JettyHandler { private final RemoteMethodService remoteCallService; private final SiteModuleContext moduleContext; + private final SiteRequestContext requestContext; @Override public boolean handle(Request request, Response response, Callback callback) throws Exception { @@ -61,7 +63,7 @@ public boolean handle(Request request, Response response, Callback callback) thr RPCResult rpcResult; try { - Optional result = remoteCallService.execute(remoteCall.method(), remoteCall.parameters(), getUser(request, moduleContext).get()); + Optional result = remoteCallService.execute(remoteCall.method(), remoteCall.parameters(), getUser(request, moduleContext, requestContext).get()); if (result.isPresent()) { rpcResult = new RPCResult(result.get()); } else { diff --git a/modules/ui-module/src/main/java/com/condation/cms/modules/ui/http/ResourceHandler.java b/modules/ui-module/src/main/java/com/condation/cms/modules/ui/http/ResourceHandler.java index 41ede44cf..84f996ba0 100644 --- a/modules/ui-module/src/main/java/com/condation/cms/modules/ui/http/ResourceHandler.java +++ b/modules/ui-module/src/main/java/com/condation/cms/modules/ui/http/ResourceHandler.java @@ -37,6 +37,7 @@ import java.nio.charset.StandardCharsets; import java.nio.file.FileSystem; import java.nio.file.Files; +import java.time.Duration; import java.util.Map; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -65,7 +66,7 @@ public boolean handle(Request request, Response response, Callback callback) thr var hookSystem = requestContext.get(HookSystemFeature.class).hookSystem(); var moduleManager = context.get(ModuleManagerFeature.class).moduleManager(); - var actionFactory = new ActionFactory(hookSystem, moduleManager, getUser(request, context).get()); + var actionFactory = new ActionFactory(hookSystem, moduleManager, getUser(request, context, requestContext).get()); var resource = request.getHttpURI().getPath().replaceFirst( managerURL("/manager/", requestContext), ""); @@ -81,10 +82,10 @@ public boolean handle(Request request, Response response, Callback callback) thr String content = UILifecycleExtension.getInstance(context).getTemplateEngine().render(resource, Map.of( "actionFactory", actionFactory, - "csrfToken", TokenUtils.createToken("csrf", secret), + "csrfToken", TokenUtils.createToken("csrf", secret, Duration.ofHours(1), Duration.ofHours(1)), "links", new UILinkFunction(requestContext), "managerBaseURL", managerBaseURL(requestContext), - "previewToken", TokenUtils.createToken(getUsername(request, context), secret), + "previewToken", TokenUtils.createToken(getUsername(request, context, requestContext), secret, Duration.ofHours(1), Duration.ofDays(7)), "contextPath", siteProperties.contextPath(), "siteId", siteProperties.id(), "translation", new TranslationHelper(siteProperties) diff --git a/modules/ui-module/src/main/java/com/condation/cms/modules/ui/http/auth/AjaxLoginHandler.java b/modules/ui-module/src/main/java/com/condation/cms/modules/ui/http/auth/AjaxLoginHandler.java index fa9bdf63b..f7adff424 100644 --- a/modules/ui-module/src/main/java/com/condation/cms/modules/ui/http/auth/AjaxLoginHandler.java +++ b/modules/ui-module/src/main/java/com/condation/cms/modules/ui/http/auth/AjaxLoginHandler.java @@ -22,11 +22,9 @@ * #L% */ import com.condation.cms.api.cache.ICache; -import com.condation.cms.api.configuration.configs.ServerConfiguration; import com.condation.cms.api.configuration.configs.SiteConfiguration; import com.condation.cms.api.feature.features.ConfigurationFeature; import com.condation.cms.api.feature.features.InjectorFeature; -import com.condation.cms.api.feature.features.IsDevModeFeature; import com.condation.cms.api.mail.MailService; import com.condation.cms.api.mail.Message; import com.condation.cms.api.module.SiteModuleContext; @@ -36,16 +34,14 @@ import com.condation.cms.auth.services.User; import com.condation.cms.auth.services.UserService; import com.condation.cms.modules.ui.http.JettyHandler; -import com.condation.cms.modules.ui.utils.TokenUtils; +import com.condation.cms.modules.ui.utils.AuthUtil; import com.condation.cms.modules.ui.utils.json.UIGsonProvider; import java.security.SecureRandom; -import java.time.Duration; import java.util.Map; import java.util.Optional; import java.util.concurrent.atomic.AtomicInteger; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.eclipse.jetty.http.HttpCookie; import org.eclipse.jetty.io.Content; import org.eclipse.jetty.server.Request; import org.eclipse.jetty.server.Response; @@ -116,21 +112,8 @@ private void simpleLogin (Request request, Response response, Callback callback, Optional userOpt = moduleContext.get(InjectorFeature.class).injector().getInstance(UserService.class).login(Realm.of("manager-users"), username, password); if (userOpt.isPresent()) { com.condation.cms.auth.services.User user = userOpt.get(); - var secret = moduleContext.get(ConfigurationFeature.class).configuration().get(ServerConfiguration.class).serverProperties().secret(); - var token = TokenUtils.createToken(user.username(), secret); - - boolean isDev = requestContext.has(IsDevModeFeature.class); - - HttpCookie cookie = HttpCookie.from("cms-token", token, - Map.of( - HttpCookie.SAME_SITE_ATTRIBUTE, "Strict", - HttpCookie.HTTP_ONLY_ATTRIBUTE, "true", - HttpCookie.PATH_ATTRIBUTE, "/" - )); - if (!isDev) { - cookie = HttpCookie.from(cookie, HttpCookie.SECURE_ATTRIBUTE, "true"); - } - Response.addCookie(response, cookie); + + AuthUtil.updateCookies(user, response, requestContext, moduleContext); Content.Sink.write( response, @@ -189,22 +172,8 @@ private void validate(Request request, Response response, Callback callback, Com if (userOpt.isPresent()) { com.condation.cms.auth.services.User user = userOpt.get(); - var secret = moduleContext.get(ConfigurationFeature.class).configuration().get(ServerConfiguration.class).serverProperties().secret(); - var token = TokenUtils.createToken(user.username(), secret); - - boolean isDev = requestContext.has(IsDevModeFeature.class); - - HttpCookie cookie = HttpCookie.from("cms-token", token, - Map.of( - HttpCookie.SAME_SITE_ATTRIBUTE, "Strict", - HttpCookie.HTTP_ONLY_ATTRIBUTE, "true", - HttpCookie.MAX_AGE_ATTRIBUTE, String.valueOf(Duration.ofHours(1).toSeconds()), - HttpCookie.PATH_ATTRIBUTE, "/" - )); - if (!isDev) { - cookie = HttpCookie.from(cookie, HttpCookie.SECURE_ATTRIBUTE, "true"); - } - Response.addCookie(response, cookie); + + AuthUtil.updateCookies(user, response, requestContext, moduleContext); Map responseData = Map.of( "status", "ok" diff --git a/modules/ui-module/src/main/java/com/condation/cms/modules/ui/http/auth/LoginResourceHandler.java b/modules/ui-module/src/main/java/com/condation/cms/modules/ui/http/auth/LoginResourceHandler.java index f53a50c0d..2a1642c00 100644 --- a/modules/ui-module/src/main/java/com/condation/cms/modules/ui/http/auth/LoginResourceHandler.java +++ b/modules/ui-module/src/main/java/com/condation/cms/modules/ui/http/auth/LoginResourceHandler.java @@ -30,6 +30,7 @@ import com.condation.cms.modules.ui.extensionpoints.UILifecycleExtension; import com.condation.cms.modules.ui.http.JettyHandler; import com.condation.cms.modules.ui.utils.TokenUtils; +import java.time.Duration; import java.util.Map; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -61,7 +62,7 @@ public boolean handle(Request request, Response response, Callback callback) thr var secret = context.get(ConfigurationFeature.class).configuration().get(ServerConfiguration.class).serverProperties().secret(); var force2fa = siteProperties.ui().force2fa(); String content = UILifecycleExtension.getInstance(context).getTemplateEngine().render("login.html", Map.of( - "csrfToken", TokenUtils.createToken("csrf", secret), + "csrfToken", TokenUtils.createToken("csrf", secret, Duration.ofHours(1), Duration.ofHours(1)), "links", new LinkFunction(requestContext), "managerBaseURL", managerBaseURL(requestContext), "force2fa", force2fa diff --git a/modules/ui-module/src/main/java/com/condation/cms/modules/ui/http/auth/LogoutHandler.java b/modules/ui-module/src/main/java/com/condation/cms/modules/ui/http/auth/LogoutHandler.java index 602b2a198..e2d434742 100644 --- a/modules/ui-module/src/main/java/com/condation/cms/modules/ui/http/auth/LogoutHandler.java +++ b/modules/ui-module/src/main/java/com/condation/cms/modules/ui/http/auth/LogoutHandler.java @@ -21,14 +21,13 @@ * . * #L% */ -import com.condation.cms.api.feature.features.IsDevModeFeature; +import com.condation.cms.api.module.SiteModuleContext; import com.condation.cms.api.module.SiteRequestContext; -import com.condation.cms.api.utils.HTTPUtil; +import com.condation.cms.api.request.RequestContext; import com.condation.cms.modules.ui.http.JettyHandler; -import java.util.Map; +import com.condation.cms.modules.ui.utils.AuthUtil; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.eclipse.jetty.http.HttpCookie; import org.eclipse.jetty.server.Request; import org.eclipse.jetty.server.Response; import org.eclipse.jetty.util.Callback; @@ -41,37 +40,14 @@ @Slf4j public class LogoutHandler extends JettyHandler { - private final SiteRequestContext requestContext; + private final SiteModuleContext context; + private final RequestContext requestContext; @Override public boolean handle(Request request, Response response, Callback callback) throws Exception { - boolean isDev = requestContext.has(IsDevModeFeature.class); + AuthUtil.logout(request, response, requestContext, context); - HttpCookie cookie = HttpCookie.from("cms-token", "", - Map.of( - HttpCookie.SAME_SITE_ATTRIBUTE, "Strict", - HttpCookie.HTTP_ONLY_ATTRIBUTE, "true", - HttpCookie.MAX_AGE_ATTRIBUTE, "0", - HttpCookie.PATH_ATTRIBUTE, "/" - )); - if (!isDev) { - cookie = HttpCookie.from(cookie, HttpCookie.SECURE_ATTRIBUTE, "true"); - } - Response.addCookie(response, cookie); - - HttpCookie preview_cookie = HttpCookie.from("cms-preview-token", "", - Map.of( - HttpCookie.SAME_SITE_ATTRIBUTE, "Strict", - HttpCookie.HTTP_ONLY_ATTRIBUTE, "true", - HttpCookie.MAX_AGE_ATTRIBUTE, "0", - HttpCookie.PATH_ATTRIBUTE, "/" - )); - if (!isDev) { - preview_cookie = HttpCookie.from(preview_cookie, HttpCookie.SECURE_ATTRIBUTE, "true"); - } - Response.addCookie(response, preview_cookie); - response.setStatus(302); response.getHeaders().add("Location", managerURL("/manager/login", requestContext)); callback.succeeded(); diff --git a/modules/ui-module/src/main/java/com/condation/cms/modules/ui/http/auth/UIAuthHandler.java b/modules/ui-module/src/main/java/com/condation/cms/modules/ui/http/auth/UIAuthHandler.java index e74e98ee5..70674378e 100644 --- a/modules/ui-module/src/main/java/com/condation/cms/modules/ui/http/auth/UIAuthHandler.java +++ b/modules/ui-module/src/main/java/com/condation/cms/modules/ui/http/auth/UIAuthHandler.java @@ -22,15 +22,19 @@ * #L% */ import com.condation.cms.api.configuration.configs.ServerConfiguration; -import com.condation.cms.api.configuration.configs.SiteConfiguration; import com.condation.cms.api.feature.features.ConfigurationFeature; import com.condation.cms.api.feature.features.IsPreviewFeature; import com.condation.cms.api.module.SiteModuleContext; import com.condation.cms.api.module.SiteRequestContext; import com.condation.cms.modules.ui.http.JettyHandler; +import com.condation.cms.modules.ui.utils.AuthUtil; +import com.condation.cms.modules.ui.utils.CookieUtil; import com.condation.cms.modules.ui.utils.TokenUtils; +import com.condation.cms.modules.ui.utils.UIConstants; +import java.util.Optional; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.eclipse.jetty.http.HttpCookie; import org.eclipse.jetty.server.Request; import org.eclipse.jetty.server.Response; import org.eclipse.jetty.util.Callback; @@ -49,13 +53,17 @@ public class UIAuthHandler extends JettyHandler { @Override public boolean handle(Request request, Response response, Callback callback) throws Exception { - var tokenCookie = Request.getCookies(request).stream().filter(cookie -> "cms-token".equals(cookie.getName())).findFirst(); - + Optional tokenCookie = Optional.empty(); + if (AuthUtil.checkAuthTokens(request, response, moduleContext, requestContext)) { + tokenCookie = CookieUtil.getCookie(request, UIConstants.COOKIE_CMS_REFRESH_TOKEN); + } + if (tokenCookie.isEmpty()) { response.setStatus(403); callback.succeeded(); return true; } + var token = tokenCookie.get().getValue(); var secret = moduleContext.get(ConfigurationFeature.class).configuration().get(ServerConfiguration.class).serverProperties().secret(); diff --git a/modules/ui-module/src/main/java/com/condation/cms/modules/ui/http/auth/UIAuthRedirectHandler.java b/modules/ui-module/src/main/java/com/condation/cms/modules/ui/http/auth/UIAuthRedirectHandler.java index 597469336..e6cb94f40 100644 --- a/modules/ui-module/src/main/java/com/condation/cms/modules/ui/http/auth/UIAuthRedirectHandler.java +++ b/modules/ui-module/src/main/java/com/condation/cms/modules/ui/http/auth/UIAuthRedirectHandler.java @@ -28,9 +28,14 @@ import com.condation.cms.api.module.SiteModuleContext; import com.condation.cms.api.module.SiteRequestContext; import com.condation.cms.modules.ui.http.JettyHandler; +import com.condation.cms.modules.ui.utils.AuthUtil; +import com.condation.cms.modules.ui.utils.CookieUtil; import com.condation.cms.modules.ui.utils.TokenUtils; +import com.condation.cms.modules.ui.utils.UIConstants; +import java.util.Optional; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.eclipse.jetty.http.HttpCookie; import org.eclipse.jetty.server.Request; import org.eclipse.jetty.server.Response; import org.eclipse.jetty.util.Callback; @@ -49,13 +54,17 @@ public class UIAuthRedirectHandler extends JettyHandler { @Override public boolean handle(Request request, Response response, Callback callback) { - var tokenCookie = Request.getCookies(request).stream().filter(cookie -> "cms-token".equals(cookie.getName())).findFirst(); - + Optional tokenCookie = Optional.empty(); + if (AuthUtil.checkAuthTokens(request, response, moduleContext, requestContext)) { + tokenCookie = CookieUtil.getCookie(request, UIConstants.COOKIE_CMS_REFRESH_TOKEN); + } + if (tokenCookie.isEmpty()) { redirectToLogin(response, moduleContext); callback.succeeded(); return true; } + var token = tokenCookie.get().getValue(); var secret = moduleContext.get(ConfigurationFeature.class).configuration().get(ServerConfiguration.class).serverProperties().secret(); var payload = TokenUtils.getPayload(token, secret); diff --git a/modules/ui-module/src/main/java/com/condation/cms/modules/ui/utils/AuthUtil.java b/modules/ui-module/src/main/java/com/condation/cms/modules/ui/utils/AuthUtil.java new file mode 100644 index 000000000..8205d1fb2 --- /dev/null +++ b/modules/ui-module/src/main/java/com/condation/cms/modules/ui/utils/AuthUtil.java @@ -0,0 +1,172 @@ +package com.condation.cms.modules.ui.utils; + +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +import com.condation.cms.api.cache.CacheManager; +import com.condation.cms.api.configuration.configs.ServerConfiguration; +import com.condation.cms.api.feature.features.CacheManagerFeature; +import com.condation.cms.api.feature.features.ConfigurationFeature; +import com.condation.cms.api.feature.features.InjectorFeature; +import com.condation.cms.api.module.SiteModuleContext; +import com.condation.cms.api.module.SiteRequestContext; +import com.condation.cms.api.request.RequestContext; +import com.condation.cms.auth.services.Realm; +import com.condation.cms.auth.services.User; +import com.condation.cms.auth.services.UserService; +import java.time.Duration; +import java.util.Optional; +import lombok.extern.slf4j.Slf4j; +import org.eclipse.jetty.server.Request; +import org.eclipse.jetty.server.Response; + +/** + * + * @author thorstenmarx + */ +@Slf4j +public final class AuthUtil { + + private AuthUtil() { + } + + private static boolean tryRefresh(Request request, Response response, SiteModuleContext moduleContext, SiteRequestContext requestContext) { + var secret = moduleContext.get(ConfigurationFeature.class).configuration().get(ServerConfiguration.class).serverProperties().secret(); + + var refreshTokenCache = moduleContext.get(CacheManagerFeature.class).cacheManager().get( + "refresh-tokens", + new CacheManager.CacheConfig(1000l, Duration.ofDays(7)) + ); + + var refreshCookie = CookieUtil.getCookie(request, UIConstants.COOKIE_CMS_REFRESH_TOKEN); + if (refreshCookie.isEmpty()) { + return false; + } + + var token = refreshCookie.get().getValue(); + + var payload = TokenUtils.getPayload(token, secret); + if (payload.isPresent()) { + if (refreshTokenCache.contains(token)) { + refreshTokenCache.invalidate(token); + + Optional userOpt = moduleContext.get(InjectorFeature.class).injector().getInstance(UserService.class).byUsername(Realm.of("manager-users"), payload.get().username()); + if (userOpt.isPresent()) { + updateCookies(userOpt.get(), response, requestContext, moduleContext); + return true; + } + } + } + return false; + } + + public static boolean checkAuthTokens(Request request, Response response, SiteModuleContext moduleContext, SiteRequestContext requestContext) { + var authCookie = CookieUtil.getCookie(request, UIConstants.COOKIE_CMS_TOKEN); + + var secret = moduleContext.get(ConfigurationFeature.class).configuration().get(ServerConfiguration.class).serverProperties().secret(); + + if (authCookie.isEmpty()) { + // try refresh + if (tryRefresh(request, response, moduleContext, requestContext)) { + return true; + } + } else { + var token = authCookie.get().getValue(); + + var payload = TokenUtils.getPayload(token, secret); + + if (payload.isEmpty()) { + // try refresh + if (tryRefresh(request, response, moduleContext, requestContext)) { + return true; + } + } else { + return true; + } + } + + return false; + } + + public static void updateCookies(User user, Response response, RequestContext requestContext, SiteModuleContext moduleContext) { + + try { + var secret = moduleContext.get(ConfigurationFeature.class).configuration().get(ServerConfiguration.class).serverProperties().secret(); + var authToken = TokenUtils.createToken( + user.username(), + secret, + Duration.ofMinutes(15), // Idle + Duration.ofHours(8) // Max absolut + ); + var refreshToken = TokenUtils.createToken( + user.username(), + secret, + Duration.ofHours(1), // Idle + Duration.ofDays(7) // Max absolut + ); + + var previewToken = TokenUtils.createToken( + user.username(), + secret, + Duration.ofHours(1), // Idle + Duration.ofHours(24) // Max absolut + ); + + CookieUtil.setCookie(response, UIConstants.COOKIE_CMS_TOKEN, authToken, Duration.ofMinutes(15), requestContext); + CookieUtil.setCookie(response, UIConstants.COOKIE_CMS_REFRESH_TOKEN, refreshToken, Duration.ofHours(1), requestContext); + CookieUtil.setCookie(response, UIConstants.COOKIE_CMS_PREVIEW_TOKEN, previewToken, Duration.ofHours(1), requestContext); + + var refreshTokenCache = moduleContext.get(CacheManagerFeature.class).cacheManager().get( + "refresh-tokens", + new CacheManager.CacheConfig(1000l, Duration.ofDays(7)) + ); + refreshTokenCache.put(refreshToken, true); + } catch (Exception ex) { + log.error("", ex); + throw new RuntimeException(ex); + } + } + + public static void logout(Request request, Response response, + RequestContext requestContext, SiteModuleContext moduleContext) { + + try { + // Entferne Token aus Cache + var refreshCookie = CookieUtil.getCookie(request, UIConstants.COOKIE_CMS_REFRESH_TOKEN); + if (refreshCookie.isPresent()) { + var refreshTokenCache = moduleContext.get(CacheManagerFeature.class) + .cacheManager() + .get("refresh-tokens", + new CacheManager.CacheConfig(1000l, Duration.ofDays(7))); + + refreshTokenCache.invalidate(refreshCookie.get().getValue()); + } + + // Lösche Cookies + CookieUtil.removeCookie(response, UIConstants.COOKIE_CMS_TOKEN, requestContext); + CookieUtil.removeCookie(response, UIConstants.COOKIE_CMS_REFRESH_TOKEN, requestContext); + CookieUtil.removeCookie(response, UIConstants.COOKIE_CMS_PREVIEW_TOKEN, requestContext); + } catch (Exception ex) { + log.error("", ex); + throw new RuntimeException(ex); + } + } +} diff --git a/modules/ui-module/src/main/java/com/condation/cms/modules/ui/utils/CookieUtil.java b/modules/ui-module/src/main/java/com/condation/cms/modules/ui/utils/CookieUtil.java new file mode 100644 index 000000000..f786ab6bc --- /dev/null +++ b/modules/ui-module/src/main/java/com/condation/cms/modules/ui/utils/CookieUtil.java @@ -0,0 +1,78 @@ +package com.condation.cms.modules.ui.utils; + +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ + +import com.condation.cms.api.feature.features.IsDevModeFeature; +import com.condation.cms.api.request.RequestContext; +import java.time.Duration; +import java.util.Map; +import java.util.Optional; +import org.eclipse.jetty.http.HttpCookie; +import org.eclipse.jetty.server.Request; +import org.eclipse.jetty.server.Response; + +/** + * + * @author thorstenmarx + */ +public final class CookieUtil { + + private CookieUtil() { + } + + public static Optional getCookie (Request request, String name) { + return Request.getCookies(request).stream().filter(cookie -> name.equals(cookie.getName())).findFirst(); + } + + public static void setCookie(Response response, String name, String value, Duration maxAge, RequestContext requestContext) { + boolean isDev = requestContext.has(IsDevModeFeature.class); + + HttpCookie cookie = HttpCookie.from(name, value, + Map.of( + HttpCookie.SAME_SITE_ATTRIBUTE, "Strict", + HttpCookie.HTTP_ONLY_ATTRIBUTE, "true", + HttpCookie.PATH_ATTRIBUTE, "/", + HttpCookie.MAX_AGE_ATTRIBUTE, String.valueOf(maxAge.toSeconds()) + )); + if (!isDev) { + cookie = HttpCookie.from(cookie, HttpCookie.SECURE_ATTRIBUTE, "true"); + } + Response.addCookie(response, cookie); + } + + public static void removeCookie (Response response, String name, RequestContext requestContext) { + boolean isDev = requestContext.has(IsDevModeFeature.class); + + HttpCookie cookie = HttpCookie.from(name, "", + Map.of( + HttpCookie.SAME_SITE_ATTRIBUTE, "Strict", + HttpCookie.HTTP_ONLY_ATTRIBUTE, "true", + HttpCookie.MAX_AGE_ATTRIBUTE, "0", + HttpCookie.PATH_ATTRIBUTE, "/" + )); + if (!isDev) { + cookie = HttpCookie.from(cookie, HttpCookie.SECURE_ATTRIBUTE, "true"); + } + Response.addCookie(response, cookie); + } +} diff --git a/modules/ui-module/src/main/java/com/condation/cms/modules/ui/utils/TokenUtils.java b/modules/ui-module/src/main/java/com/condation/cms/modules/ui/utils/TokenUtils.java index 321d0a84e..f1ae98b65 100644 --- a/modules/ui-module/src/main/java/com/condation/cms/modules/ui/utils/TokenUtils.java +++ b/modules/ui-module/src/main/java/com/condation/cms/modules/ui/utils/TokenUtils.java @@ -21,15 +21,17 @@ * . * #L% */ - import com.condation.cms.modules.ui.utils.json.UIGsonProvider; import java.nio.charset.StandardCharsets; import java.security.MessageDigest; +import java.time.Duration; import java.time.Instant; import java.util.Base64; import java.util.Collections; +import java.util.HashMap; import java.util.Map; import java.util.Optional; +import java.util.UUID; import javax.crypto.Mac; import javax.crypto.spec.SecretKeySpec; @@ -54,8 +56,13 @@ public static Optional getPayload(String token, String secret) { Payload payload = UIGsonProvider.INSTANCE.fromJson(json, Payload.class); long now = Instant.now().getEpochSecond(); - if ((now - payload.timestamp()) >= 3600) { - return Optional.empty(); + + // BEIDE Grenzen prüfen! + if (now >= payload.expiresAt()) { + return Optional.empty(); // Idle timeout + } + if (now >= payload.maxLifetime()) { + return Optional.empty(); // Absolute grenze } return Optional.of(payload); @@ -64,16 +71,27 @@ public static Optional getPayload(String token, String secret) { } } - public static String createToken(String username, String SECRET, Map payloadData) throws Exception { - Payload payload = new Payload(username, Instant.now().getEpochSecond(), payloadData); + public static String createToken(String username, String SECRET, Map payloadData, Duration idleTimeout, Duration maxLifetime) throws Exception { + Instant now = Instant.now(); + Instant expiresAt = now.plus(idleTimeout); + Instant maxAt = now.plus(maxLifetime); + + payloadData.put("uuid", UUID.randomUUID().toString()); + + Payload payload = new Payload(username, + now.getEpochSecond(), + expiresAt.getEpochSecond(), + maxAt.getEpochSecond(), + payloadData); + String json = UIGsonProvider.INSTANCE.toJson(payload); String base64Payload = Base64.getUrlEncoder().withoutPadding().encodeToString(json.getBytes(StandardCharsets.UTF_8)); String signature = hmacSha256(base64Payload, SECRET); return base64Payload + ":" + signature; } - - public static String createToken(String username, String SECRET) throws Exception { - return createToken(username, SECRET, Collections.emptyMap()); + + public static String createToken(String username, String SECRET, Duration idleTimeout, Duration maxLifetime) throws Exception { + return createToken(username, SECRET, new HashMap<>(), idleTimeout, maxLifetime); } private static String hmacSha256(String data, String key) throws Exception { @@ -84,6 +102,12 @@ private static String hmacSha256(String data, String key) throws Exception { return Base64.getUrlEncoder().withoutPadding().encodeToString(hash); } - public record Payload(String username, long timestamp, Map data) { + public record Payload( + String username, + long issuedAt, + long expiresAt, + long maxLifetime, + Map data) { + } } diff --git a/modules/ui-module/src/main/java/com/condation/cms/modules/ui/utils/UIConstants.java b/modules/ui-module/src/main/java/com/condation/cms/modules/ui/utils/UIConstants.java new file mode 100644 index 000000000..cd97d8ef4 --- /dev/null +++ b/modules/ui-module/src/main/java/com/condation/cms/modules/ui/utils/UIConstants.java @@ -0,0 +1,35 @@ +package com.condation.cms.modules.ui.utils; + +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ + +/** + * + * @author thorstenmarx + */ +public final class UIConstants { + private UIConstants () {} + + public static final String COOKIE_CMS_TOKEN = "cms-token"; + public static final String COOKIE_CMS_REFRESH_TOKEN = "cms-refresh-token"; + public static final String COOKIE_CMS_PREVIEW_TOKEN = "cms-preview-token"; +} diff --git a/modules/ui-module/src/main/resources/manager/actions/media/edit-focal-point.d.ts b/modules/ui-module/src/main/resources/manager/actions/media/edit-focal-point.d.ts new file mode 100644 index 000000000..b663a90ce --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/actions/media/edit-focal-point.d.ts @@ -0,0 +1,22 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +export declare function runAction(params: any): Promise; diff --git a/modules/ui-module/src/main/resources/manager/actions/media/edit-media-form.d.ts b/modules/ui-module/src/main/resources/manager/actions/media/edit-media-form.d.ts new file mode 100644 index 000000000..ede3e50d7 --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/actions/media/edit-media-form.d.ts @@ -0,0 +1,22 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +export function runAction(params: any): Promise; diff --git a/modules/ui-module/src/main/resources/manager/actions/media/select-media.d.ts b/modules/ui-module/src/main/resources/manager/actions/media/select-media.d.ts new file mode 100644 index 000000000..b663a90ce --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/actions/media/select-media.d.ts @@ -0,0 +1,22 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +export declare function runAction(params: any): Promise; diff --git a/modules/ui-module/src/main/resources/manager/actions/page/add-section.d.ts b/modules/ui-module/src/main/resources/manager/actions/page/add-section.d.ts new file mode 100644 index 000000000..ede3e50d7 --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/actions/page/add-section.d.ts @@ -0,0 +1,22 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +export function runAction(params: any): Promise; diff --git a/modules/ui-module/src/main/resources/manager/actions/page/create-page.d.ts b/modules/ui-module/src/main/resources/manager/actions/page/create-page.d.ts new file mode 100644 index 000000000..ede3e50d7 --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/actions/page/create-page.d.ts @@ -0,0 +1,22 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +export function runAction(params: any): Promise; diff --git a/modules/ui-module/src/main/resources/manager/actions/page/delete-section.d.ts b/modules/ui-module/src/main/resources/manager/actions/page/delete-section.d.ts new file mode 100644 index 000000000..ede3e50d7 --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/actions/page/delete-section.d.ts @@ -0,0 +1,22 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +export function runAction(params: any): Promise; diff --git a/modules/ui-module/src/main/resources/manager/actions/page/edit-content.d.ts b/modules/ui-module/src/main/resources/manager/actions/page/edit-content.d.ts new file mode 100644 index 000000000..ede3e50d7 --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/actions/page/edit-content.d.ts @@ -0,0 +1,22 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +export function runAction(params: any): Promise; diff --git a/modules/ui-module/src/main/resources/manager/actions/page/edit-metaattribute-list.d.ts b/modules/ui-module/src/main/resources/manager/actions/page/edit-metaattribute-list.d.ts new file mode 100644 index 000000000..ede3e50d7 --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/actions/page/edit-metaattribute-list.d.ts @@ -0,0 +1,22 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +export function runAction(params: any): Promise; diff --git a/modules/ui-module/src/main/resources/manager/actions/page/edit-metaattribute.d.ts b/modules/ui-module/src/main/resources/manager/actions/page/edit-metaattribute.d.ts new file mode 100644 index 000000000..ede3e50d7 --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/actions/page/edit-metaattribute.d.ts @@ -0,0 +1,22 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +export function runAction(params: any): Promise; diff --git a/modules/ui-module/src/main/resources/manager/actions/page/edit-page-settings.d.ts b/modules/ui-module/src/main/resources/manager/actions/page/edit-page-settings.d.ts new file mode 100644 index 000000000..ede3e50d7 --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/actions/page/edit-page-settings.d.ts @@ -0,0 +1,22 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +export function runAction(params: any): Promise; diff --git a/modules/ui-module/src/main/resources/manager/actions/page/edit-sections.d.ts b/modules/ui-module/src/main/resources/manager/actions/page/edit-sections.d.ts new file mode 100644 index 000000000..ede3e50d7 --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/actions/page/edit-sections.d.ts @@ -0,0 +1,22 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +export function runAction(params: any): Promise; diff --git a/modules/ui-module/src/main/resources/manager/actions/page/manage-assets.d.ts b/modules/ui-module/src/main/resources/manager/actions/page/manage-assets.d.ts new file mode 100644 index 000000000..ede3e50d7 --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/actions/page/manage-assets.d.ts @@ -0,0 +1,22 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +export function runAction(params: any): Promise; diff --git a/modules/ui-module/src/main/resources/manager/actions/page/section-set-published.d.ts b/modules/ui-module/src/main/resources/manager/actions/page/section-set-published.d.ts new file mode 100644 index 000000000..b663a90ce --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/actions/page/section-set-published.d.ts @@ -0,0 +1,22 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +export declare function runAction(params: any): Promise; diff --git a/modules/ui-module/src/main/resources/manager/actions/page/translations.d.ts b/modules/ui-module/src/main/resources/manager/actions/page/translations.d.ts new file mode 100644 index 000000000..b663a90ce --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/actions/page/translations.d.ts @@ -0,0 +1,22 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +export declare function runAction(params: any): Promise; diff --git a/modules/ui-module/src/main/resources/manager/actions/reload-preview.d.ts b/modules/ui-module/src/main/resources/manager/actions/reload-preview.d.ts new file mode 100644 index 000000000..b663a90ce --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/actions/reload-preview.d.ts @@ -0,0 +1,22 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +export declare function runAction(params: any): Promise; diff --git a/modules/ui-module/src/main/resources/manager/actions/site-change.d.ts b/modules/ui-module/src/main/resources/manager/actions/site-change.d.ts new file mode 100644 index 000000000..47c0bf7ea --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/actions/site-change.d.ts @@ -0,0 +1,22 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +export function runAction(parameters: any): Promise; diff --git a/modules/ui-module/src/main/resources/manager/actions/test-command.d.ts b/modules/ui-module/src/main/resources/manager/actions/test-command.d.ts new file mode 100644 index 000000000..ede3e50d7 --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/actions/test-command.d.ts @@ -0,0 +1,22 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +export function runAction(params: any): Promise; diff --git a/modules/ui-module/src/main/resources/manager/js/manager-globals.d.ts b/modules/ui-module/src/main/resources/manager/js/manager-globals.d.ts new file mode 100644 index 000000000..b0099043b --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/js/manager-globals.d.ts @@ -0,0 +1,38 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +declare function executeScriptAction(action: any): Promise; +declare function executeHookAction(action: any): Promise; +/** + * Patches a relative path so that it's correctly prefixed with the given manager base path. + * + * @param {string} relativePath e.g. "/manager/module" + * @param {string} managerBasePath e.g. "/manager" or "/de/manager" + * @returns {string} e.g. "/de/manager/module" + */ +declare function patchManagerPath(relativePath: string, managerBasePath: string): string; +/** + * Patches a path with the context path, if not already present. + * + * @param {string} path - The original path (e.g. "/assets/images/test.jpg"). + * @returns {string} - The patched path with context prefix if needed. + */ +declare function patchPathWithContext(path: string): string; diff --git a/modules/ui-module/src/main/resources/manager/js/manager-inject-init.d.ts b/modules/ui-module/src/main/resources/manager/js/manager-inject-init.d.ts new file mode 100644 index 000000000..274b55400 --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/js/manager-inject-init.d.ts @@ -0,0 +1,23 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +export function initIframe(): void; +export function isSectionPublishedExpired(section: any): boolean; diff --git a/modules/ui-module/src/main/resources/manager/js/manager-inject.d.ts b/modules/ui-module/src/main/resources/manager/js/manager-inject.d.ts new file mode 100644 index 000000000..3b06342ad --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/js/manager-inject.d.ts @@ -0,0 +1,21 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ diff --git a/modules/ui-module/src/main/resources/manager/js/manager.d.ts b/modules/ui-module/src/main/resources/manager/js/manager.d.ts new file mode 100644 index 000000000..4e9fd1670 --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/js/manager.d.ts @@ -0,0 +1,22 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +export {}; diff --git a/modules/ui-module/src/main/resources/manager/js/modules/alerts.d.ts b/modules/ui-module/src/main/resources/manager/js/modules/alerts.d.ts new file mode 100644 index 000000000..52dfcfb81 --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/js/modules/alerts.d.ts @@ -0,0 +1,25 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +export function alertSelect(options: any): Promise; +export function alertError(options: any): void; +export function alertConfirm(options: any): Promise; +export function alertPrompt(options: any): Promise; diff --git a/modules/ui-module/src/main/resources/manager/js/modules/event-bus.d.ts b/modules/ui-module/src/main/resources/manager/js/modules/event-bus.d.ts new file mode 100644 index 000000000..ec2852733 --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/js/modules/event-bus.d.ts @@ -0,0 +1,25 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +export namespace EventBus { + function on(event: any, handler: any): void; + function emit(event: any, payload: any): void; +} diff --git a/modules/ui-module/src/main/resources/manager/js/modules/filebrowser.actions.d.ts b/modules/ui-module/src/main/resources/manager/js/modules/filebrowser.actions.d.ts new file mode 100644 index 000000000..2975ce621 --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/js/modules/filebrowser.actions.d.ts @@ -0,0 +1,45 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +export function renameFileAction({ state, getTargetFolder, filename }: { + state: any; + getTargetFolder: any; + filename: any; +}): Promise; +export function deleteElementAction({ elementName, state, deleteFN, getTargetFolder }: { + elementName: any; + state: any; + deleteFN: any; + getTargetFolder: any; +}): Promise; +export function createFolderAction({ state, getTargetFolder }: { + state: any; + getTargetFolder: any; +}): Promise; +export function createFileAction({ state, getTargetFolder }: { + state: any; + getTargetFolder: any; +}): Promise; +export function createPageActionOfContentType({ state, getTargetFolder, contentType }: { + state: any; + getTargetFolder: any; + contentType: any; +}): Promise; diff --git a/modules/ui-module/src/main/resources/manager/js/modules/filebrowser.d.ts b/modules/ui-module/src/main/resources/manager/js/modules/filebrowser.d.ts new file mode 100644 index 000000000..2e73de83d --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/js/modules/filebrowser.d.ts @@ -0,0 +1,26 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +export function openFileBrowser(optionsParam: any): Promise; +export namespace state { + let options: any; + let currentFolder: string; +} diff --git a/modules/ui-module/src/main/resources/manager/js/modules/filebrowser.template.d.ts b/modules/ui-module/src/main/resources/manager/js/modules/filebrowser.template.d.ts new file mode 100644 index 000000000..21818e80d --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/js/modules/filebrowser.template.d.ts @@ -0,0 +1,23 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +export { template as filebrowserTemplate }; +declare const template: any; diff --git a/modules/ui-module/src/main/resources/manager/js/modules/filebrowser.upload.d.ts b/modules/ui-module/src/main/resources/manager/js/modules/filebrowser.upload.d.ts new file mode 100644 index 000000000..2e15bd93a --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/js/modules/filebrowser.upload.d.ts @@ -0,0 +1,23 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +export function initDragAndDropUpload(): void; +export function handleFileUpload(): Promise; diff --git a/modules/ui-module/src/main/resources/manager/js/modules/form/field.checkbox.d.ts b/modules/ui-module/src/main/resources/manager/js/modules/form/field.checkbox.d.ts new file mode 100644 index 000000000..73bba1b24 --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/js/modules/form/field.checkbox.d.ts @@ -0,0 +1,32 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +import { FieldOptions, FormField } from "@cms/modules/form/forms.js"; +export interface CheckboxOptions extends FieldOptions { + key?: string; + options?: { + choices: Array<{ + label: string; + value: string; + }>; + }; +} +export declare const CheckboxField: FormField; diff --git a/modules/ui-module/src/main/resources/manager/js/modules/form/field.code.d.ts b/modules/ui-module/src/main/resources/manager/js/modules/form/field.code.d.ts new file mode 100644 index 000000000..5d263979b --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/js/modules/form/field.code.d.ts @@ -0,0 +1,30 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +export namespace CodeField { + export { createCodeField as markup }; + export { init }; + export { getData as data }; +} +declare function createCodeField(options: any, value?: string): string; +declare function init(context: any): void; +declare function getData(context: any): {}; +export {}; diff --git a/modules/ui-module/src/main/resources/manager/js/modules/form/field.color.d.ts b/modules/ui-module/src/main/resources/manager/js/modules/form/field.color.d.ts new file mode 100644 index 000000000..5f226c1f0 --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/js/modules/form/field.color.d.ts @@ -0,0 +1,25 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +import { FieldOptions, FormField } from "@cms/modules/form/forms.js"; +export interface ColorFieldOptions extends FieldOptions { +} +export declare const ColorField: FormField; diff --git a/modules/ui-module/src/main/resources/manager/js/modules/form/field.date.d.ts b/modules/ui-module/src/main/resources/manager/js/modules/form/field.date.d.ts new file mode 100644 index 000000000..fb92ebce6 --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/js/modules/form/field.date.d.ts @@ -0,0 +1,26 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +import { FieldOptions, FormField } from "@cms/modules/form/forms.js"; +export interface DateFieldOptions extends FieldOptions { + placeholder?: string; +} +export declare const DateField: FormField; diff --git a/modules/ui-module/src/main/resources/manager/js/modules/form/field.datetime.d.ts b/modules/ui-module/src/main/resources/manager/js/modules/form/field.datetime.d.ts new file mode 100644 index 000000000..4dc19636b --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/js/modules/form/field.datetime.d.ts @@ -0,0 +1,26 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +import { FieldOptions, FormField } from "@cms/modules/form/forms.js"; +export interface DateTimeFieldOptions extends FieldOptions { + placeholder?: string; +} +export declare const DateTimeField: FormField; diff --git a/modules/ui-module/src/main/resources/manager/js/modules/form/field.divider.d.ts b/modules/ui-module/src/main/resources/manager/js/modules/form/field.divider.d.ts new file mode 100644 index 000000000..849a06c31 --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/js/modules/form/field.divider.d.ts @@ -0,0 +1,25 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +import { FieldOptions, FormField } from "@cms/modules/form/forms.js"; +export interface DividerOptions extends FieldOptions { +} +export declare const Divider: FormField; diff --git a/modules/ui-module/src/main/resources/manager/js/modules/form/field.easymde.d.ts b/modules/ui-module/src/main/resources/manager/js/modules/form/field.easymde.d.ts new file mode 100644 index 000000000..7d8cda2b0 --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/js/modules/form/field.easymde.d.ts @@ -0,0 +1,25 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +import { FieldOptions, FormField } from "@cms/modules/form/forms.js"; +export interface EasyMDEFieldOptions extends FieldOptions { +} +export declare const EasyMDEField: FormField; diff --git a/modules/ui-module/src/main/resources/manager/js/modules/form/field.list.d.ts b/modules/ui-module/src/main/resources/manager/js/modules/form/field.list.d.ts new file mode 100644 index 000000000..1878c81eb --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/js/modules/form/field.list.d.ts @@ -0,0 +1,28 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +import { FieldOptions, FormField } from "@cms/modules/form/forms.js"; +export interface ListFieldOptions extends FieldOptions { + options: { + nameField?: string; + }; +} +export declare const ListField: FormField; diff --git a/modules/ui-module/src/main/resources/manager/js/modules/form/field.mail.d.ts b/modules/ui-module/src/main/resources/manager/js/modules/form/field.mail.d.ts new file mode 100644 index 000000000..918baa688 --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/js/modules/form/field.mail.d.ts @@ -0,0 +1,26 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +import { FieldOptions, FormField } from "@cms/modules/form/forms.js"; +export interface MailFieldOptions extends FieldOptions { + placeholder?: string; +} +export declare const MailField: FormField; diff --git a/modules/ui-module/src/main/resources/manager/js/modules/form/field.markdown.d.ts b/modules/ui-module/src/main/resources/manager/js/modules/form/field.markdown.d.ts new file mode 100644 index 000000000..6c73c850e --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/js/modules/form/field.markdown.d.ts @@ -0,0 +1,27 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +import { FieldOptions, FormField } from "@cms/modules/form/forms.js"; +export interface MarkdownFieldOptions extends FieldOptions { + placeholder?: string; + height?: string; +} +export declare const MarkdownField: FormField; diff --git a/modules/ui-module/src/main/resources/manager/js/modules/form/field.media.d.ts b/modules/ui-module/src/main/resources/manager/js/modules/form/field.media.d.ts new file mode 100644 index 000000000..736e11c47 --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/js/modules/form/field.media.d.ts @@ -0,0 +1,25 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +import { FieldOptions, FormField } from "@cms/modules/form/forms.js"; +export interface MediaFieldOptions extends FieldOptions { +} +export declare const MediaField: FormField; diff --git a/modules/ui-module/src/main/resources/manager/js/modules/form/field.number.d.ts b/modules/ui-module/src/main/resources/manager/js/modules/form/field.number.d.ts new file mode 100644 index 000000000..ca57dc478 --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/js/modules/form/field.number.d.ts @@ -0,0 +1,31 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +import { FieldOptions, FormField } from "@cms/modules/form/forms.js"; +export interface NumberFieldOptions extends FieldOptions { + options: { + min?: number; + max?: number; + step?: number; + }; + placeholder?: string; +} +export declare const NumberField: FormField; diff --git a/modules/ui-module/src/main/resources/manager/js/modules/form/field.radio.d.ts b/modules/ui-module/src/main/resources/manager/js/modules/form/field.radio.d.ts new file mode 100644 index 000000000..59e5699f4 --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/js/modules/form/field.radio.d.ts @@ -0,0 +1,31 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +import { FieldOptions, FormField } from "@cms/modules/form/forms.js"; +export interface RadioFieldOptions extends FieldOptions { + options?: { + choices: Array<{ + label: string; + value: string; + }>; + }; +} +export declare const RadioField: FormField; diff --git a/modules/ui-module/src/main/resources/manager/js/modules/form/field.range.d.ts b/modules/ui-module/src/main/resources/manager/js/modules/form/field.range.d.ts new file mode 100644 index 000000000..4f2ce22bf --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/js/modules/form/field.range.d.ts @@ -0,0 +1,30 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +import { FieldOptions, FormField } from "@cms/modules/form/forms.js"; +export interface RangeFieldOptions extends FieldOptions { + options?: { + min?: number; + max?: number; + step?: number; + }; +} +export declare const RangeField: FormField; diff --git a/modules/ui-module/src/main/resources/manager/js/modules/form/field.reference.d.ts b/modules/ui-module/src/main/resources/manager/js/modules/form/field.reference.d.ts new file mode 100644 index 000000000..d7ecc8311 --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/js/modules/form/field.reference.d.ts @@ -0,0 +1,28 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +import { FieldOptions, FormField } from "@cms/modules/form/forms.js"; +export interface ReferenceFieldOptions extends FieldOptions { + options?: { + siteid?: string; + }; +} +export declare const ReferenceField: FormField; diff --git a/modules/ui-module/src/main/resources/manager/js/modules/form/field.select.d.ts b/modules/ui-module/src/main/resources/manager/js/modules/form/field.select.d.ts new file mode 100644 index 000000000..edef669bb --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/js/modules/form/field.select.d.ts @@ -0,0 +1,31 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +import { FieldOptions, FormField } from "@cms/modules/form/forms.js"; +export interface SelectFieldOptions extends FieldOptions { + options?: { + choices?: Array; + }; +} +export declare const SelectField: FormField; diff --git a/modules/ui-module/src/main/resources/manager/js/modules/form/field.text.d.ts b/modules/ui-module/src/main/resources/manager/js/modules/form/field.text.d.ts new file mode 100644 index 000000000..d208c4f7d --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/js/modules/form/field.text.d.ts @@ -0,0 +1,26 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +import { FieldOptions, FormField } from "@cms/modules/form/forms.js"; +export interface TextFieldOptions extends FieldOptions { + placeholder?: string; +} +export declare const TextField: FormField; diff --git a/modules/ui-module/src/main/resources/manager/js/modules/form/field.textarea.d.ts b/modules/ui-module/src/main/resources/manager/js/modules/form/field.textarea.d.ts new file mode 100644 index 000000000..a66a4c05d --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/js/modules/form/field.textarea.d.ts @@ -0,0 +1,26 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +import { FieldOptions, FormField } from "@cms/modules/form/forms.js"; +export interface TextAreaFieldOptions extends FieldOptions { + rows?: number; +} +export declare const TextAreaField: FormField; diff --git a/modules/ui-module/src/main/resources/manager/js/modules/form/forms.d.ts b/modules/ui-module/src/main/resources/manager/js/modules/form/forms.d.ts new file mode 100644 index 000000000..9949b5d58 --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/js/modules/form/forms.d.ts @@ -0,0 +1,41 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +declare const createForm: (options: any) => Form; +export { createForm }; +export interface FormContext { + formElement: HTMLFormElement | null; + fields: any[]; +} +export interface Form { + init: (container: Element | string) => void; + getData: () => any; + getRawData: () => any; +} +export interface FormField { + markup: (options: FieldOptions, value?: any) => string; + init: (context: FormContext) => void; + data: (context: FormContext) => any; +} +export interface FieldOptions { + name?: string; + title?: string; +} diff --git a/modules/ui-module/src/main/resources/manager/js/modules/form/utils.d.ts b/modules/ui-module/src/main/resources/manager/js/modules/form/utils.d.ts new file mode 100644 index 000000000..1dbb37e81 --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/js/modules/form/utils.d.ts @@ -0,0 +1,27 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +declare const createID: () => string; +declare const utcToLocalDateTimeInputValue: (utcString: string) => string; +declare function getUTCDateTimeFromInput(inputElement: HTMLInputElement): string; +declare function utcToLocalDateInputValue(utcString: string): string; +declare function getUTCDateFromInput(inputElement: HTMLInputElement): string; +export { createID, utcToLocalDateTimeInputValue, getUTCDateTimeFromInput, utcToLocalDateInputValue, getUTCDateFromInput }; diff --git a/modules/ui-module/src/main/resources/manager/js/modules/frameMessenger.d.ts b/modules/ui-module/src/main/resources/manager/js/modules/frameMessenger.d.ts new file mode 100644 index 000000000..731f89405 --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/js/modules/frameMessenger.d.ts @@ -0,0 +1,30 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +declare namespace _default { + export { send }; + export { on }; + export { off }; +} +export default _default; +declare function send(targetWindow: any, message: any, targetOrigin?: string): void; +declare function on(type: any, callback: any): void; +declare function off(type: any, callback: any): void; diff --git a/modules/ui-module/src/main/resources/manager/js/modules/locale-utils.d.ts b/modules/ui-module/src/main/resources/manager/js/modules/locale-utils.d.ts new file mode 100644 index 000000000..9e3f60793 --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/js/modules/locale-utils.d.ts @@ -0,0 +1,23 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +export function getLocale(): any; +export function setLocale(locale: any): void; diff --git a/modules/ui-module/src/main/resources/manager/js/modules/localization-actions.d.ts b/modules/ui-module/src/main/resources/manager/js/modules/localization-actions.d.ts new file mode 100644 index 000000000..2e2207bff --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/js/modules/localization-actions.d.ts @@ -0,0 +1,34 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +export namespace ACTION_LOCALIZATIONS { + let en: {}; + let de: { + "addsection.input.name": string; + "addsection.select.": string; + "addsection.titles.modal": string; + "addsection.titles.alert": string; + "addsection.alerts.success.message": string; + "addsection.alerts.error.message": string; + "addsection.alerts.notemplate.message": string; + "addsection.alerts.nameexists.message": string; + }; +} diff --git a/modules/ui-module/src/main/resources/manager/js/modules/localization-loader.d.ts b/modules/ui-module/src/main/resources/manager/js/modules/localization-loader.d.ts new file mode 100644 index 000000000..b5a4a8b8e --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/js/modules/localization-loader.d.ts @@ -0,0 +1,45 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +export function loadLocalizationsWithDefaults(): Promise<{ + en: { + "ui.filebrowser.filename": string; + "ui.filebrowser.title": string; + "menu.settings": string; + "menu.settings.logout": string; + "language.en": string; + "language.de": string; + "buttons.ok": string; + "buttons.cancle": string; + "menu.page.settings": string; + }; + de: { + "ui.filebrowser.filename": string; + "ui.filebrowser.title": string; + "menu.settings": string; + "menu.settings.logout": string; + "language.en": string; + "language.de": string; + "buttons.ok": string; + "buttons.cancle": string; + "menu.page.settings": string; + }; +}>; diff --git a/modules/ui-module/src/main/resources/manager/js/modules/localization-modules.d.ts b/modules/ui-module/src/main/resources/manager/js/modules/localization-modules.d.ts new file mode 100644 index 000000000..912292f2b --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/js/modules/localization-modules.d.ts @@ -0,0 +1,37 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +export namespace MODULE_LOCALIZATIONS { + let en: {}; + let de: { + "alerts.select.title": string; + "alerts.select.placeholder": string; + "alerts.error.title": string; + "alerts.error.message": string; + "alerts.confirm.title": string; + "alerts.confirm.message": string; + "alerts.confirm.button.ok": string; + "alerts.confirm.button.cancel": string; + "alerts.prompt.title": string; + "alerts.prompt.lable": string; + "alerts.prompt.placeholder": string; + }; +} diff --git a/modules/ui-module/src/main/resources/manager/js/modules/localization.d.ts b/modules/ui-module/src/main/resources/manager/js/modules/localization.d.ts new file mode 100644 index 000000000..b36177aa6 --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/js/modules/localization.d.ts @@ -0,0 +1,53 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +export function localizeUi(): Promise; +export namespace i18n { + let _locale: any; + let _cache: any; + /** + * Loads and merges remote localizations with defaults. + */ + function init(): Promise; + /** + * Get current locale. + */ + function getLocale(): any; + /** + * Change the active locale and update cookie. + * @param {string} locale + */ + function setLocale(locale: string): void; + /** + * Returns the translation synchronously after init. + * @param {string} key + * @param {string} [defaultValue] + * @returns {string} + */ + function t(key: string, defaultValue?: string): string; + /** + * Returns the translation asynchronously (no need to call init beforehand). + * @param {string} key + * @param {string} [defaultValue] + * @returns {Promise} + */ + function tAsync(key: string, defaultValue?: string): Promise; +} diff --git a/modules/ui-module/src/main/resources/manager/js/modules/manager-ui.d.ts b/modules/ui-module/src/main/resources/manager/js/modules/manager-ui.d.ts new file mode 100644 index 000000000..cd1c90834 --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/js/modules/manager-ui.d.ts @@ -0,0 +1,23 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +export function updateStateButton(): void; +export function isPagePublishedExpired(contentResponse: any): boolean; diff --git a/modules/ui-module/src/main/resources/manager/js/modules/manager/manager.message.handlers.d.ts b/modules/ui-module/src/main/resources/manager/js/modules/manager/manager.message.handlers.d.ts new file mode 100644 index 000000000..f966e4979 --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/js/modules/manager/manager.message.handlers.d.ts @@ -0,0 +1,23 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +declare const initMessageHandlers: () => void; +export { initMessageHandlers }; diff --git a/modules/ui-module/src/main/resources/manager/js/modules/manager/media.inject.d.ts b/modules/ui-module/src/main/resources/manager/js/modules/manager/media.inject.d.ts new file mode 100644 index 000000000..d39806758 --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/js/modules/manager/media.inject.d.ts @@ -0,0 +1,25 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +export declare const initMediaUploadOverlay: (img: HTMLImageElement) => void; +export declare const initContentMediaToolbar: (img: HTMLImageElement) => void; +export declare const initMediaToolbar: (img: HTMLImageElement) => void; +export declare const initToolbar: (img: HTMLImageElement, toolbarDefinition: any) => void; diff --git a/modules/ui-module/src/main/resources/manager/js/modules/manager/toolbar-icons.d.ts b/modules/ui-module/src/main/resources/manager/js/modules/manager/toolbar-icons.d.ts new file mode 100644 index 000000000..5069db740 --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/js/modules/manager/toolbar-icons.d.ts @@ -0,0 +1,30 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +export declare const EDIT_PAGE_ICON = "\n\n \n \n"; +export declare const EDIT_ATTRIBUTES_ICON = "\n\n \n\n"; +export declare const SECTION_SORT_ICON = "\n\n \n \n\n"; +export declare const SECTION_ADD_ICON = "\n\n \n\n"; +export declare const SECTION_DELETE_ICON = "\n\n \n \n\n"; +export declare const IMAGE_ICON = "\n\n \n \n\n"; +export declare const SECTION_PUBLISHED_ICON = "\n\n \n \n\n"; +export declare const SECTION_UNPUBLISHED_ICON = "\n\n \n \n\n"; +export declare const MEDIA_CROP_ICON = "\n\n \n\n"; diff --git a/modules/ui-module/src/main/resources/manager/js/modules/manager/toolbar.inject.d.ts b/modules/ui-module/src/main/resources/manager/js/modules/manager/toolbar.inject.d.ts new file mode 100644 index 000000000..ff6bcf25b --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/js/modules/manager/toolbar.inject.d.ts @@ -0,0 +1,22 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +export declare const initToolbar: (container: HTMLElement) => void; diff --git a/modules/ui-module/src/main/resources/manager/js/modules/modal.d.ts b/modules/ui-module/src/main/resources/manager/js/modules/modal.d.ts new file mode 100644 index 000000000..6bfb626e2 --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/js/modules/modal.d.ts @@ -0,0 +1,22 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +export function openModal(optionsParam: any): any; diff --git a/modules/ui-module/src/main/resources/manager/js/modules/node.d.ts b/modules/ui-module/src/main/resources/manager/js/modules/node.d.ts new file mode 100644 index 000000000..504af55d9 --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/js/modules/node.d.ts @@ -0,0 +1,35 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +/** + * Retrieves a nested value from an object using a dot-notated path like "meta.title" + * @param {object} sourceObj - The object to retrieve the value from + * @param {string} path - Dot-notated string path, e.g., "meta.title" + * @returns {*} - The value found at the given path, or undefined if not found + */ +export function getValueByPath(sourceObj: object, path: string): any; +/** + * Builds a values object from an array of form fields + * @param {Array} fields - Array of form field objects, each with a .name property + * @param {object} sourceObj - The source object to extract the values from + * @returns {object} values - An object mapping field names to their corresponding values + */ +export function buildValuesFromFields(fields: any[], sourceObj: object): object; diff --git a/modules/ui-module/src/main/resources/manager/js/modules/preview.history.d.ts b/modules/ui-module/src/main/resources/manager/js/modules/preview.history.d.ts new file mode 100644 index 000000000..006b81543 --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/js/modules/preview.history.d.ts @@ -0,0 +1,28 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +export namespace PreviewHistory { + export { init }; + export { navigatePreview }; +} +declare function init(defaultUrl?: any): void; +declare function navigatePreview(url: any, usePush?: boolean): void; +export {}; diff --git a/modules/ui-module/src/main/resources/manager/js/modules/preview.utils.d.ts b/modules/ui-module/src/main/resources/manager/js/modules/preview.utils.d.ts new file mode 100644 index 000000000..982a622dc --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/js/modules/preview.utils.d.ts @@ -0,0 +1,27 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +export function activatePreviewOverlay(): void; +export function deActivatePreviewOverlay(): void; +export function getPreviewUrl(): any; +export function reloadPreview(): void; +export function loadPreview(url: any): void; +export function getPreviewFrame(): HTMLElement; diff --git a/modules/ui-module/src/main/resources/manager/js/modules/preview.utils.js b/modules/ui-module/src/main/resources/manager/js/modules/preview.utils.js index 7a86f5464..9289b53c6 100644 --- a/modules/ui-module/src/main/resources/manager/js/modules/preview.utils.js +++ b/modules/ui-module/src/main/resources/manager/js/modules/preview.utils.js @@ -64,7 +64,7 @@ const loadPreview = (url) => { parsedUrl.searchParams.append("preview", "manager"); } parsedUrl.searchParams.delete("preview-token"); - parsedUrl.searchParams.append("preview-token", window.manager.previewToken); + //parsedUrl.searchParams.append("preview-token", window.manager.previewToken); parsedUrl.searchParams.delete("nocache"); parsedUrl.searchParams.append("nocache", Date.now()); // Setze zusammengesetzten Pfad + Query zurück in das iframe diff --git a/modules/ui-module/src/main/resources/manager/js/modules/rpc/rpc-content.d.ts b/modules/ui-module/src/main/resources/manager/js/modules/rpc/rpc-content.d.ts new file mode 100644 index 000000000..90ead919d --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/js/modules/rpc/rpc-content.d.ts @@ -0,0 +1,29 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +declare const getContentNode: (options: any) => Promise; +declare const getContent: (options: any) => Promise; +declare const setContent: (options: any) => Promise; +declare const setMeta: (options: any) => Promise; +declare const setMetaBatch: (options: any) => Promise; +declare const addSection: (options: any) => Promise; +declare const deleteSection: (options: any) => Promise; +export { getContentNode, getContent, setContent, setMeta, setMetaBatch, addSection, deleteSection }; diff --git a/modules/ui-module/src/main/resources/manager/js/modules/rpc/rpc-files.d.ts b/modules/ui-module/src/main/resources/manager/js/modules/rpc/rpc-files.d.ts new file mode 100644 index 000000000..d18d08d2a --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/js/modules/rpc/rpc-files.d.ts @@ -0,0 +1,28 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +declare const listFiles: (options: any) => Promise; +declare const deleteFile: (options: any, any: any) => Promise; +declare const deleteFolder: (options: any) => Promise; +declare const createFolder: (options: any) => Promise; +declare const createFile: (options: any) => Promise; +declare const renameFile: (options: any) => Promise; +export { listFiles, deleteFile, createFolder, createFile, deleteFolder, renameFile }; diff --git a/modules/ui-module/src/main/resources/manager/js/modules/rpc/rpc-i18n.d.ts b/modules/ui-module/src/main/resources/manager/js/modules/rpc/rpc-i18n.d.ts new file mode 100644 index 000000000..360e9a43d --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/js/modules/rpc/rpc-i18n.d.ts @@ -0,0 +1,23 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +declare const loadLocalizations: (options: any) => Promise; +export { loadLocalizations }; diff --git a/modules/ui-module/src/main/resources/manager/js/modules/rpc/rpc-manager.d.ts b/modules/ui-module/src/main/resources/manager/js/modules/rpc/rpc-manager.d.ts new file mode 100644 index 000000000..136bc5d30 --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/js/modules/rpc/rpc-manager.d.ts @@ -0,0 +1,44 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +declare const getSectionTemplates: (options: any) => Promise; +declare const getPageTemplates: (options: any) => Promise; +declare const getListItemTypes: (options: any) => Promise; +declare const getMediaForm: (options: any) => Promise; +export declare enum Format { + WEBP = 0, + JPEG = 1, + PNG = 2 +} +export interface MediaFormat { + name: string; + height?: number; + width?: number; + format: Format; + compression: boolean; + cropped: boolean; +} +export interface MediaFormatsResponse { + result: MediaFormat[]; +} +declare const getMediaFormats: (options: any) => Promise; +declare const getTagNames: (options: any) => Promise; +export { getSectionTemplates, getPageTemplates, getMediaForm, getTagNames, getMediaFormats, getListItemTypes }; diff --git a/modules/ui-module/src/main/resources/manager/js/modules/rpc/rpc-media.d.ts b/modules/ui-module/src/main/resources/manager/js/modules/rpc/rpc-media.d.ts new file mode 100644 index 000000000..f922db30d --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/js/modules/rpc/rpc-media.d.ts @@ -0,0 +1,24 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +declare const getMediaMetaData: (options: any) => Promise; +declare const setMediaMetaData: (options: any) => Promise; +export { getMediaMetaData, setMediaMetaData }; diff --git a/modules/ui-module/src/main/resources/manager/js/modules/rpc/rpc-page.d.ts b/modules/ui-module/src/main/resources/manager/js/modules/rpc/rpc-page.d.ts new file mode 100644 index 000000000..ca467aae2 --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/js/modules/rpc/rpc-page.d.ts @@ -0,0 +1,29 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +export interface PageCreateOptions { + uri: string; + name: string; + contentType: string; +} +declare const createPage: (options: PageCreateOptions) => Promise; +declare const deletePage: (options: any) => Promise; +export { createPage, deletePage }; diff --git a/modules/ui-module/src/main/resources/manager/js/modules/rpc/rpc-translation.d.ts b/modules/ui-module/src/main/resources/manager/js/modules/rpc/rpc-translation.d.ts new file mode 100644 index 000000000..9940a6e7c --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/js/modules/rpc/rpc-translation.d.ts @@ -0,0 +1,54 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +export interface GetTranslationsOptions { + uri: string; +} +export interface TranslationDto { + site: string; + lang: string; + country: string; + url?: string; + managerDeepLink?: string; +} +declare const getTranslations: (options: GetTranslationsOptions) => Promise<{ + translations: TranslationDto[]; +}>; +export interface AddTranslationOptions { + uri: string; + language: string; + translationUri: string; +} +export interface AddTranslationResult { + uri: string; + error?: boolean; +} +declare const addTranslation: (options: AddTranslationOptions) => Promise; +export interface RemoveTranslationOptions { + uri: string; + lang: string; +} +export interface RemoveTranslationResult { + uri: string; + error?: boolean; +} +declare const removeTranslation: (options: RemoveTranslationOptions) => Promise; +export { getTranslations, addTranslation, removeTranslation }; diff --git a/modules/ui-module/src/main/resources/manager/js/modules/rpc/rpc.d.ts b/modules/ui-module/src/main/resources/manager/js/modules/rpc/rpc.d.ts new file mode 100644 index 000000000..4418fb314 --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/js/modules/rpc/rpc.d.ts @@ -0,0 +1,28 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +interface Options { + method: string; + parameters?: any; +} +declare const executeRemoteCall: (options: Options) => Promise; +declare const executeRemoteMethodCall: (method: string, parameters: any) => Promise; +export { executeRemoteCall, executeRemoteMethodCall }; diff --git a/modules/ui-module/src/main/resources/manager/js/modules/sidebar.d.ts b/modules/ui-module/src/main/resources/manager/js/modules/sidebar.d.ts new file mode 100644 index 000000000..920c2d6ae --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/js/modules/sidebar.d.ts @@ -0,0 +1,22 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +export function openSidebar(options: any): void; diff --git a/modules/ui-module/src/main/resources/manager/js/modules/state.d.ts b/modules/ui-module/src/main/resources/manager/js/modules/state.d.ts new file mode 100644 index 000000000..f36436538 --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/js/modules/state.d.ts @@ -0,0 +1,28 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +declare class State { + constructor(initialState?: {}); + state: {}; + observers: any[]; + observe(observer: any): void; + unobserve(observer: any): void; +} diff --git a/modules/ui-module/src/main/resources/manager/js/modules/toast.d.ts b/modules/ui-module/src/main/resources/manager/js/modules/toast.d.ts new file mode 100644 index 000000000..ec219d2e3 --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/js/modules/toast.d.ts @@ -0,0 +1,22 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +export function showToast(options: any): void; diff --git a/modules/ui-module/src/main/resources/manager/js/modules/ui-state.d.ts b/modules/ui-module/src/main/resources/manager/js/modules/ui-state.d.ts new file mode 100644 index 000000000..3e1bbd6c2 --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/js/modules/ui-state.d.ts @@ -0,0 +1,31 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +export namespace UIStateManager { + function setTabState(key: any, value: any): void; + function getTabState(key: any, defaultValue?: any): any; + function setLocale(locale: any): void; + function getLocale(): any; + function removeTabState(key: any): void; + function setAuthToken(token: any): void; + function getAuthToken(): string; + function clearAuthToken(): void; +} diff --git a/modules/ui-module/src/main/resources/manager/js/modules/upload.d.ts b/modules/ui-module/src/main/resources/manager/js/modules/upload.d.ts new file mode 100644 index 000000000..688870479 --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/js/modules/upload.d.ts @@ -0,0 +1,29 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +export function uploadFileWithProgress({ uploadEndpoint, file, uri, onProgress, onSuccess, onError }: { + uploadEndpoint: any; + file: any; + uri: any; + onProgress: any; + onSuccess: any; + onError: any; +}): void; diff --git a/modules/ui-module/src/main/resources/manager/js/ui-actions.d.ts b/modules/ui-module/src/main/resources/manager/js/ui-actions.d.ts new file mode 100644 index 000000000..4e9fd1670 --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/js/ui-actions.d.ts @@ -0,0 +1,22 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +export {}; diff --git a/modules/ui-module/src/main/resources/manager/public/manager-login.d.ts b/modules/ui-module/src/main/resources/manager/public/manager-login.d.ts new file mode 100644 index 000000000..eade13d3f --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/public/manager-login.d.ts @@ -0,0 +1,29 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +declare const ui: { + state: string; +}; +declare const setWarningMessage: (message: string) => void; +declare const clearMessage: () => void; +declare const signIn: (e: Event) => void; +declare const validate: (e: Event) => void; +declare const formSubmit: (e: Event) => void; diff --git a/modules/ui-module/src/main/ts/dist/js/modules/preview.utils.js b/modules/ui-module/src/main/ts/dist/js/modules/preview.utils.js index 7a86f5464..9289b53c6 100644 --- a/modules/ui-module/src/main/ts/dist/js/modules/preview.utils.js +++ b/modules/ui-module/src/main/ts/dist/js/modules/preview.utils.js @@ -64,7 +64,7 @@ const loadPreview = (url) => { parsedUrl.searchParams.append("preview", "manager"); } parsedUrl.searchParams.delete("preview-token"); - parsedUrl.searchParams.append("preview-token", window.manager.previewToken); + //parsedUrl.searchParams.append("preview-token", window.manager.previewToken); parsedUrl.searchParams.delete("nocache"); parsedUrl.searchParams.append("nocache", Date.now()); // Setze zusammengesetzten Pfad + Query zurück in das iframe diff --git a/modules/ui-module/src/main/ts/src/js/modules/preview.utils.js b/modules/ui-module/src/main/ts/src/js/modules/preview.utils.js index 489922bf0..53a1fe0af 100644 --- a/modules/ui-module/src/main/ts/src/js/modules/preview.utils.js +++ b/modules/ui-module/src/main/ts/src/js/modules/preview.utils.js @@ -72,7 +72,7 @@ const loadPreview = (url) => { parsedUrl.searchParams.append("preview", "manager"); } parsedUrl.searchParams.delete("preview-token") - parsedUrl.searchParams.append("preview-token", window.manager.previewToken); + //parsedUrl.searchParams.append("preview-token", window.manager.previewToken); parsedUrl.searchParams.delete("nocache"); parsedUrl.searchParams.append("nocache", Date.now()); diff --git a/modules/ui-module/src/test/java/com/condation/cms/modules/ui/utils/TokenUtilsTest.java b/modules/ui-module/src/test/java/com/condation/cms/modules/ui/utils/TokenUtilsTest.java index 00a461a85..4466925ba 100644 --- a/modules/ui-module/src/test/java/com/condation/cms/modules/ui/utils/TokenUtilsTest.java +++ b/modules/ui-module/src/test/java/com/condation/cms/modules/ui/utils/TokenUtilsTest.java @@ -22,6 +22,7 @@ * #L% */ +import java.time.Duration; import org.assertj.core.api.Assertions; import org.junit.jupiter.api.Test; @@ -34,7 +35,7 @@ public class TokenUtilsTest { @Test public void create_and_validate() throws Exception { - var token = TokenUtils.createToken("condation", "my secret"); + var token = TokenUtils.createToken("condation", "my secret", Duration.ofHours(1), Duration.ofHours(1)); var payload = TokenUtils.getPayload(token, "my secret"); Assertions.assertThat(payload).isPresent(); @@ -43,7 +44,7 @@ public void create_and_validate() throws Exception { @Test public void create_and_validate__wrong_secret() throws Exception { - var token = TokenUtils.createToken("condation", "my secret"); + var token = TokenUtils.createToken("condation", "my secret", Duration.ofHours(1), Duration.ofHours(1)); var payload = TokenUtils.getPayload(token, "another secret"); Assertions.assertThat(payload).isNotPresent(); From 30ad153220a3a492e47179948d0e1587492a6b8d Mon Sep 17 00:00:00 2001 From: Thorsten Marx Date: Thu, 11 Dec 2025 15:21:26 +0100 Subject: [PATCH 07/11] update to jwt --- modules/ui-module/pom.xml | 17 ++ .../cms/modules/ui/utils/TokenUtils.java | 188 ++++++++++++------ .../cms/modules/ui/utils/TokenUtilsTest.java | 25 ++- test-server/server.toml | 3 + 4 files changed, 166 insertions(+), 67 deletions(-) diff --git a/modules/ui-module/pom.xml b/modules/ui-module/pom.xml index f8e85b245..24b5881f7 100644 --- a/modules/ui-module/pom.xml +++ b/modules/ui-module/pom.xml @@ -22,6 +22,23 @@ com.condation.cms cms-auth + + io.jsonwebtoken + jjwt-api + 0.13.0 + + + io.jsonwebtoken + jjwt-impl + 0.13.0 + runtime + + + io.jsonwebtoken + jjwt-gson + 0.13.0 + runtime + org.apache.tika tika-core diff --git a/modules/ui-module/src/main/java/com/condation/cms/modules/ui/utils/TokenUtils.java b/modules/ui-module/src/main/java/com/condation/cms/modules/ui/utils/TokenUtils.java index f1ae98b65..cf6e0bc94 100644 --- a/modules/ui-module/src/main/java/com/condation/cms/modules/ui/utils/TokenUtils.java +++ b/modules/ui-module/src/main/java/com/condation/cms/modules/ui/utils/TokenUtils.java @@ -21,93 +21,157 @@ * . * #L% */ -import com.condation.cms.modules.ui.utils.json.UIGsonProvider; + +import io.jsonwebtoken.Claims; +import io.jsonwebtoken.ExpiredJwtException; +import io.jsonwebtoken.Jws; +import io.jsonwebtoken.JwtException; +import io.jsonwebtoken.Jwts; +import io.jsonwebtoken.security.Keys; import java.nio.charset.StandardCharsets; -import java.security.MessageDigest; import java.time.Duration; import java.time.Instant; -import java.util.Base64; -import java.util.Collections; +import java.util.Date; import java.util.HashMap; import java.util.Map; import java.util.Optional; import java.util.UUID; -import javax.crypto.Mac; -import javax.crypto.spec.SecretKeySpec; +import javax.crypto.SecretKey; +import lombok.extern.slf4j.Slf4j; +@Slf4j public class TokenUtils { - public static Optional getPayload(String token, String secret) { - try { - String[] parts = token.split(":"); - if (parts.length != 2) { - return Optional.empty(); - } - - String base64Payload = parts[0]; - String signature = parts[1]; - - String expectedSig = hmacSha256(base64Payload, secret); - if (!MessageDigest.isEqual(expectedSig.getBytes(StandardCharsets.UTF_8), signature.getBytes(StandardCharsets.UTF_8))) { - return Optional.empty(); - } - - String json = new String(Base64.getUrlDecoder().decode(base64Payload), StandardCharsets.UTF_8); - Payload payload = UIGsonProvider.INSTANCE.fromJson(json, Payload.class); - - long now = Instant.now().getEpochSecond(); - - // BEIDE Grenzen prüfen! - if (now >= payload.expiresAt()) { - return Optional.empty(); // Idle timeout - } - if (now >= payload.maxLifetime()) { - return Optional.empty(); // Absolute grenze - } - - return Optional.of(payload); - } catch (Exception e) { - return Optional.empty(); - } - } - - public static String createToken(String username, String SECRET, Map payloadData, Duration idleTimeout, Duration maxLifetime) throws Exception { + /** + * Erstelle ein neues JWT Token + * @param username Benutzername + * @param secret Geheimer Schlüssel für die Signatur + * @param payloadData Zusätzliche Claims + * @param idleTimeout Idle Timeout (Inaktivität) + * @param maxLifetime Absolutes Maximum + * @return JWT Token String + */ + public static String createToken(String username, String secret, + Map payloadData, Duration idleTimeout, Duration maxLifetime) throws Exception { + Instant now = Instant.now(); Instant expiresAt = now.plus(idleTimeout); Instant maxAt = now.plus(maxLifetime); - payloadData.put("uuid", UUID.randomUUID().toString()); + // Erstelle Secret Key aus String + SecretKey key = Keys.hmacShaKeyFor(secret.getBytes(StandardCharsets.UTF_8)); - Payload payload = new Payload(username, - now.getEpochSecond(), - expiresAt.getEpochSecond(), - maxAt.getEpochSecond(), - payloadData); - - String json = UIGsonProvider.INSTANCE.toJson(payload); - String base64Payload = Base64.getUrlEncoder().withoutPadding().encodeToString(json.getBytes(StandardCharsets.UTF_8)); - String signature = hmacSha256(base64Payload, SECRET); - return base64Payload + ":" + signature; + // Baue das JWT + String token = Jwts.builder() + // Standard Claims + .subject(username) + .issuedAt(Date.from(now)) + .expiration(Date.from(expiresAt)) + + // Custom Claims + .claim("username", username) + .claim("expiresAt", expiresAt.getEpochSecond()) + .claim("maxLifetime", maxAt.getEpochSecond()) + .claim("tokenId", UUID.randomUUID().toString()) + + // Zusätzliche Payload-Daten + .claims(payloadData) + + // Signiere mit HMAC-SHA256 + .signWith(key) + .compact(); + + return token; } - public static String createToken(String username, String SECRET, Duration idleTimeout, Duration maxLifetime) throws Exception { - return createToken(username, SECRET, new HashMap<>(), idleTimeout, maxLifetime); + /** + * Erstelle Token mit Standard Payload + * @param username + * @param secret + * @return + */ + public static String createToken(String username, String secret, + Duration idleTimeout, Duration maxLifetime) throws Exception { + return createToken(username, secret, new HashMap<>(), idleTimeout, maxLifetime); } - private static String hmacSha256(String data, String key) throws Exception { - Mac mac = Mac.getInstance("HmacSHA256"); - SecretKeySpec secretKeySpec = new SecretKeySpec(key.getBytes(StandardCharsets.UTF_8), "HmacSHA256"); - mac.init(secretKeySpec); - byte[] hash = mac.doFinal(data.getBytes(StandardCharsets.UTF_8)); - return Base64.getUrlEncoder().withoutPadding().encodeToString(hash); + /** + * Validiere und dekodiere das Token + * @param token JWT Token String + * @param secret Geheimer Schlüssel + * @return Optional mit Token-Daten oder leer wenn ungültig + */ + public static Optional getPayload(String token, String secret) { + try { + // Erstelle Secret Key + SecretKey key = Keys.hmacShaKeyFor(secret.getBytes(StandardCharsets.UTF_8)); + + // Parse und validiere Token + Jws jws = Jwts.parser() + .verifyWith(key) + .build() + .parseSignedClaims(token); + + Claims claims = jws.getBody(); + + // Hole Custom Claims + String username = claims.get("username", String.class); + Long expiresAt = claims.get("expiresAt", Long.class); + Long maxLifetime = claims.get("maxLifetime", Long.class); + + long now = Instant.now().getEpochSecond(); + + // Prüfe Idle Timeout + if (now >= expiresAt) { + log.debug("Token idle timeout exceeded"); + return Optional.empty(); + } + + // Prüfe absolutes Maximum + if (now >= maxLifetime) { + log.debug("Token max lifetime exceeded"); + return Optional.empty(); + } + + // Extrahiere alle Claims als Map + Map data = new HashMap<>(claims); + + return Optional.of(new Payload( + username, + claims.getIssuedAt().getTime() / 1000, + expiresAt, + maxLifetime, + data + )); + + } catch (ExpiredJwtException e) { + log.debug("Token has expired"); + return Optional.empty(); + } catch (JwtException e) { + log.debug("Invalid JWT token: {}", e.getMessage()); + return Optional.empty(); + } catch (Exception e) { + log.debug("Error parsing token", e); + return Optional.empty(); + } } + /** + * Payload Record für Token-Daten + */ public record Payload( String username, long issuedAt, long expiresAt, long maxLifetime, Map data) { - + + /** + * Prüfe ob Token noch gültig ist (Idle + Max Lifetime) + */ + public boolean isValid() { + long now = Instant.now().getEpochSecond(); + return now < expiresAt && now < maxLifetime; + } } -} +} \ No newline at end of file diff --git a/modules/ui-module/src/test/java/com/condation/cms/modules/ui/utils/TokenUtilsTest.java b/modules/ui-module/src/test/java/com/condation/cms/modules/ui/utils/TokenUtilsTest.java index 4466925ba..d0bc71d2e 100644 --- a/modules/ui-module/src/test/java/com/condation/cms/modules/ui/utils/TokenUtilsTest.java +++ b/modules/ui-module/src/test/java/com/condation/cms/modules/ui/utils/TokenUtilsTest.java @@ -22,7 +22,9 @@ * #L% */ +import io.jsonwebtoken.Jwts; import java.time.Duration; +import java.util.Base64; import org.assertj.core.api.Assertions; import org.junit.jupiter.api.Test; @@ -32,19 +34,29 @@ */ public class TokenUtilsTest { - + private String key () { + return Base64.getEncoder() + .encodeToString(Jwts.SIG.HS256.key().build().getEncoded()); + } + @Test public void create_and_validate() throws Exception { - var token = TokenUtils.createToken("condation", "my secret", Duration.ofHours(1), Duration.ofHours(1)); - var payload = TokenUtils.getPayload(token, "my secret"); + var secret = key(); + + var token = TokenUtils.createToken("condation", secret, Duration.ofHours(1), Duration.ofHours(1)); + + var payload = TokenUtils.getPayload(token, secret); Assertions.assertThat(payload).isPresent(); Assertions.assertThat(payload.get().username()).isEqualTo("condation"); } @Test public void create_and_validate__wrong_secret() throws Exception { - var token = TokenUtils.createToken("condation", "my secret", Duration.ofHours(1), Duration.ofHours(1)); + + var secret = key(); + + var token = TokenUtils.createToken("condation", secret, Duration.ofHours(1), Duration.ofHours(1)); var payload = TokenUtils.getPayload(token, "another secret"); Assertions.assertThat(payload).isNotPresent(); @@ -52,7 +64,10 @@ public void create_and_validate__wrong_secret() throws Exception { @Test public void create_and_validate__wrong_token() throws Exception { - var payload = TokenUtils.getPayload("bliblablub", "my secret"); + + var secret = key(); + + var payload = TokenUtils.getPayload("bliblablub", secret); Assertions.assertThat(payload).isNotPresent(); } diff --git a/test-server/server.toml b/test-server/server.toml index 59d27dce2..9ca3ff5b2 100644 --- a/test-server/server.toml +++ b/test-server/server.toml @@ -19,6 +19,9 @@ pool_enabled = false pool_size = 10 pool_expire = 1000 +[ui] +secret = "xnK82mcK7I9s_K3j-L8vK9L2m_N3o_P4q_R5s_T6u_V7w_X8y_Z9a_B0c_D1e" + [list] test = ["eins", "zwei"] From 9f01f1e84023236a0e210e8c282d06af660a74db Mon Sep 17 00:00:00 2001 From: Thorsten Marx Date: Thu, 11 Dec 2025 15:23:28 +0100 Subject: [PATCH 08/11] move secret to env file --- test-server/.env | 2 +- test-server/server.toml | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/test-server/.env b/test-server/.env index f8eae0f83..3421fc7fa 100644 --- a/test-server/.env +++ b/test-server/.env @@ -1 +1 @@ -UI_SECRET=super-secret-token \ No newline at end of file +UI_SECRET=xnK82mcK7I9s_K3j-L8vK9L2m_N3o_P4q_R5s_T6u_V7w_X8y_Z9a_B0c_D1e \ No newline at end of file diff --git a/test-server/server.toml b/test-server/server.toml index 9ca3ff5b2..0ad23db61 100644 --- a/test-server/server.toml +++ b/test-server/server.toml @@ -19,8 +19,6 @@ pool_enabled = false pool_size = 10 pool_expire = 1000 -[ui] -secret = "xnK82mcK7I9s_K3j-L8vK9L2m_N3o_P4q_R5s_T6u_V7w_X8y_Z9a_B0c_D1e" [list] test = ["eins", "zwei"] From 18ec0778c3cb8320e2bfeb54c3c265002474ade8 Mon Sep 17 00:00:00 2001 From: Thorsten Marx Date: Fri, 12 Dec 2025 10:26:22 +0100 Subject: [PATCH 09/11] update csrf token usage --- .../src/main/resources/manager/index.html | 5 ++-- .../resources/manager/js/manager-globals.d.ts | 8 +++--- .../resources/manager/js/manager-globals.js | 19 +++++++------- .../js/modules/filebrowser.template.js | 1 + .../manager/js/modules/form/field.markdown.js | 1 + .../manager/js/modules/form/field.media.js | 1 + .../manager/manager.message.handlers.js | 1 + .../resources/manager/js/modules/rpc/rpc.js | 3 ++- .../resources/manager/js/modules/upload.js | 3 ++- .../resources/manager/js/modules/utils.d.ts | 22 ++++++++++++++++ .../resources/manager/js/modules/utils.js | 25 +++++++++++++++++++ .../main/resources/manager/js/ui-actions.js | 1 + .../src/main/ts/dist/js/manager-globals.d.ts | 8 +++--- .../src/main/ts/dist/js/manager-globals.js | 19 +++++++------- .../dist/js/modules/filebrowser.template.js | 1 + .../ts/dist/js/modules/form/field.markdown.js | 1 + .../ts/dist/js/modules/form/field.media.js | 1 + .../manager/manager.message.handlers.js | 1 + .../src/main/ts/dist/js/modules/rpc/rpc.js | 3 ++- .../src/main/ts/dist/js/modules/upload.js | 3 ++- .../src/main/ts/dist/js/modules/utils.d.ts | 1 + .../src/main/ts/dist/js/modules/utils.js | 4 +++ .../src/main/ts/dist/js/ui-actions.js | 1 + modules/ui-module/src/main/ts/globals.d.ts | 9 +------ .../src/main/ts/src/js/manager-globals.js | 12 +++++---- .../ts/src/js/modules/filebrowser.template.js | 1 + .../ts/src/js/modules/form/field.markdown.ts | 1 + .../ts/src/js/modules/form/field.media.ts | 1 + .../manager/manager.message.handlers.ts | 1 + .../src/main/ts/src/js/modules/rpc/rpc.ts | 3 ++- .../src/main/ts/src/js/modules/upload.js | 5 +++- .../src/main/ts/src/js/modules/utils.ts | 4 +++ .../src/main/ts/src/js/ui-actions.js | 1 + modules/ui-module/src/main/ts/tsconfig.json | 2 +- 34 files changed, 124 insertions(+), 49 deletions(-) create mode 100644 modules/ui-module/src/main/resources/manager/js/modules/utils.d.ts create mode 100644 modules/ui-module/src/main/resources/manager/js/modules/utils.js create mode 100644 modules/ui-module/src/main/ts/dist/js/modules/utils.d.ts create mode 100644 modules/ui-module/src/main/ts/dist/js/modules/utils.js create mode 100644 modules/ui-module/src/main/ts/src/js/modules/utils.ts diff --git a/modules/ui-module/src/main/resources/manager/index.html b/modules/ui-module/src/main/resources/manager/index.html index 981ccf58d..ebad8413c 100644 --- a/modules/ui-module/src/main/resources/manager/index.html +++ b/modules/ui-module/src/main/resources/manager/index.html @@ -87,10 +87,10 @@ } } + - @@ -212,7 +211,7 @@
+ src="{{ links.createUrl('/?preview=manager&preview-token22=' + previewToken) | raw }}">
. * #L% */ -declare function executeScriptAction(action: any): Promise; -declare function executeHookAction(action: any): Promise; +export function executeScriptAction(action: any): Promise; +export function executeHookAction(action: any): Promise; /** * Patches a relative path so that it's correctly prefixed with the given manager base path. * @@ -28,11 +28,11 @@ declare function executeHookAction(action: any): Promise; * @param {string} managerBasePath e.g. "/manager" or "/de/manager" * @returns {string} e.g. "/de/manager/module" */ -declare function patchManagerPath(relativePath: string, managerBasePath: string): string; +export function patchManagerPath(relativePath: string, managerBasePath: string): string; /** * Patches a path with the context path, if not already present. * * @param {string} path - The original path (e.g. "/assets/images/test.jpg"). * @returns {string} - The patched path with context prefix if needed. */ -declare function patchPathWithContext(path: string): string; +export function patchPathWithContext(path: string): string; diff --git a/modules/ui-module/src/main/resources/manager/js/manager-globals.js b/modules/ui-module/src/main/resources/manager/js/manager-globals.js index e3c1092ee..d71820d5f 100644 --- a/modules/ui-module/src/main/resources/manager/js/manager-globals.js +++ b/modules/ui-module/src/main/resources/manager/js/manager-globals.js @@ -1,3 +1,4 @@ +import { getCSRFToken } from "./modules/utils"; /*- * #%L * ui-module @@ -19,7 +20,7 @@ * . * #L% */ -const executeScriptAction = async (action) => { +export async function executeScriptAction(action) { if (action.module && action.function === "runAction") { var modulePath = patchManagerPath(action.module, window.manager.baseUrl); import(modulePath) @@ -41,8 +42,8 @@ const executeScriptAction = async (action) => { } }); } -}; -const executeHookAction = async (action) => { +} +export async function executeHookAction(action) { var data = { hook: action.hook }; @@ -52,12 +53,12 @@ const executeHookAction = async (action) => { const response = await fetch(window.manager.baseUrl + "/hooks", { headers: { 'Content-Type': 'application/json', - 'X-CSRF-Token': window.manager.csrfToken + 'X-CSRF-Token': getCSRFToken() }, method: "POST", body: JSON.stringify(data) }); -}; +} /** * Patches a relative path so that it's correctly prefixed with the given manager base path. * @@ -65,7 +66,7 @@ const executeHookAction = async (action) => { * @param {string} managerBasePath e.g. "/manager" or "/de/manager" * @returns {string} e.g. "/de/manager/module" */ -const patchManagerPath = (relativePath, managerBasePath) => { +export function patchManagerPath(relativePath, managerBasePath) { if (!relativePath || !managerBasePath) { throw new Error("Both paths must be provided."); } @@ -78,14 +79,14 @@ const patchManagerPath = (relativePath, managerBasePath) => { return rel; } return base + rel; -}; +} /** * Patches a path with the context path, if not already present. * * @param {string} path - The original path (e.g. "/assets/images/test.jpg"). * @returns {string} - The patched path with context prefix if needed. */ -const patchPathWithContext = (path) => { +export function patchPathWithContext(path) { const contextPath = window.manager.contextPath || "/"; // Normalize context path (remove trailing slash if not just "/") const normalizedContext = contextPath !== "/" ? contextPath.replace(/\/+$/, "") : ""; @@ -95,4 +96,4 @@ const patchPathWithContext = (path) => { } // Patch path (avoid double slashes) return normalizedContext + (path.startsWith("/") ? path : "/" + path); -}; +} diff --git a/modules/ui-module/src/main/resources/manager/js/modules/filebrowser.template.js b/modules/ui-module/src/main/resources/manager/js/modules/filebrowser.template.js index 5370f0482..c478b46bf 100644 --- a/modules/ui-module/src/main/resources/manager/js/modules/filebrowser.template.js +++ b/modules/ui-module/src/main/resources/manager/js/modules/filebrowser.template.js @@ -20,6 +20,7 @@ * #L% */ import Handlebars from 'https://cdn.jsdelivr.net/npm/handlebars@4.7.8/+esm'; +import { patchPathWithContext } from "@cms/js/manager-globals"; Handlebars.registerHelper("patchPathWithContext", patchPathWithContext); Handlebars.registerHelper('concat', function (...args) { args.pop(); diff --git a/modules/ui-module/src/main/resources/manager/js/modules/form/field.markdown.js b/modules/ui-module/src/main/resources/manager/js/modules/form/field.markdown.js index c4a5d58e1..2a66d9a54 100644 --- a/modules/ui-module/src/main/resources/manager/js/modules/form/field.markdown.js +++ b/modules/ui-module/src/main/resources/manager/js/modules/form/field.markdown.js @@ -24,6 +24,7 @@ import { i18n } from "@cms/modules/localization.js"; import { getMediaFormats, getTagNames } from "@cms/modules/rpc/rpc-manager.js"; import { openFileBrowser } from "@cms/modules/filebrowser.js"; import { alertSelect } from "@cms/modules/alerts.js"; +import { patchPathWithContext } from "@cms/js/manager-globals"; let cherryEditors = []; const createMarkdownField = (options, value = '') => { const id = createID(); diff --git a/modules/ui-module/src/main/resources/manager/js/modules/form/field.media.js b/modules/ui-module/src/main/resources/manager/js/modules/form/field.media.js index dba4cd1d9..e13f27bdf 100644 --- a/modules/ui-module/src/main/resources/manager/js/modules/form/field.media.js +++ b/modules/ui-module/src/main/resources/manager/js/modules/form/field.media.js @@ -23,6 +23,7 @@ import { createID } from "@cms/modules/form/utils.js"; import { i18n } from "@cms/modules/localization.js"; import { uploadFileWithProgress } from "@cms/modules/upload.js"; import { openFileBrowser } from "@cms/modules/filebrowser.js"; +import { patchPathWithContext } from "@cms/js/manager-globals"; const createMediaField = (options, value = '') => { const id = createID(); const key = "field." + options.name; diff --git a/modules/ui-module/src/main/resources/manager/js/modules/manager/manager.message.handlers.js b/modules/ui-module/src/main/resources/manager/js/modules/manager/manager.message.handlers.js index 0b1320db7..588bee687 100644 --- a/modules/ui-module/src/main/resources/manager/js/modules/manager/manager.message.handlers.js +++ b/modules/ui-module/src/main/resources/manager/js/modules/manager/manager.message.handlers.js @@ -19,6 +19,7 @@ * . * #L% */ +import { executeScriptAction } from '@cms/js/manager-globals.js'; import frameMessenger from '@cms/modules/frameMessenger.js'; import { getPreviewFrame, getPreviewUrl } from '@cms/modules/preview.utils.js'; import { getContentNode } from '@cms/modules/rpc/rpc-content.js'; diff --git a/modules/ui-module/src/main/resources/manager/js/modules/rpc/rpc.js b/modules/ui-module/src/main/resources/manager/js/modules/rpc/rpc.js index 6400dca1f..6d5aae5db 100644 --- a/modules/ui-module/src/main/resources/manager/js/modules/rpc/rpc.js +++ b/modules/ui-module/src/main/resources/manager/js/modules/rpc/rpc.js @@ -20,6 +20,7 @@ * #L% */ import { i18n } from "@cms/modules/localization.js"; +import { getCSRFToken } from "../utils"; const executeRemoteCall = async (options) => { return executeRemoteMethodCall(options.method, options.parameters); }; @@ -32,7 +33,7 @@ const executeRemoteMethodCall = async (method, parameters) => { method: "POST", headers: { 'Content-Type': 'application/json', - 'X-CSRF-Token': window.manager.csrfToken + 'X-CSRF-Token': getCSRFToken() }, body: JSON.stringify(data) }); diff --git a/modules/ui-module/src/main/resources/manager/js/modules/upload.js b/modules/ui-module/src/main/resources/manager/js/modules/upload.js index 16964b1a0..70795ad7e 100644 --- a/modules/ui-module/src/main/resources/manager/js/modules/upload.js +++ b/modules/ui-module/src/main/resources/manager/js/modules/upload.js @@ -19,6 +19,7 @@ * . * #L% */ +import { getCSRFToken } from "./utils"; // uploadFileWithProgress.js export function uploadFileWithProgress({ uploadEndpoint, file, uri, onProgress, onSuccess, onError }) { if (!file) { @@ -35,7 +36,7 @@ export function uploadFileWithProgress({ uploadEndpoint, file, uri, onProgress, formData.append("uri", uri); const xhr = new XMLHttpRequest(); xhr.open("POST", uploadEndpoint ?? "/manager/upload", true); - xhr.setRequestHeader("X-CSRF-Token", window.manager.csrfToken); + xhr.setRequestHeader("X-CSRF-Token", getCSRFToken()); xhr.upload.onprogress = (event) => { if (event.lengthComputable && typeof onProgress === "function") { const percent = Math.round((event.loaded / event.total) * 100); diff --git a/modules/ui-module/src/main/resources/manager/js/modules/utils.d.ts b/modules/ui-module/src/main/resources/manager/js/modules/utils.d.ts new file mode 100644 index 000000000..beb55a220 --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/js/modules/utils.d.ts @@ -0,0 +1,22 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +export declare function getCSRFToken(): string | null; diff --git a/modules/ui-module/src/main/resources/manager/js/modules/utils.js b/modules/ui-module/src/main/resources/manager/js/modules/utils.js new file mode 100644 index 000000000..48b7c7a5e --- /dev/null +++ b/modules/ui-module/src/main/resources/manager/js/modules/utils.js @@ -0,0 +1,25 @@ +/*- + * #%L + * ui-module + * %% + * Copyright (C) 2023 - 2025 CondationCMS + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ +export function getCSRFToken() { + const meta = document.querySelector('meta[name="csrf-token"]'); + return meta ? meta.getAttribute('content') : null; +} diff --git a/modules/ui-module/src/main/resources/manager/js/ui-actions.js b/modules/ui-module/src/main/resources/manager/js/ui-actions.js index 4e819f324..b3fbdd62b 100644 --- a/modules/ui-module/src/main/resources/manager/js/ui-actions.js +++ b/modules/ui-module/src/main/resources/manager/js/ui-actions.js @@ -21,6 +21,7 @@ */ import { EventBus } from '@cms/modules/event-bus.js'; import { i18n, localizeUi } from '@cms/modules/localization.js'; +import { executeHookAction, executeScriptAction } from '@cms/js/manager-globals'; window.addEventListener("DOMContentLoaded", async () => { /* await i18n.init() diff --git a/modules/ui-module/src/main/ts/dist/js/manager-globals.d.ts b/modules/ui-module/src/main/ts/dist/js/manager-globals.d.ts index dfa11d975..255f59f32 100644 --- a/modules/ui-module/src/main/ts/dist/js/manager-globals.d.ts +++ b/modules/ui-module/src/main/ts/dist/js/manager-globals.d.ts @@ -1,5 +1,5 @@ -declare function executeScriptAction(action: any): Promise; -declare function executeHookAction(action: any): Promise; +export function executeScriptAction(action: any): Promise; +export function executeHookAction(action: any): Promise; /** * Patches a relative path so that it's correctly prefixed with the given manager base path. * @@ -7,11 +7,11 @@ declare function executeHookAction(action: any): Promise; * @param {string} managerBasePath e.g. "/manager" or "/de/manager" * @returns {string} e.g. "/de/manager/module" */ -declare function patchManagerPath(relativePath: string, managerBasePath: string): string; +export function patchManagerPath(relativePath: string, managerBasePath: string): string; /** * Patches a path with the context path, if not already present. * * @param {string} path - The original path (e.g. "/assets/images/test.jpg"). * @returns {string} - The patched path with context prefix if needed. */ -declare function patchPathWithContext(path: string): string; +export function patchPathWithContext(path: string): string; diff --git a/modules/ui-module/src/main/ts/dist/js/manager-globals.js b/modules/ui-module/src/main/ts/dist/js/manager-globals.js index e3c1092ee..d71820d5f 100644 --- a/modules/ui-module/src/main/ts/dist/js/manager-globals.js +++ b/modules/ui-module/src/main/ts/dist/js/manager-globals.js @@ -1,3 +1,4 @@ +import { getCSRFToken } from "./modules/utils"; /*- * #%L * ui-module @@ -19,7 +20,7 @@ * . * #L% */ -const executeScriptAction = async (action) => { +export async function executeScriptAction(action) { if (action.module && action.function === "runAction") { var modulePath = patchManagerPath(action.module, window.manager.baseUrl); import(modulePath) @@ -41,8 +42,8 @@ const executeScriptAction = async (action) => { } }); } -}; -const executeHookAction = async (action) => { +} +export async function executeHookAction(action) { var data = { hook: action.hook }; @@ -52,12 +53,12 @@ const executeHookAction = async (action) => { const response = await fetch(window.manager.baseUrl + "/hooks", { headers: { 'Content-Type': 'application/json', - 'X-CSRF-Token': window.manager.csrfToken + 'X-CSRF-Token': getCSRFToken() }, method: "POST", body: JSON.stringify(data) }); -}; +} /** * Patches a relative path so that it's correctly prefixed with the given manager base path. * @@ -65,7 +66,7 @@ const executeHookAction = async (action) => { * @param {string} managerBasePath e.g. "/manager" or "/de/manager" * @returns {string} e.g. "/de/manager/module" */ -const patchManagerPath = (relativePath, managerBasePath) => { +export function patchManagerPath(relativePath, managerBasePath) { if (!relativePath || !managerBasePath) { throw new Error("Both paths must be provided."); } @@ -78,14 +79,14 @@ const patchManagerPath = (relativePath, managerBasePath) => { return rel; } return base + rel; -}; +} /** * Patches a path with the context path, if not already present. * * @param {string} path - The original path (e.g. "/assets/images/test.jpg"). * @returns {string} - The patched path with context prefix if needed. */ -const patchPathWithContext = (path) => { +export function patchPathWithContext(path) { const contextPath = window.manager.contextPath || "/"; // Normalize context path (remove trailing slash if not just "/") const normalizedContext = contextPath !== "/" ? contextPath.replace(/\/+$/, "") : ""; @@ -95,4 +96,4 @@ const patchPathWithContext = (path) => { } // Patch path (avoid double slashes) return normalizedContext + (path.startsWith("/") ? path : "/" + path); -}; +} diff --git a/modules/ui-module/src/main/ts/dist/js/modules/filebrowser.template.js b/modules/ui-module/src/main/ts/dist/js/modules/filebrowser.template.js index 5370f0482..c478b46bf 100644 --- a/modules/ui-module/src/main/ts/dist/js/modules/filebrowser.template.js +++ b/modules/ui-module/src/main/ts/dist/js/modules/filebrowser.template.js @@ -20,6 +20,7 @@ * #L% */ import Handlebars from 'https://cdn.jsdelivr.net/npm/handlebars@4.7.8/+esm'; +import { patchPathWithContext } from "@cms/js/manager-globals"; Handlebars.registerHelper("patchPathWithContext", patchPathWithContext); Handlebars.registerHelper('concat', function (...args) { args.pop(); diff --git a/modules/ui-module/src/main/ts/dist/js/modules/form/field.markdown.js b/modules/ui-module/src/main/ts/dist/js/modules/form/field.markdown.js index c4a5d58e1..2a66d9a54 100644 --- a/modules/ui-module/src/main/ts/dist/js/modules/form/field.markdown.js +++ b/modules/ui-module/src/main/ts/dist/js/modules/form/field.markdown.js @@ -24,6 +24,7 @@ import { i18n } from "@cms/modules/localization.js"; import { getMediaFormats, getTagNames } from "@cms/modules/rpc/rpc-manager.js"; import { openFileBrowser } from "@cms/modules/filebrowser.js"; import { alertSelect } from "@cms/modules/alerts.js"; +import { patchPathWithContext } from "@cms/js/manager-globals"; let cherryEditors = []; const createMarkdownField = (options, value = '') => { const id = createID(); diff --git a/modules/ui-module/src/main/ts/dist/js/modules/form/field.media.js b/modules/ui-module/src/main/ts/dist/js/modules/form/field.media.js index dba4cd1d9..e13f27bdf 100644 --- a/modules/ui-module/src/main/ts/dist/js/modules/form/field.media.js +++ b/modules/ui-module/src/main/ts/dist/js/modules/form/field.media.js @@ -23,6 +23,7 @@ import { createID } from "@cms/modules/form/utils.js"; import { i18n } from "@cms/modules/localization.js"; import { uploadFileWithProgress } from "@cms/modules/upload.js"; import { openFileBrowser } from "@cms/modules/filebrowser.js"; +import { patchPathWithContext } from "@cms/js/manager-globals"; const createMediaField = (options, value = '') => { const id = createID(); const key = "field." + options.name; diff --git a/modules/ui-module/src/main/ts/dist/js/modules/manager/manager.message.handlers.js b/modules/ui-module/src/main/ts/dist/js/modules/manager/manager.message.handlers.js index ddeeb1e69..56c78f683 100644 --- a/modules/ui-module/src/main/ts/dist/js/modules/manager/manager.message.handlers.js +++ b/modules/ui-module/src/main/ts/dist/js/modules/manager/manager.message.handlers.js @@ -1,3 +1,4 @@ +import { executeScriptAction } from '@cms/js/manager-globals.js'; import frameMessenger from '@cms/modules/frameMessenger.js'; import { getPreviewFrame, getPreviewUrl } from '@cms/modules/preview.utils.js'; import { getContentNode } from '@cms/modules/rpc/rpc-content.js'; diff --git a/modules/ui-module/src/main/ts/dist/js/modules/rpc/rpc.js b/modules/ui-module/src/main/ts/dist/js/modules/rpc/rpc.js index 6400dca1f..6d5aae5db 100644 --- a/modules/ui-module/src/main/ts/dist/js/modules/rpc/rpc.js +++ b/modules/ui-module/src/main/ts/dist/js/modules/rpc/rpc.js @@ -20,6 +20,7 @@ * #L% */ import { i18n } from "@cms/modules/localization.js"; +import { getCSRFToken } from "../utils"; const executeRemoteCall = async (options) => { return executeRemoteMethodCall(options.method, options.parameters); }; @@ -32,7 +33,7 @@ const executeRemoteMethodCall = async (method, parameters) => { method: "POST", headers: { 'Content-Type': 'application/json', - 'X-CSRF-Token': window.manager.csrfToken + 'X-CSRF-Token': getCSRFToken() }, body: JSON.stringify(data) }); diff --git a/modules/ui-module/src/main/ts/dist/js/modules/upload.js b/modules/ui-module/src/main/ts/dist/js/modules/upload.js index 16964b1a0..70795ad7e 100644 --- a/modules/ui-module/src/main/ts/dist/js/modules/upload.js +++ b/modules/ui-module/src/main/ts/dist/js/modules/upload.js @@ -19,6 +19,7 @@ * . * #L% */ +import { getCSRFToken } from "./utils"; // uploadFileWithProgress.js export function uploadFileWithProgress({ uploadEndpoint, file, uri, onProgress, onSuccess, onError }) { if (!file) { @@ -35,7 +36,7 @@ export function uploadFileWithProgress({ uploadEndpoint, file, uri, onProgress, formData.append("uri", uri); const xhr = new XMLHttpRequest(); xhr.open("POST", uploadEndpoint ?? "/manager/upload", true); - xhr.setRequestHeader("X-CSRF-Token", window.manager.csrfToken); + xhr.setRequestHeader("X-CSRF-Token", getCSRFToken()); xhr.upload.onprogress = (event) => { if (event.lengthComputable && typeof onProgress === "function") { const percent = Math.round((event.loaded / event.total) * 100); diff --git a/modules/ui-module/src/main/ts/dist/js/modules/utils.d.ts b/modules/ui-module/src/main/ts/dist/js/modules/utils.d.ts new file mode 100644 index 000000000..b67be1369 --- /dev/null +++ b/modules/ui-module/src/main/ts/dist/js/modules/utils.d.ts @@ -0,0 +1 @@ +export declare function getCSRFToken(): string | null; diff --git a/modules/ui-module/src/main/ts/dist/js/modules/utils.js b/modules/ui-module/src/main/ts/dist/js/modules/utils.js new file mode 100644 index 000000000..a8e27894b --- /dev/null +++ b/modules/ui-module/src/main/ts/dist/js/modules/utils.js @@ -0,0 +1,4 @@ +export function getCSRFToken() { + const meta = document.querySelector('meta[name="csrf-token"]'); + return meta ? meta.getAttribute('content') : null; +} diff --git a/modules/ui-module/src/main/ts/dist/js/ui-actions.js b/modules/ui-module/src/main/ts/dist/js/ui-actions.js index 4e819f324..b3fbdd62b 100644 --- a/modules/ui-module/src/main/ts/dist/js/ui-actions.js +++ b/modules/ui-module/src/main/ts/dist/js/ui-actions.js @@ -21,6 +21,7 @@ */ import { EventBus } from '@cms/modules/event-bus.js'; import { i18n, localizeUi } from '@cms/modules/localization.js'; +import { executeHookAction, executeScriptAction } from '@cms/js/manager-globals'; window.addEventListener("DOMContentLoaded", async () => { /* await i18n.init() diff --git a/modules/ui-module/src/main/ts/globals.d.ts b/modules/ui-module/src/main/ts/globals.d.ts index 699f864c4..d5e272f83 100644 --- a/modules/ui-module/src/main/ts/globals.d.ts +++ b/modules/ui-module/src/main/ts/globals.d.ts @@ -8,7 +8,6 @@ declare global { }; manager : { csrfToken: string, - previewToken: string, baseUrl: string, contextPath: string, siteId: string, @@ -18,10 +17,4 @@ declare global { } } -declare var require: any; - -// manager-globals -declare function executeScriptAction(action: any): Promise; -declare function executeHookAction(action: any): Promise; -declare function patchManagerPath (relativePath: string, managerBasePath: string): string; -declare function patchPathWithContext(path: string): string; \ No newline at end of file +declare var require: any; \ No newline at end of file diff --git a/modules/ui-module/src/main/ts/src/js/manager-globals.js b/modules/ui-module/src/main/ts/src/js/manager-globals.js index 73824dc60..fe403871d 100644 --- a/modules/ui-module/src/main/ts/src/js/manager-globals.js +++ b/modules/ui-module/src/main/ts/src/js/manager-globals.js @@ -1,3 +1,5 @@ +import { getCSRFToken } from "./modules/utils"; + /*- * #%L * ui-module @@ -19,7 +21,7 @@ * . * #L% */ -const executeScriptAction = async (action) => { +export async function executeScriptAction (action) { if (action.module && action.function === "runAction") { var modulePath = patchManagerPath(action.module, window.manager.baseUrl); import(modulePath) @@ -41,7 +43,7 @@ const executeScriptAction = async (action) => { } } -const executeHookAction = async (action) => { +export async function executeHookAction (action) { var data = { hook : action.hook } @@ -51,7 +53,7 @@ const executeHookAction = async (action) => { const response = await fetch(window.manager.baseUrl + "/hooks", { headers: { 'Content-Type': 'application/json', - 'X-CSRF-Token': window.manager.csrfToken + 'X-CSRF-Token': getCSRFToken() }, method: "POST", body: JSON.stringify(data) @@ -65,7 +67,7 @@ const executeHookAction = async (action) => { * @param {string} managerBasePath e.g. "/manager" or "/de/manager" * @returns {string} e.g. "/de/manager/module" */ -const patchManagerPath = (relativePath, managerBasePath) => { +export function patchManagerPath (relativePath, managerBasePath) { if (!relativePath || !managerBasePath) { throw new Error("Both paths must be provided."); } @@ -90,7 +92,7 @@ const patchManagerPath = (relativePath, managerBasePath) => { * @param {string} path - The original path (e.g. "/assets/images/test.jpg"). * @returns {string} - The patched path with context prefix if needed. */ -const patchPathWithContext = (path) => { +export function patchPathWithContext (path) { const contextPath = window.manager.contextPath || "/"; // Normalize context path (remove trailing slash if not just "/") diff --git a/modules/ui-module/src/main/ts/src/js/modules/filebrowser.template.js b/modules/ui-module/src/main/ts/src/js/modules/filebrowser.template.js index 3404feba9..0fca8791c 100644 --- a/modules/ui-module/src/main/ts/src/js/modules/filebrowser.template.js +++ b/modules/ui-module/src/main/ts/src/js/modules/filebrowser.template.js @@ -21,6 +21,7 @@ */ import Handlebars from 'https://cdn.jsdelivr.net/npm/handlebars@4.7.8/+esm' +import { patchPathWithContext } from "@cms/js/manager-globals"; Handlebars.registerHelper("patchPathWithContext", patchPathWithContext); Handlebars.registerHelper('concat', function (...args) { diff --git a/modules/ui-module/src/main/ts/src/js/modules/form/field.markdown.ts b/modules/ui-module/src/main/ts/src/js/modules/form/field.markdown.ts index 06a23bc98..2e7a9228a 100644 --- a/modules/ui-module/src/main/ts/src/js/modules/form/field.markdown.ts +++ b/modules/ui-module/src/main/ts/src/js/modules/form/field.markdown.ts @@ -25,6 +25,7 @@ import { getMediaFormats, getTagNames } from "@cms/modules/rpc/rpc-manager.js"; import { openFileBrowser } from "@cms/modules/filebrowser.js"; import { alertSelect } from "@cms/modules/alerts.js"; import { FieldOptions, FormContext, FormField } from "@cms/modules/form/forms.js"; +import { patchPathWithContext } from "@cms/js/manager-globals"; let cherryEditors = []; diff --git a/modules/ui-module/src/main/ts/src/js/modules/form/field.media.ts b/modules/ui-module/src/main/ts/src/js/modules/form/field.media.ts index fb6fef49e..881876e9c 100644 --- a/modules/ui-module/src/main/ts/src/js/modules/form/field.media.ts +++ b/modules/ui-module/src/main/ts/src/js/modules/form/field.media.ts @@ -24,6 +24,7 @@ import { i18n } from "@cms/modules/localization.js" import { uploadFileWithProgress } from "@cms/modules/upload.js"; import { openFileBrowser } from "@cms/modules/filebrowser.js"; import { FieldOptions, FormContext, FormField } from "@cms/modules/form/forms.js"; +import { patchPathWithContext } from "@cms/js/manager-globals"; export interface MediaFieldOptions extends FieldOptions { } diff --git a/modules/ui-module/src/main/ts/src/js/modules/manager/manager.message.handlers.ts b/modules/ui-module/src/main/ts/src/js/modules/manager/manager.message.handlers.ts index efc3ff5a4..bab710244 100644 --- a/modules/ui-module/src/main/ts/src/js/modules/manager/manager.message.handlers.ts +++ b/modules/ui-module/src/main/ts/src/js/modules/manager/manager.message.handlers.ts @@ -1,3 +1,4 @@ +import { executeScriptAction } from '@cms/js/manager-globals.js'; import frameMessenger from '@cms/modules/frameMessenger.js'; import { getPreviewFrame, getPreviewUrl } from '@cms/modules/preview.utils.js'; import { getContentNode } from '@cms/modules/rpc/rpc-content.js'; diff --git a/modules/ui-module/src/main/ts/src/js/modules/rpc/rpc.ts b/modules/ui-module/src/main/ts/src/js/modules/rpc/rpc.ts index 1e153cda4..203b09d8b 100644 --- a/modules/ui-module/src/main/ts/src/js/modules/rpc/rpc.ts +++ b/modules/ui-module/src/main/ts/src/js/modules/rpc/rpc.ts @@ -21,6 +21,7 @@ */ import { i18n } from "@cms/modules/localization.js"; +import { getCSRFToken } from "../utils"; interface Options { method: string; @@ -40,7 +41,7 @@ const executeRemoteMethodCall = async (method : string, parameters : any) => { method: "POST", headers: { 'Content-Type': 'application/json', - 'X-CSRF-Token': window.manager.csrfToken + 'X-CSRF-Token': getCSRFToken() }, body: JSON.stringify(data) }) diff --git a/modules/ui-module/src/main/ts/src/js/modules/upload.js b/modules/ui-module/src/main/ts/src/js/modules/upload.js index 17c9e6b1c..384b019eb 100644 --- a/modules/ui-module/src/main/ts/src/js/modules/upload.js +++ b/modules/ui-module/src/main/ts/src/js/modules/upload.js @@ -19,6 +19,9 @@ * . * #L% */ + +import { getCSRFToken } from "./utils"; + // uploadFileWithProgress.js export function uploadFileWithProgress({ uploadEndpoint, file, uri, onProgress, onSuccess, onError }) { if (!file) { @@ -38,7 +41,7 @@ export function uploadFileWithProgress({ uploadEndpoint, file, uri, onProgress, const xhr = new XMLHttpRequest(); xhr.open("POST", uploadEndpoint ?? "/manager/upload", true); - xhr.setRequestHeader("X-CSRF-Token", window.manager.csrfToken); + xhr.setRequestHeader("X-CSRF-Token", getCSRFToken()); xhr.upload.onprogress = (event) => { if (event.lengthComputable && typeof onProgress === "function") { diff --git a/modules/ui-module/src/main/ts/src/js/modules/utils.ts b/modules/ui-module/src/main/ts/src/js/modules/utils.ts new file mode 100644 index 000000000..1e1255a8b --- /dev/null +++ b/modules/ui-module/src/main/ts/src/js/modules/utils.ts @@ -0,0 +1,4 @@ +export function getCSRFToken(): string | null { + const meta = document.querySelector('meta[name="csrf-token"]'); + return meta ? meta.getAttribute('content') : null; +} \ No newline at end of file diff --git a/modules/ui-module/src/main/ts/src/js/ui-actions.js b/modules/ui-module/src/main/ts/src/js/ui-actions.js index 6bec86fa9..01c98d96a 100644 --- a/modules/ui-module/src/main/ts/src/js/ui-actions.js +++ b/modules/ui-module/src/main/ts/src/js/ui-actions.js @@ -22,6 +22,7 @@ import { EventBus } from '@cms/modules/event-bus.js'; import { i18n, localizeUi } from '@cms/modules/localization.js'; +import { executeHookAction, executeScriptAction } from '@cms/js/manager-globals'; window.addEventListener("DOMContentLoaded", async () => { diff --git a/modules/ui-module/src/main/ts/tsconfig.json b/modules/ui-module/src/main/ts/tsconfig.json index db6dc5877..990d6ec80 100644 --- a/modules/ui-module/src/main/ts/tsconfig.json +++ b/modules/ui-module/src/main/ts/tsconfig.json @@ -14,7 +14,7 @@ "paths": { "@cms/modules/*": ["js/modules/*"], "@cms/libs/*": ["js/libs/*"], - "@cms/*": ["js/*"], + "@cms/js/*": ["js/*"], } }, "include": [ From 8fb7800c9cf18c3f07a24fa71762fcfb0ef219db Mon Sep 17 00:00:00 2001 From: Thorsten Marx Date: Fri, 12 Dec 2025 11:54:42 +0100 Subject: [PATCH 10/11] renew csrf token --- .../remotemethods/RemoteManagerEnpoints.java | 14 ++++++++++++++ .../src/main/resources/manager/js/manager.js | 9 +++++++++ .../manager/js/modules/rpc/rpc-manager.d.ts | 3 ++- .../manager/js/modules/rpc/rpc-manager.js | 9 ++++++++- .../main/resources/manager/js/modules/utils.d.ts | 1 + .../src/main/resources/manager/js/modules/utils.js | 9 +++++++++ modules/ui-module/src/main/ts/dist/js/manager.js | 9 +++++++++ .../main/ts/dist/js/modules/rpc/rpc-manager.d.ts | 3 ++- .../src/main/ts/dist/js/modules/rpc/rpc-manager.js | 9 ++++++++- .../src/main/ts/dist/js/modules/utils.d.ts | 1 + .../ui-module/src/main/ts/dist/js/modules/utils.js | 9 +++++++++ modules/ui-module/src/main/ts/src/js/manager.js | 9 +++++++++ .../src/main/ts/src/js/modules/rpc/rpc-manager.ts | 11 ++++++++++- .../ui-module/src/main/ts/src/js/modules/utils.ts | 10 ++++++++++ 14 files changed, 101 insertions(+), 5 deletions(-) diff --git a/modules/ui-module/src/main/java/com/condation/cms/modules/ui/extensionpoints/remotemethods/RemoteManagerEnpoints.java b/modules/ui-module/src/main/java/com/condation/cms/modules/ui/extensionpoints/remotemethods/RemoteManagerEnpoints.java index 0df95eb74..423ce6d94 100644 --- a/modules/ui-module/src/main/java/com/condation/cms/modules/ui/extensionpoints/remotemethods/RemoteManagerEnpoints.java +++ b/modules/ui-module/src/main/java/com/condation/cms/modules/ui/extensionpoints/remotemethods/RemoteManagerEnpoints.java @@ -23,6 +23,7 @@ */ import com.condation.cms.api.auth.Permissions; import com.condation.cms.api.configuration.configs.MediaConfiguration; +import com.condation.cms.api.configuration.configs.ServerConfiguration; import com.condation.cms.api.feature.features.ConfigurationFeature; import com.condation.cms.api.ui.extensions.UIRemoteMethodExtensionPoint; import com.condation.modules.api.annotation.Extension; @@ -31,6 +32,8 @@ import com.condation.cms.api.ui.annotations.RemoteMethod; import com.condation.cms.api.ui.rpc.RPCException; import com.condation.cms.content.RenderContext; +import com.condation.cms.modules.ui.utils.TokenUtils; +import java.time.Duration; /** * @@ -92,4 +95,15 @@ public Object getListItemTypes(Map parameters) throws RPCExcepti throw new RPCException(0, e.getMessage()); } } + + @RemoteMethod(name = "manager.token.createCSRF", permissions = {Permissions.CONTENT_EDIT}) + public Object createCSRFToken(Map parameters) throws RPCException { + try { + var secret = getContext().get(ConfigurationFeature.class).configuration().get(ServerConfiguration.class).serverProperties().secret(); + return TokenUtils.createToken("csrf", secret, Duration.ofHours(1), Duration.ofHours(1)); + } catch (Exception e) { + log.error("", e); + throw new RPCException(0, e.getMessage()); + } + } } diff --git a/modules/ui-module/src/main/resources/manager/js/manager.js b/modules/ui-module/src/main/resources/manager/js/manager.js index 54ca56146..3c2b9e84a 100644 --- a/modules/ui-module/src/main/resources/manager/js/manager.js +++ b/modules/ui-module/src/main/resources/manager/js/manager.js @@ -25,12 +25,21 @@ import { UIStateManager } from '@cms/modules/ui-state.js'; import { updateStateButton } from '@cms/modules/manager-ui.js'; import { EventBus } from '@cms/modules/event-bus.js'; import { initMessageHandlers } from '@cms/modules/manager/manager.message.handlers.js'; +import { createCSRFToken } from '@cms/modules/rpc/rpc-manager.js'; +import { setCSRFToken } from '@cms/modules/utils.js'; frameMessenger.on('load', (payload) => { EventBus.emit("preview:loaded", {}); }); document.addEventListener("DOMContentLoaded", function () { //PreviewHistory.init("/"); //updateStateButton(); + const intervalId = window.setInterval(() => { + var token = createCSRFToken({}); + token.then((token) => { + console.log("new csrf token: ", token); + setCSRFToken(token.result); + }); + }, 5 * 60 * 1000); const iframe = document.getElementById('contentPreview'); const urlParams = new URLSearchParams(window.location.search); const pageUrl = urlParams.get('page'); diff --git a/modules/ui-module/src/main/resources/manager/js/modules/rpc/rpc-manager.d.ts b/modules/ui-module/src/main/resources/manager/js/modules/rpc/rpc-manager.d.ts index 136bc5d30..3ea5563da 100644 --- a/modules/ui-module/src/main/resources/manager/js/modules/rpc/rpc-manager.d.ts +++ b/modules/ui-module/src/main/resources/manager/js/modules/rpc/rpc-manager.d.ts @@ -23,6 +23,7 @@ declare const getSectionTemplates: (options: any) => Promise; declare const getPageTemplates: (options: any) => Promise; declare const getListItemTypes: (options: any) => Promise; declare const getMediaForm: (options: any) => Promise; +declare const createCSRFToken: (options: any) => Promise; export declare enum Format { WEBP = 0, JPEG = 1, @@ -41,4 +42,4 @@ export interface MediaFormatsResponse { } declare const getMediaFormats: (options: any) => Promise; declare const getTagNames: (options: any) => Promise; -export { getSectionTemplates, getPageTemplates, getMediaForm, getTagNames, getMediaFormats, getListItemTypes }; +export { getSectionTemplates, getPageTemplates, getMediaForm, getTagNames, getMediaFormats, getListItemTypes, createCSRFToken }; diff --git a/modules/ui-module/src/main/resources/manager/js/modules/rpc/rpc-manager.js b/modules/ui-module/src/main/resources/manager/js/modules/rpc/rpc-manager.js index ed5ef8cf1..57b80c7c2 100644 --- a/modules/ui-module/src/main/resources/manager/js/modules/rpc/rpc-manager.js +++ b/modules/ui-module/src/main/resources/manager/js/modules/rpc/rpc-manager.js @@ -48,6 +48,13 @@ const getMediaForm = async (options) => { }; return await executeRemoteCall(data); }; +const createCSRFToken = async (options) => { + var data = { + method: "manager.token.createCSRF", + parameters: options + }; + return await executeRemoteCall(data); +}; export var Format; (function (Format) { Format[Format["WEBP"] = 0] = "WEBP"; @@ -68,4 +75,4 @@ const getTagNames = async (options) => { }; return await executeRemoteCall(data); }; -export { getSectionTemplates, getPageTemplates, getMediaForm, getTagNames, getMediaFormats, getListItemTypes }; +export { getSectionTemplates, getPageTemplates, getMediaForm, getTagNames, getMediaFormats, getListItemTypes, createCSRFToken }; diff --git a/modules/ui-module/src/main/resources/manager/js/modules/utils.d.ts b/modules/ui-module/src/main/resources/manager/js/modules/utils.d.ts index beb55a220..d0ef92724 100644 --- a/modules/ui-module/src/main/resources/manager/js/modules/utils.d.ts +++ b/modules/ui-module/src/main/resources/manager/js/modules/utils.d.ts @@ -20,3 +20,4 @@ * #L% */ export declare function getCSRFToken(): string | null; +export declare function setCSRFToken(token: string): void; diff --git a/modules/ui-module/src/main/resources/manager/js/modules/utils.js b/modules/ui-module/src/main/resources/manager/js/modules/utils.js index 48b7c7a5e..9a028f898 100644 --- a/modules/ui-module/src/main/resources/manager/js/modules/utils.js +++ b/modules/ui-module/src/main/resources/manager/js/modules/utils.js @@ -23,3 +23,12 @@ export function getCSRFToken() { const meta = document.querySelector('meta[name="csrf-token"]'); return meta ? meta.getAttribute('content') : null; } +export function setCSRFToken(token) { + let meta = document.querySelector('meta[name="csrf-token"]'); + if (!meta) { + meta = document.createElement('meta'); + meta.setAttribute('name', 'csrf-token'); + document.head.appendChild(meta); + } + meta.setAttribute('content', token); +} diff --git a/modules/ui-module/src/main/ts/dist/js/manager.js b/modules/ui-module/src/main/ts/dist/js/manager.js index 54ca56146..3c2b9e84a 100644 --- a/modules/ui-module/src/main/ts/dist/js/manager.js +++ b/modules/ui-module/src/main/ts/dist/js/manager.js @@ -25,12 +25,21 @@ import { UIStateManager } from '@cms/modules/ui-state.js'; import { updateStateButton } from '@cms/modules/manager-ui.js'; import { EventBus } from '@cms/modules/event-bus.js'; import { initMessageHandlers } from '@cms/modules/manager/manager.message.handlers.js'; +import { createCSRFToken } from '@cms/modules/rpc/rpc-manager.js'; +import { setCSRFToken } from '@cms/modules/utils.js'; frameMessenger.on('load', (payload) => { EventBus.emit("preview:loaded", {}); }); document.addEventListener("DOMContentLoaded", function () { //PreviewHistory.init("/"); //updateStateButton(); + const intervalId = window.setInterval(() => { + var token = createCSRFToken({}); + token.then((token) => { + console.log("new csrf token: ", token); + setCSRFToken(token.result); + }); + }, 5 * 60 * 1000); const iframe = document.getElementById('contentPreview'); const urlParams = new URLSearchParams(window.location.search); const pageUrl = urlParams.get('page'); diff --git a/modules/ui-module/src/main/ts/dist/js/modules/rpc/rpc-manager.d.ts b/modules/ui-module/src/main/ts/dist/js/modules/rpc/rpc-manager.d.ts index 0fb0b33dd..04d7829b3 100644 --- a/modules/ui-module/src/main/ts/dist/js/modules/rpc/rpc-manager.d.ts +++ b/modules/ui-module/src/main/ts/dist/js/modules/rpc/rpc-manager.d.ts @@ -2,6 +2,7 @@ declare const getSectionTemplates: (options: any) => Promise; declare const getPageTemplates: (options: any) => Promise; declare const getListItemTypes: (options: any) => Promise; declare const getMediaForm: (options: any) => Promise; +declare const createCSRFToken: (options: any) => Promise; export declare enum Format { WEBP = 0, JPEG = 1, @@ -20,4 +21,4 @@ export interface MediaFormatsResponse { } declare const getMediaFormats: (options: any) => Promise; declare const getTagNames: (options: any) => Promise; -export { getSectionTemplates, getPageTemplates, getMediaForm, getTagNames, getMediaFormats, getListItemTypes }; +export { getSectionTemplates, getPageTemplates, getMediaForm, getTagNames, getMediaFormats, getListItemTypes, createCSRFToken }; diff --git a/modules/ui-module/src/main/ts/dist/js/modules/rpc/rpc-manager.js b/modules/ui-module/src/main/ts/dist/js/modules/rpc/rpc-manager.js index ed5ef8cf1..57b80c7c2 100644 --- a/modules/ui-module/src/main/ts/dist/js/modules/rpc/rpc-manager.js +++ b/modules/ui-module/src/main/ts/dist/js/modules/rpc/rpc-manager.js @@ -48,6 +48,13 @@ const getMediaForm = async (options) => { }; return await executeRemoteCall(data); }; +const createCSRFToken = async (options) => { + var data = { + method: "manager.token.createCSRF", + parameters: options + }; + return await executeRemoteCall(data); +}; export var Format; (function (Format) { Format[Format["WEBP"] = 0] = "WEBP"; @@ -68,4 +75,4 @@ const getTagNames = async (options) => { }; return await executeRemoteCall(data); }; -export { getSectionTemplates, getPageTemplates, getMediaForm, getTagNames, getMediaFormats, getListItemTypes }; +export { getSectionTemplates, getPageTemplates, getMediaForm, getTagNames, getMediaFormats, getListItemTypes, createCSRFToken }; diff --git a/modules/ui-module/src/main/ts/dist/js/modules/utils.d.ts b/modules/ui-module/src/main/ts/dist/js/modules/utils.d.ts index b67be1369..73eff8a4d 100644 --- a/modules/ui-module/src/main/ts/dist/js/modules/utils.d.ts +++ b/modules/ui-module/src/main/ts/dist/js/modules/utils.d.ts @@ -1 +1,2 @@ export declare function getCSRFToken(): string | null; +export declare function setCSRFToken(token: string): void; diff --git a/modules/ui-module/src/main/ts/dist/js/modules/utils.js b/modules/ui-module/src/main/ts/dist/js/modules/utils.js index a8e27894b..9475c4d44 100644 --- a/modules/ui-module/src/main/ts/dist/js/modules/utils.js +++ b/modules/ui-module/src/main/ts/dist/js/modules/utils.js @@ -2,3 +2,12 @@ export function getCSRFToken() { const meta = document.querySelector('meta[name="csrf-token"]'); return meta ? meta.getAttribute('content') : null; } +export function setCSRFToken(token) { + let meta = document.querySelector('meta[name="csrf-token"]'); + if (!meta) { + meta = document.createElement('meta'); + meta.setAttribute('name', 'csrf-token'); + document.head.appendChild(meta); + } + meta.setAttribute('content', token); +} diff --git a/modules/ui-module/src/main/ts/src/js/manager.js b/modules/ui-module/src/main/ts/src/js/manager.js index 50339c8d4..62eca6e29 100644 --- a/modules/ui-module/src/main/ts/src/js/manager.js +++ b/modules/ui-module/src/main/ts/src/js/manager.js @@ -28,6 +28,8 @@ import { UIStateManager } from '@cms/modules/ui-state.js'; import { updateStateButton } from '@cms/modules/manager-ui.js'; import { EventBus } from '@cms/modules/event-bus.js'; import { initMessageHandlers } from '@cms/modules/manager/manager.message.handlers.js'; +import { createCSRFToken } from '@cms/modules/rpc/rpc-manager.js'; +import { setCSRFToken } from '@cms/modules/utils.js'; frameMessenger.on('load', (payload) => { EventBus.emit("preview:loaded", {}); @@ -39,6 +41,13 @@ document.addEventListener("DOMContentLoaded", function () { //PreviewHistory.init("/"); //updateStateButton(); + const intervalId = window.setInterval(() => { + var token = createCSRFToken({}); + token.then((token) => { + setCSRFToken(token.result); + }) + }, 5 * 60 * 1000); + const iframe = document.getElementById('contentPreview'); const urlParams = new URLSearchParams(window.location.search); diff --git a/modules/ui-module/src/main/ts/src/js/modules/rpc/rpc-manager.ts b/modules/ui-module/src/main/ts/src/js/modules/rpc/rpc-manager.ts index e4b9ca0fb..2aa68bc3e 100644 --- a/modules/ui-module/src/main/ts/src/js/modules/rpc/rpc-manager.ts +++ b/modules/ui-module/src/main/ts/src/js/modules/rpc/rpc-manager.ts @@ -54,6 +54,14 @@ const getMediaForm = async (options : any) => { return await executeRemoteCall(data); }; +const createCSRFToken = async (options : any) => { + var data = { + method: "manager.token.createCSRF", + parameters: options + } + return await executeRemoteCall(data); +}; + export enum Format { WEBP, JPEG, @@ -94,5 +102,6 @@ export { getMediaForm, getTagNames, getMediaFormats, - getListItemTypes + getListItemTypes, + createCSRFToken }; diff --git a/modules/ui-module/src/main/ts/src/js/modules/utils.ts b/modules/ui-module/src/main/ts/src/js/modules/utils.ts index 1e1255a8b..d2a01ba88 100644 --- a/modules/ui-module/src/main/ts/src/js/modules/utils.ts +++ b/modules/ui-module/src/main/ts/src/js/modules/utils.ts @@ -1,4 +1,14 @@ export function getCSRFToken(): string | null { const meta = document.querySelector('meta[name="csrf-token"]'); return meta ? meta.getAttribute('content') : null; +} + +export function setCSRFToken(token : string): void { + let meta = document.querySelector('meta[name="csrf-token"]'); + if (!meta) { + meta = document.createElement('meta'); + meta.setAttribute('name', 'csrf-token'); + document.head.appendChild(meta); + } + meta.setAttribute('content', token); } \ No newline at end of file From 7025f878b97cd3e7cb81a452866ae309ae909759 Mon Sep 17 00:00:00 2001 From: Thorsten Marx Date: Fri, 12 Dec 2025 15:21:34 +0100 Subject: [PATCH 11/11] remove loging and introduce token types --- .../java/com/condation/cms/modules/ui/utils/AuthUtil.java | 5 ++++- .../java/com/condation/cms/modules/ui/utils/TokenUtils.java | 4 ++++ .../src/main/resources/manager/actions/page/translations.js | 1 - modules/ui-module/src/main/resources/manager/js/manager.js | 1 - .../ui-module/src/main/ts/dist/actions/page/translations.js | 1 - modules/ui-module/src/main/ts/dist/js/manager.js | 1 - .../ui-module/src/main/ts/src/actions/page/translations.ts | 1 - 7 files changed, 8 insertions(+), 6 deletions(-) diff --git a/modules/ui-module/src/main/java/com/condation/cms/modules/ui/utils/AuthUtil.java b/modules/ui-module/src/main/java/com/condation/cms/modules/ui/utils/AuthUtil.java index 8205d1fb2..7e4e418d5 100644 --- a/modules/ui-module/src/main/java/com/condation/cms/modules/ui/utils/AuthUtil.java +++ b/modules/ui-module/src/main/java/com/condation/cms/modules/ui/utils/AuthUtil.java @@ -33,6 +33,8 @@ import com.condation.cms.auth.services.User; import com.condation.cms.auth.services.UserService; import java.time.Duration; +import java.util.HashMap; +import java.util.Map; import java.util.Optional; import lombok.extern.slf4j.Slf4j; import org.eclipse.jetty.server.Request; @@ -99,7 +101,7 @@ public static boolean checkAuthTokens(Request request, Response response, SiteMo return true; } } else { - return true; + return payload.get().isAuthToken(); } } @@ -113,6 +115,7 @@ public static void updateCookies(User user, Response response, RequestContext re var authToken = TokenUtils.createToken( user.username(), secret, + new HashMap<>(Map.of("type", "auth")), Duration.ofMinutes(15), // Idle Duration.ofHours(8) // Max absolut ); diff --git a/modules/ui-module/src/main/java/com/condation/cms/modules/ui/utils/TokenUtils.java b/modules/ui-module/src/main/java/com/condation/cms/modules/ui/utils/TokenUtils.java index cf6e0bc94..a170e0de6 100644 --- a/modules/ui-module/src/main/java/com/condation/cms/modules/ui/utils/TokenUtils.java +++ b/modules/ui-module/src/main/java/com/condation/cms/modules/ui/utils/TokenUtils.java @@ -173,5 +173,9 @@ public boolean isValid() { long now = Instant.now().getEpochSecond(); return now < expiresAt && now < maxLifetime; } + + public boolean isAuthToken () { + return data.getOrDefault("type", "none").equals("auth"); + } } } \ No newline at end of file diff --git a/modules/ui-module/src/main/resources/manager/actions/page/translations.js b/modules/ui-module/src/main/resources/manager/actions/page/translations.js index 39d24b579..b8aeff795 100644 --- a/modules/ui-module/src/main/resources/manager/actions/page/translations.js +++ b/modules/ui-module/src/main/resources/manager/actions/page/translations.js @@ -33,7 +33,6 @@ export async function runAction(params) { }); const uri = contentNode.result.uri; var translations = await getTranslations({ uri: uri }); - console.log('Translations:', translations); var modelContent = createTranslationsTable(translations.translations); openModal({ title: 'Manage Translations', diff --git a/modules/ui-module/src/main/resources/manager/js/manager.js b/modules/ui-module/src/main/resources/manager/js/manager.js index 3c2b9e84a..3fdd3e8f2 100644 --- a/modules/ui-module/src/main/resources/manager/js/manager.js +++ b/modules/ui-module/src/main/resources/manager/js/manager.js @@ -36,7 +36,6 @@ document.addEventListener("DOMContentLoaded", function () { const intervalId = window.setInterval(() => { var token = createCSRFToken({}); token.then((token) => { - console.log("new csrf token: ", token); setCSRFToken(token.result); }); }, 5 * 60 * 1000); diff --git a/modules/ui-module/src/main/ts/dist/actions/page/translations.js b/modules/ui-module/src/main/ts/dist/actions/page/translations.js index 39d24b579..b8aeff795 100644 --- a/modules/ui-module/src/main/ts/dist/actions/page/translations.js +++ b/modules/ui-module/src/main/ts/dist/actions/page/translations.js @@ -33,7 +33,6 @@ export async function runAction(params) { }); const uri = contentNode.result.uri; var translations = await getTranslations({ uri: uri }); - console.log('Translations:', translations); var modelContent = createTranslationsTable(translations.translations); openModal({ title: 'Manage Translations', diff --git a/modules/ui-module/src/main/ts/dist/js/manager.js b/modules/ui-module/src/main/ts/dist/js/manager.js index 3c2b9e84a..3fdd3e8f2 100644 --- a/modules/ui-module/src/main/ts/dist/js/manager.js +++ b/modules/ui-module/src/main/ts/dist/js/manager.js @@ -36,7 +36,6 @@ document.addEventListener("DOMContentLoaded", function () { const intervalId = window.setInterval(() => { var token = createCSRFToken({}); token.then((token) => { - console.log("new csrf token: ", token); setCSRFToken(token.result); }); }, 5 * 60 * 1000); diff --git a/modules/ui-module/src/main/ts/src/actions/page/translations.ts b/modules/ui-module/src/main/ts/src/actions/page/translations.ts index db1137cda..e57f3ea52 100644 --- a/modules/ui-module/src/main/ts/src/actions/page/translations.ts +++ b/modules/ui-module/src/main/ts/src/actions/page/translations.ts @@ -35,7 +35,6 @@ export async function runAction(params: any) { const uri = contentNode.result.uri var translations = await getTranslations({ uri: uri }) - console.log('Translations:', translations); var modelContent = createTranslationsTable(translations.translations);