diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 40014152c..48ce1063e 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -22,27 +22,26 @@ jobs: uses: rlespinasse/github-slug-action@v4.5.0 - name: Prepare - Setup QEMU - uses: docker/setup-qemu-action@v3.0.0 + uses: docker/setup-qemu-action@v3.2.0 - name: Prepare - Setup Docker Buildx - uses: docker/setup-buildx-action@v3.3.0 + uses: docker/setup-buildx-action@v3.6.1 - name: Prepare - Setup Node - uses: actions/setup-node@v4.0.2 + uses: actions/setup-node@v4.0.4 with: node-version: 18 - name: Build - BUILD - uses: docker/build-push-action@v5.4.0 + uses: docker/build-push-action@v6.7.0 with: load: true - build-args: "SQUIDEX__RUNTIME__VERSION=7.0.0-dev-${{ env.BUILD_NUMBER }}" cache-from: type=gha cache-to: type=gha,mode=max tags: squidex-local - name: Test - Start Compose - run: docker-compose up -d + run: docker compose up -d working-directory: tools/TestSuite - name: Test - RUN @@ -96,14 +95,14 @@ jobs: working-directory: './tools/e2e' - name: Test - Run Playwright Tests - run: npx playwright test + run: npx playwright test --retries=3 working-directory: './tools/e2e' env: BASE__URL: http://localhost:8080 - name: Test - Upload Playwright Artifacts if: always() - uses: actions/upload-artifact@v4.3.3 + uses: actions/upload-artifact@v4.4.0 with: name: playwright-report path: tools/e2e/playwright-report/ @@ -111,7 +110,7 @@ jobs: - name: Test - Upload Screenshots if: failure() - uses: actions/upload-artifact@v4.3.3 + uses: actions/upload-artifact@v4.4.0 with: path: | tools/TestSuite/TestSuite.ApiTests/bin/Debug/net8.0/screenshots/ @@ -125,7 +124,7 @@ jobs: - name: Test - Cleanup if: always() - run: docker-compose down + run: docker compose down working-directory: tools/TestSuite - name: Publish - Remove unnecessary files @@ -142,14 +141,14 @@ jobs: - name: Publish - Login to Docker Hub if: github.event_name != 'pull_request' - uses: docker/login-action@v3.2.0 + uses: docker/login-action@v3.3.0 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - name: Publish - Build & Push for Multi-Platforms if: github.event_name != 'pull_request' - uses: docker/build-push-action@v5.4.0 + uses: docker/build-push-action@v6.7.0 with: build-args: "SQUIDEX__RUNTIME__VERSION=7.0.0-dev-${{ env.BUILD_NUMBER }}" cache-from: type=gha diff --git a/.github/workflows/make-screenshots.yml b/.github/workflows/make-screenshots.yml index be37f19c7..32368875d 100644 --- a/.github/workflows/make-screenshots.yml +++ b/.github/workflows/make-screenshots.yml @@ -12,18 +12,18 @@ jobs: uses: actions/checkout@v4.1.7 - name: Prepare - Setup QEMU - uses: docker/setup-qemu-action@v3.0.0 + uses: docker/setup-qemu-action@v3.2.0 - name: Prepare - Setup Docker Buildx - uses: docker/setup-buildx-action@v3.3.0 + uses: docker/setup-buildx-action@v3.6.1 - name: Prepare - Setup Node - uses: actions/setup-node@v4.0.2 + uses: actions/setup-node@v4.0.4 with: node-version: 18 - name: Build - BUILD - uses: docker/build-push-action@v5.4.0 + uses: docker/build-push-action@v6.7.0 with: load: true cache-from: type=gha @@ -31,7 +31,7 @@ jobs: tags: squidex-local - name: Test - Start Compose - run: docker-compose up -d + run: docker compose up -d working-directory: tools/TestSuite - name: Test - Install Playwright Dependencies @@ -50,7 +50,7 @@ jobs: - name: Test - Upload Playwright Artifacts if: always() - uses: actions/upload-artifact@v4.3.3 + uses: actions/upload-artifact@v4.4.0 with: name: snapshots path: tools/e2e/snapshots/ diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b24594a40..b5839ee14 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,18 +17,18 @@ jobs: uses: rlespinasse/github-slug-action@v4.5.0 - name: Prepare - Setup QEMU - uses: docker/setup-qemu-action@v3.0.0 + uses: docker/setup-qemu-action@v3.2.0 - name: Prepare - Setup Docker Buildx - uses: docker/setup-buildx-action@v3.3.0 + uses: docker/setup-buildx-action@v3.6.1 - name: Prepare - Setup Node - uses: actions/setup-node@v4.0.2 + uses: actions/setup-node@v4.0.4 with: node-version: 18 - name: Build - BUILD - uses: docker/build-push-action@v5.4.0 + uses: docker/build-push-action@v6.7.0 with: load: true build-args: "SQUIDEX__BUILD__VERSION=${{ env.GITHUB_REF_SLUG }},SQUIDEX__RUNTIME__VERSION=${{ env.GITHUB_REF_SLUG }}" @@ -37,7 +37,7 @@ jobs: tags: squidex-local - name: Test - Start Compose - run: docker-compose up -d + run: docker compose up -d working-directory: tools/TestSuite - name: Test - RUN @@ -91,14 +91,14 @@ jobs: working-directory: './tools/e2e' - name: Test - Run Playwright Tests - run: npx playwright test + run: npx playwright test --retries=3 working-directory: './tools/e2e' env: BASE__URL: http://localhost:8080 - name: Test - Upload Playwright Artifacts if: always() - uses: actions/upload-artifact@v4.3.3 + uses: actions/upload-artifact@v4.4.0 with: name: playwright-report path: tools/e2e/playwright-report/ @@ -113,7 +113,7 @@ jobs: - name: Test - Cleanup if: always() - run: docker-compose down + run: docker compose down working-directory: tools/TestSuite - name: Publish - Remove unnecessary files @@ -136,19 +136,20 @@ jobs: fi - name: Publish - Login to Docker Hub - uses: docker/login-action@v3.2.0 + uses: docker/login-action@v3.3.0 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - name: Publish - Build & Push for Multi-Platforms - uses: docker/build-push-action@v5.3.0 + uses: docker/build-push-action@v6.7.0 with: build-args: "SQUIDEX__BUILD__VERSION=${{ env.GITHUB_REF_SLUG }},SQUIDEX__RUNTIME__VERSION=${{ env.GITHUB_REF_SLUG }}" cache-from: type=gha cache-to: type=gha,mode=max platforms: linux/amd64,linux/arm64 tags: squidex/squidex:${{ env.GITHUB_REF_SLUG }},squidex/squidex:${{ steps.version.outputs._0 }}${{env.STABLE_VERSION == 'true' && ',squidex/squidex:latest'}} + push: true - name: Release - Make directories run: sudo mkdir /build /release diff --git a/CHANGELOG.md b/CHANGELOG.md index b5396236e..3d6d8de82 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,29 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [7.15.0] - 2024-08-23 + +### Fixed + +* **Contents**: Fix to also deliver fields that have the same name as meta fields. +* **Contents**: Never return null statuses for content queries. +* **Migration**: Fix log message in migration. +* **UI**: Correctly remove the filter row, when the delete button is returned. +* **UI**: Fix autocompletion for code editors. +* **UI**: Fix clipboard behavior for rich text editor. +* **UI**: Fix seperator in login screen. +* **UI**: Navigate to the correct page when the back button on the content page is fixed. +* **UI**: Show filters in query dialog when selecting references. +* **UI**: Use correct npm packages to prevent version conflicts. + +### Added + +* **Contents**: New flag to also enrich required fields. +* **Contents**: New header flag to not enrich queried content items with default values. +* **UI**: Make the code editor editable in the markdown mode of the rich text editor. +* **UI**: New event for editor extensions when the context has been changed. +* **UI**: Support data attributes for Squidex tokens in embed SDK. + ## [7.14.0] - 2024-07-03 ### Fixed diff --git a/Dockerfile b/Dockerfile index c4cd6f8c4..b52b8d6ca 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ # Stage 1, Build Backend # -FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0 as backend +FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0 AS backend ARG SQUIDEX__BUILD__VERSION=7.0.0 @@ -43,7 +43,7 @@ RUN dotnet tool install --tool-path /tools dotnet-counters \ # # Stage 2, Build Frontend # -FROM squidex/frontend-build:20.9 as frontend +FROM squidex/frontend-build:20.9 AS frontend WORKDIR /src diff --git a/backend/extensions/Squidex.Extensions/Squidex.Extensions.csproj b/backend/extensions/Squidex.Extensions/Squidex.Extensions.csproj index 059081acf..745a60da0 100644 --- a/backend/extensions/Squidex.Extensions/Squidex.Extensions.csproj +++ b/backend/extensions/Squidex.Extensions/Squidex.Extensions.csproj @@ -12,22 +12,22 @@ - - + + - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + - + diff --git a/backend/extensions/Squidex.Extensions/Text/Azure/AzureIndexDefinition.cs b/backend/extensions/Squidex.Extensions/Text/Azure/AzureIndexDefinition.cs index 436c5f3ea..9358c3877 100644 --- a/backend/extensions/Squidex.Extensions/Text/Azure/AzureIndexDefinition.cs +++ b/backend/extensions/Squidex.Extensions/Text/Azure/AzureIndexDefinition.cs @@ -25,7 +25,7 @@ public static class AzureIndexDefinition .GetProperties(BindingFlags.Public | BindingFlags.Static) .Select(x => x.GetValue(null)!) .Select(x => x.ToString()!) - .OrderBy(x => x) + .Order() .ToList(); var addedLanguage = new HashSet(); diff --git a/backend/i18n/frontend_en.json b/backend/i18n/frontend_en.json index 5f96c7717..cd71c0881 100644 --- a/backend/i18n/frontend_en.json +++ b/backend/i18n/frontend_en.json @@ -180,6 +180,8 @@ "clients.connectWizard.step0Title": "Setup client", "clients.connectWizard.step1Title": "Choose connection method", "clients.connectWizard.step2Title": "Connect", + "clients.copyClientId": "Copy Client ID", + "clients.copyClientSecret": "Copy Client Secret", "clients.deleteConfirmText": "Do you really want to revoke the client?", "clients.deleteConfirmTitle": "Revoke client", "clients.empty": "No client created yet.", @@ -194,6 +196,7 @@ "comments.follow": "Follow", "comments.title": "Comments", "common.actions": "Actions", + "common.add": "Add", "common.administration": "Administration", "common.administrationPageTitle": "Administration", "common.api": "API", @@ -251,6 +254,7 @@ "common.disabled": "Disabled", "common.displayName": "Display Name", "common.documentation": "Documentation", + "common.download": "Download", "common.edit": "Edit", "common.editing": "Editing", "common.editInNewTab": "Open in new tab", @@ -310,6 +314,7 @@ "common.more": "More", "common.name": "Name", "common.next": "Continue", + "common.nextPage": "Next Page", "common.no": "No", "common.nothingChanged": "Nothing has been changed.", "common.notSupported": "Not Supported", @@ -320,6 +325,7 @@ "common.pagerInfo": "{itemFirst}-{itemLast} of {numberOfItems}", "common.pagerInfoNoTotal": "{itemFirst}-{itemLast} of total?", "common.pagerReload": "Click to reload view and get total number of items", + "common.pageSize": "Page Size", "common.password": "Password", "common.passwordConfirm": "Confirm Password", "common.pattern": "Pattern", @@ -328,6 +334,7 @@ "common.permissions": "Permissions", "common.prev": "Back", "common.preview": "Preview", + "common.prevPage": "Previous Page", "common.product": "Squidex Headless CMS", "common.project": "Project", "common.queryOperators.contains": "contains", @@ -359,6 +366,9 @@ "common.rules": "Rules", "common.sampleCodeLabel": "Sample Code at", "common.save": "Save", + "common.saveAdd": "Save & add another", + "common.saveClose": "Save & close", + "common.saveEdit": "Save & editor", "common.schema": "Schema", "common.schemas": "Schemas", "common.search": "Search", @@ -480,6 +490,8 @@ "contents.removeConfirmText": "Do you really want to remove the content?", "contents.removeConfirmTitle": "Remove content", "contents.saveAndPublish": "Save and Publish", + "contents.saveAndPublishAdd": "Save and Publish & add another", + "contents.saveAndPublishClose": "Save and Publish & close", "contents.scheduledAt": "at", "contents.scheduledBy": "by", "contents.scheduledTo": "to", @@ -785,9 +797,9 @@ "rules.updateFailed": "Failed to update rule. Please reload.", "rules.when": "When", "schemas.addField": "Add Field", - "schemas.addFieldAndClose": "Create and close", - "schemas.addFieldAndCreate": "Create and add field", - "schemas.addFieldAndEdit": "Create and edit field", + "schemas.addFieldAndClose": "Create", + "schemas.addFieldAndCreate": "Create & add another", + "schemas.addFieldAndEdit": "Create & edit properties", "schemas.addFieldButton": "Add Field", "schemas.addFieldFailed": "Failed to add field. Please reload.", "schemas.addNestedField": "Add Nested Field", diff --git a/backend/i18n/frontend_fr.json b/backend/i18n/frontend_fr.json index 8600471e4..ffb708500 100644 --- a/backend/i18n/frontend_fr.json +++ b/backend/i18n/frontend_fr.json @@ -180,6 +180,8 @@ "clients.connectWizard.step0Title": "Configurer le client", "clients.connectWizard.step1Title": "Choisissez la méthode de connexion", "clients.connectWizard.step2Title": "Connecter", + "clients.copyClientId": "Copy Client ID", + "clients.copyClientSecret": "Copy Client Secret", "clients.deleteConfirmText": "Voulez-vous vraiment révoquer le client\u00A0?", "clients.deleteConfirmTitle": "Révoquer le client", "clients.empty": "Aucun client créé pour le moment.", @@ -194,6 +196,7 @@ "comments.follow": "Suivre", "comments.title": "commentaires", "common.actions": "Actions", + "common.add": "Add", "common.administration": "Administration", "common.administrationPageTitle": "Administration", "common.api": "API", @@ -251,6 +254,7 @@ "common.disabled": "Désactivé", "common.displayName": "Afficher un nom", "common.documentation": "Documentation", + "common.download": "Download", "common.edit": "Modifier", "common.editing": "Édition", "common.editInNewTab": "Open in new tab", @@ -310,6 +314,7 @@ "common.more": "Plus", "common.name": "Nom", "common.next": "Continue", + "common.nextPage": "Next Page", "common.no": "Non", "common.nothingChanged": "Rien n'a été changé.", "common.notSupported": "Non supporté", @@ -320,6 +325,7 @@ "common.pagerInfo": "{itemFirst}-{itemLast} de {numberOfItems}", "common.pagerInfoNoTotal": "{itemFirst}-{itemLast} Du total?", "common.pagerReload": "Cliquez pour recharger la vue et obtenir le nombre total d'articles", + "common.pageSize": "Page Size", "common.password": "Mot de passe", "common.passwordConfirm": "Confirmez le mot de passe", "common.pattern": "Modèle", @@ -328,6 +334,7 @@ "common.permissions": "Autorisations", "common.prev": "Back", "common.preview": "Aperçu", + "common.prevPage": "Previous Page", "common.product": "CMS sans tête Squidex", "common.project": "Projet", "common.queryOperators.contains": "contient", @@ -359,6 +366,9 @@ "common.rules": "Règles", "common.sampleCodeLabel": "Exemple de code à", "common.save": "Sauvegarder", + "common.saveAdd": "Save & add another", + "common.saveClose": "Save & close", + "common.saveEdit": "Save & editor", "common.schema": "Schéma", "common.schemas": "Schémas", "common.search": "Recherche", @@ -480,6 +490,8 @@ "contents.removeConfirmText": "Voulez-vous vraiment supprimer le contenu\u00A0?", "contents.removeConfirmTitle": "Supprimer le contenu", "contents.saveAndPublish": "Enregistrer et publier", + "contents.saveAndPublishAdd": "Save and Publish & add another", + "contents.saveAndPublishClose": "Save and Publish & close", "contents.scheduledAt": "à", "contents.scheduledBy": "par", "contents.scheduledTo": "pour", diff --git a/backend/i18n/frontend_it.json b/backend/i18n/frontend_it.json index f565c24e0..6d6e7dbe4 100644 --- a/backend/i18n/frontend_it.json +++ b/backend/i18n/frontend_it.json @@ -180,6 +180,8 @@ "clients.connectWizard.step0Title": "Setup client", "clients.connectWizard.step1Title": "Scegli la tipologia di connessione", "clients.connectWizard.step2Title": "Collega", + "clients.copyClientId": "Copy Client ID", + "clients.copyClientSecret": "Copy Client Secret", "clients.deleteConfirmText": "Sei sicuro di voler rimuovere il client?", "clients.deleteConfirmTitle": "Rimuovere il client", "clients.empty": "Nessun client ancora creato.", @@ -194,6 +196,7 @@ "comments.follow": "Segui", "comments.title": "Commenti", "common.actions": "Azioni", + "common.add": "Add", "common.administration": "Amministrazione", "common.administrationPageTitle": "Amministrazione", "common.api": "API", @@ -251,6 +254,7 @@ "common.disabled": "Disabled", "common.displayName": "Nome visualizzato", "common.documentation": "Documentation", + "common.download": "Download", "common.edit": "Modifica", "common.editing": "Editing", "common.editInNewTab": "Open in new tab", @@ -310,6 +314,7 @@ "common.more": "More", "common.name": "Nome", "common.next": "Continue", + "common.nextPage": "Next Page", "common.no": "No", "common.nothingChanged": "Non è stato cambiato niente.", "common.notSupported": "Not Supported", @@ -320,6 +325,7 @@ "common.pagerInfo": "{itemFirst}-{itemLast} of {numberOfItems}", "common.pagerInfoNoTotal": "{itemFirst}-{itemLast} of total?", "common.pagerReload": "Click to reload view and get total number of items", + "common.pageSize": "Page Size", "common.password": "Password", "common.passwordConfirm": "Conferma Password", "common.pattern": "Pattern", @@ -328,6 +334,7 @@ "common.permissions": "Permessi", "common.prev": "Back", "common.preview": "Anteprima", + "common.prevPage": "Previous Page", "common.product": "Squidex Headless CMS", "common.project": "Progetto", "common.queryOperators.contains": "contiene", @@ -359,6 +366,9 @@ "common.rules": "Regole", "common.sampleCodeLabel": "Esempio di codice per", "common.save": "Salva", + "common.saveAdd": "Save & add another", + "common.saveClose": "Save & close", + "common.saveEdit": "Save & editor", "common.schema": "Schema", "common.schemas": "Schemi", "common.search": "Search", @@ -480,6 +490,8 @@ "contents.removeConfirmText": "Sei sicuro di voler rimuovere il contenuto?", "contents.removeConfirmTitle": "Cancella il contenuto", "contents.saveAndPublish": "Salva e pubblica", + "contents.saveAndPublishAdd": "Save and Publish & add another", + "contents.saveAndPublishClose": "Save and Publish & close", "contents.scheduledAt": "alle", "contents.scheduledBy": "by", "contents.scheduledTo": "a", diff --git a/backend/i18n/frontend_nl.json b/backend/i18n/frontend_nl.json index 097bd29d8..55ad54fea 100644 --- a/backend/i18n/frontend_nl.json +++ b/backend/i18n/frontend_nl.json @@ -180,6 +180,8 @@ "clients.connectWizard.step0Title": "Client instellen", "clients.connectWizard.step1Title": "Kies verbindingsmethode", "clients.connectWizard.step2Title": "Verbinden", + "clients.copyClientId": "Copy Client ID", + "clients.copyClientSecret": "Copy Client Secret", "clients.deleteConfirmText": "Wil je de client echt intrekken?", "clients.deleteConfirmTitle": "Client intrekken", "clients.empty": "Nog geen client aangemaakt.", @@ -194,6 +196,7 @@ "comments.follow": "Volgen", "comments.title": "Reacties", "common.actions": "Acties", + "common.add": "Add", "common.administration": "Administratie", "common.administrationPageTitle": "Administratie", "common.api": "API", @@ -251,6 +254,7 @@ "common.disabled": "Uitgezet", "common.displayName": "Weergavenaam", "common.documentation": "Documentation", + "common.download": "Download", "common.edit": "Bewerken", "common.editing": "Bewerken", "common.editInNewTab": "Open in new tab", @@ -310,6 +314,7 @@ "common.more": "Meer", "common.name": "Naam", "common.next": "Continue", + "common.nextPage": "Next Page", "common.no": "Nee", "common.nothingChanged": "Er is niets veranderd.", "common.notSupported": "Not Supported", @@ -320,6 +325,7 @@ "common.pagerInfo": "{itemFirst} - {itemLast} van {numberOfItems}", "common.pagerInfoNoTotal": "{itemFirst}-{itemLast} of total?", "common.pagerReload": "Click to reload view and get total number of items", + "common.pageSize": "Page Size", "common.password": "Wachtwoord", "common.passwordConfirm": "Bevestig wachtwoord", "common.pattern": "Patroon", @@ -328,6 +334,7 @@ "common.permissions": "Rechten", "common.prev": "Back", "common.preview": "Preview", + "common.prevPage": "Previous Page", "common.product": "Squidex Headless CMS", "common.project": "Project", "common.queryOperators.contains": "bevat", @@ -359,6 +366,9 @@ "common.rules": "Regels", "common.sampleCodeLabel": "Voorbeeldcode bij", "common.save": "Opslaan", + "common.saveAdd": "Save & add another", + "common.saveClose": "Save & close", + "common.saveEdit": "Save & editor", "common.schema": "Schema", "common.schemas": "Schema's", "common.search": "Zoeken", @@ -480,6 +490,8 @@ "contents.removeConfirmText": "Wil je de inhoud echt verwijderen?", "contents.removeConfirmTitle": "Verwijder inhoud", "contents.saveAndPublish": "Opslaan en publiceren", + "contents.saveAndPublishAdd": "Save and Publish & add another", + "contents.saveAndPublishClose": "Save and Publish & close", "contents.scheduledAt": "bij", "contents.scheduledBy": "door", "contents.scheduledTo": "naar", diff --git a/backend/i18n/frontend_pt.json b/backend/i18n/frontend_pt.json index 7bad6bb14..85cfebc07 100644 --- a/backend/i18n/frontend_pt.json +++ b/backend/i18n/frontend_pt.json @@ -180,6 +180,8 @@ "clients.connectWizard.step0Title": "Cliente de configuração", "clients.connectWizard.step1Title": "Escolha o método de ligação", "clients.connectWizard.step2Title": "Ligar", + "clients.copyClientId": "Copy Client ID", + "clients.copyClientSecret": "Copy Client Secret", "clients.deleteConfirmText": "Quer mesmo revogar o cliente?", "clients.deleteConfirmTitle": "Revogar cliente", "clients.empty": "Nenhum cliente foi criado ainda.", @@ -194,6 +196,7 @@ "comments.follow": "Seguir", "comments.title": "Comentários", "common.actions": "Ações", + "common.add": "Add", "common.administration": "Administração", "common.administrationPageTitle": "Administração", "common.api": "API", @@ -251,6 +254,7 @@ "common.disabled": "Deficientes", "common.displayName": "Nome do visor", "common.documentation": "Documentação", + "common.download": "Download", "common.edit": "Editar", "common.editing": "Edição", "common.editInNewTab": "Open in new tab", @@ -310,6 +314,7 @@ "common.more": "Mais", "common.name": "Nome", "common.next": "Continue", + "common.nextPage": "Next Page", "common.no": "Não", "common.nothingChanged": "Nada foi mudado.", "common.notSupported": "Não suportado", @@ -320,6 +325,7 @@ "common.pagerInfo": "{itemFirst}-{itemLast} de {numberOfItems}", "common.pagerInfoNoTotal": "{itemFirst}-{itemLast} do total?", "common.pagerReload": "Clique para recarregar a vista e obter o número total de itens", + "common.pageSize": "Page Size", "common.password": "Password", "common.passwordConfirm": "Confirmar Password", "common.pattern": "Padrão", @@ -328,6 +334,7 @@ "common.permissions": "Permissões", "common.prev": "Back", "common.preview": "Previsualizar", + "common.prevPage": "Previous Page", "common.product": "CMS Headless Squidex", "common.project": "Projeto", "common.queryOperators.contains": "contém", @@ -359,6 +366,9 @@ "common.rules": "Regras", "common.sampleCodeLabel": "Código de amostra em", "common.save": "Salvar", + "common.saveAdd": "Save & add another", + "common.saveClose": "Save & close", + "common.saveEdit": "Save & editor", "common.schema": "Esquema", "common.schemas": "Esquemas", "common.search": "Pesquisar", @@ -480,6 +490,8 @@ "contents.removeConfirmText": "Quer mesmo remover o conteúdo?", "contents.removeConfirmTitle": "Remover conteúdo", "contents.saveAndPublish": "Salvar e Publicar", + "contents.saveAndPublishAdd": "Save and Publish & add another", + "contents.saveAndPublishClose": "Save and Publish & close", "contents.scheduledAt": "em", "contents.scheduledBy": "por", "contents.scheduledTo": "Para", diff --git a/backend/i18n/frontend_zh.json b/backend/i18n/frontend_zh.json index 2e1004ecb..fcdea253c 100644 --- a/backend/i18n/frontend_zh.json +++ b/backend/i18n/frontend_zh.json @@ -180,6 +180,8 @@ "clients.connectWizard.step0Title": "设置客户端", "clients.connectWizard.step1Title": "选择连接方式", "clients.connectWizard.step2Title": "连接", + "clients.copyClientId": "Copy Client ID", + "clients.copyClientSecret": "Copy Client Secret", "clients.deleteConfirmText": "你真的要撤销客户端吗?", "clients.deleteConfirmTitle": "撤销客户端", "clients.empty": "尚未创建客户端。", @@ -194,6 +196,7 @@ "comments.follow": "关注", "comments.title": "评论", "common.actions": "动作", + "common.add": "Add", "common.administration": "管理", "common.administrationPageTitle": "管理", "common.api": "API", @@ -251,6 +254,7 @@ "common.disabled": "已禁用", "common.displayName": "显示名称", "common.documentation": "Documentation", + "common.download": "Download", "common.edit": "编辑", "common.editing": "Editing", "common.editInNewTab": "Open in new tab", @@ -310,6 +314,7 @@ "common.more": "More", "common.name": "名称", "common.next": "Continue", + "common.nextPage": "Next Page", "common.no": "不", "common.nothingChanged": "什么都没有改变。", "common.notSupported": "Not Supported", @@ -320,6 +325,7 @@ "common.pagerInfo": "{itemFirst}-{itemLast} 的 {numberOfItems}", "common.pagerInfoNoTotal": "{itemFirst}-{itemLast} of total?", "common.pagerReload": "Click to reload view and get total number of items", + "common.pageSize": "Page Size", "common.password": "密码", "common.passwordConfirm": "确认密码", "common.pattern": "模式", @@ -328,6 +334,7 @@ "common.permissions": "权限", "common.prev": "Back", "common.preview": "预览", + "common.prevPage": "Previous Page", "common.product": "Squidex Headless CMS", "common.project": "项目", "common.queryOperators.contains": "包含", @@ -359,6 +366,9 @@ "common.rules": "规则", "common.sampleCodeLabel": "示例代码在", "common.save": "保存", + "common.saveAdd": "Save & add another", + "common.saveClose": "Save & close", + "common.saveEdit": "Save & editor", "common.schema": "Schema", "common.schemas": "Schemas", "common.search": "搜索", @@ -480,6 +490,8 @@ "contents.removeConfirmText": "您真的要删除内容吗?", "contents.removeConfirmTitle": "删除内容", "contents.saveAndPublish": "保存并发布", + "contents.saveAndPublishAdd": "Save and Publish & add another", + "contents.saveAndPublishClose": "Save and Publish & close", "contents.scheduledAt": "at", "contents.scheduledBy": "by", "contents.scheduledTo": "to", diff --git a/backend/i18n/source/frontend_en.json b/backend/i18n/source/frontend_en.json index 5f96c7717..cd71c0881 100644 --- a/backend/i18n/source/frontend_en.json +++ b/backend/i18n/source/frontend_en.json @@ -180,6 +180,8 @@ "clients.connectWizard.step0Title": "Setup client", "clients.connectWizard.step1Title": "Choose connection method", "clients.connectWizard.step2Title": "Connect", + "clients.copyClientId": "Copy Client ID", + "clients.copyClientSecret": "Copy Client Secret", "clients.deleteConfirmText": "Do you really want to revoke the client?", "clients.deleteConfirmTitle": "Revoke client", "clients.empty": "No client created yet.", @@ -194,6 +196,7 @@ "comments.follow": "Follow", "comments.title": "Comments", "common.actions": "Actions", + "common.add": "Add", "common.administration": "Administration", "common.administrationPageTitle": "Administration", "common.api": "API", @@ -251,6 +254,7 @@ "common.disabled": "Disabled", "common.displayName": "Display Name", "common.documentation": "Documentation", + "common.download": "Download", "common.edit": "Edit", "common.editing": "Editing", "common.editInNewTab": "Open in new tab", @@ -310,6 +314,7 @@ "common.more": "More", "common.name": "Name", "common.next": "Continue", + "common.nextPage": "Next Page", "common.no": "No", "common.nothingChanged": "Nothing has been changed.", "common.notSupported": "Not Supported", @@ -320,6 +325,7 @@ "common.pagerInfo": "{itemFirst}-{itemLast} of {numberOfItems}", "common.pagerInfoNoTotal": "{itemFirst}-{itemLast} of total?", "common.pagerReload": "Click to reload view and get total number of items", + "common.pageSize": "Page Size", "common.password": "Password", "common.passwordConfirm": "Confirm Password", "common.pattern": "Pattern", @@ -328,6 +334,7 @@ "common.permissions": "Permissions", "common.prev": "Back", "common.preview": "Preview", + "common.prevPage": "Previous Page", "common.product": "Squidex Headless CMS", "common.project": "Project", "common.queryOperators.contains": "contains", @@ -359,6 +366,9 @@ "common.rules": "Rules", "common.sampleCodeLabel": "Sample Code at", "common.save": "Save", + "common.saveAdd": "Save & add another", + "common.saveClose": "Save & close", + "common.saveEdit": "Save & editor", "common.schema": "Schema", "common.schemas": "Schemas", "common.search": "Search", @@ -480,6 +490,8 @@ "contents.removeConfirmText": "Do you really want to remove the content?", "contents.removeConfirmTitle": "Remove content", "contents.saveAndPublish": "Save and Publish", + "contents.saveAndPublishAdd": "Save and Publish & add another", + "contents.saveAndPublishClose": "Save and Publish & close", "contents.scheduledAt": "at", "contents.scheduledBy": "by", "contents.scheduledTo": "to", @@ -785,9 +797,9 @@ "rules.updateFailed": "Failed to update rule. Please reload.", "rules.when": "When", "schemas.addField": "Add Field", - "schemas.addFieldAndClose": "Create and close", - "schemas.addFieldAndCreate": "Create and add field", - "schemas.addFieldAndEdit": "Create and edit field", + "schemas.addFieldAndClose": "Create", + "schemas.addFieldAndCreate": "Create & add another", + "schemas.addFieldAndEdit": "Create & edit properties", "schemas.addFieldButton": "Add Field", "schemas.addFieldFailed": "Failed to add field. Please reload.", "schemas.addNestedField": "Add Nested Field", diff --git a/backend/src/Migrations/Migrations.csproj b/backend/src/Migrations/Migrations.csproj index 0c1e6932c..6874e26a6 100644 --- a/backend/src/Migrations/Migrations.csproj +++ b/backend/src/Migrations/Migrations.csproj @@ -6,7 +6,7 @@ enable - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/backend/src/Squidex.Domain.Apps.Core.Model/Assets/Asset.cs b/backend/src/Squidex.Domain.Apps.Core.Model/Assets/Asset.cs index 7a4f69a70..772833fb1 100644 --- a/backend/src/Squidex.Domain.Apps.Core.Model/Assets/Asset.cs +++ b/backend/src/Squidex.Domain.Apps.Core.Model/Assets/Asset.cs @@ -53,27 +53,27 @@ public record Asset : AssetItem if (fileName != null && !string.Equals(FileName, fileName, StringComparison.OrdinalIgnoreCase)) { - result = this with { FileName = fileName }; + result = result with { FileName = fileName }; } if (slug != null && !string.Equals(Slug, slug, StringComparison.OrdinalIgnoreCase)) { - result = this with { Slug = slug }; + result = result with { Slug = slug }; } if (isProtected != null && IsProtected != isProtected.Value) { - result = this with { IsProtected = isProtected.Value }; + result = result with { IsProtected = isProtected.Value }; } if (tags != null && !Tags.SetEquals(tags)) { - result = this with { Tags = tags }; + result = result with { Tags = tags }; } if (metadata != null && !Metadata.EqualsDictionary(metadata)) { - result = this with { Metadata = metadata }; + result = result with { Metadata = metadata }; } return result; diff --git a/backend/src/Squidex.Domain.Apps.Core.Model/Contents/Json/ContentFieldDataConverter.cs b/backend/src/Squidex.Domain.Apps.Core.Model/Contents/Json/ContentFieldDataConverter.cs index cd33047a1..9fbd0df5c 100644 --- a/backend/src/Squidex.Domain.Apps.Core.Model/Contents/Json/ContentFieldDataConverter.cs +++ b/backend/src/Squidex.Domain.Apps.Core.Model/Contents/Json/ContentFieldDataConverter.cs @@ -27,7 +27,8 @@ public sealed class ContentFieldDataConverter : JsonConverter if (!reader.Read()) { - throw new JsonException("Unexpected end when reading Object."); + ThrowHelper.JsonSystemException("Unexpected end when reading Object."); + return result; } var value = JsonSerializer.Deserialize(ref reader, options)!; @@ -48,7 +49,8 @@ public sealed class ContentFieldDataConverter : JsonConverter } } - throw new JsonException("Unexpected end when reading Object."); + ThrowHelper.JsonSystemException("Unexpected end when reading Object."); + return result; } public override void Write(Utf8JsonWriter writer, ContentFieldData value, JsonSerializerOptions options) diff --git a/backend/src/Squidex.Domain.Apps.Core.Model/Schemas/FieldNames.cs b/backend/src/Squidex.Domain.Apps.Core.Model/Schemas/FieldNames.cs index b811bdee0..7f92cd16a 100644 --- a/backend/src/Squidex.Domain.Apps.Core.Model/Schemas/FieldNames.cs +++ b/backend/src/Squidex.Domain.Apps.Core.Model/Schemas/FieldNames.cs @@ -32,7 +32,7 @@ public sealed class FieldNames : ReadonlyList "translationStatusAverage" ]; - public static readonly new FieldNames Empty = new FieldNames(new List()); + public static readonly new FieldNames Empty = new FieldNames([]); private FieldNames() { diff --git a/backend/src/Squidex.Domain.Apps.Core.Model/Schemas/ReferencesFieldEditor.cs b/backend/src/Squidex.Domain.Apps.Core.Model/Schemas/ReferencesFieldEditor.cs index f6715eb1f..97d80d1ed 100644 --- a/backend/src/Squidex.Domain.Apps.Core.Model/Schemas/ReferencesFieldEditor.cs +++ b/backend/src/Squidex.Domain.Apps.Core.Model/Schemas/ReferencesFieldEditor.cs @@ -13,5 +13,6 @@ public enum ReferencesFieldEditor Dropdown, Tags, Checkboxes, - Input + Input, + Radio } diff --git a/backend/src/Squidex.Domain.Apps.Core.Model/Squidex.Domain.Apps.Core.Model.csproj b/backend/src/Squidex.Domain.Apps.Core.Model/Squidex.Domain.Apps.Core.Model.csproj index 88e0cd20f..d15dcaeac 100644 --- a/backend/src/Squidex.Domain.Apps.Core.Model/Squidex.Domain.Apps.Core.Model.csproj +++ b/backend/src/Squidex.Domain.Apps.Core.Model/Squidex.Domain.Apps.Core.Model.csproj @@ -12,7 +12,7 @@ True - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/backend/src/Squidex.Domain.Apps.Core.Operations/Scripting/Internal/Parser.cs b/backend/src/Squidex.Domain.Apps.Core.Operations/Scripting/Internal/CacheParser.cs similarity index 84% rename from backend/src/Squidex.Domain.Apps.Core.Operations/Scripting/Internal/Parser.cs rename to backend/src/Squidex.Domain.Apps.Core.Operations/Scripting/Internal/CacheParser.cs index a76e0d529..fe3aa6b51 100644 --- a/backend/src/Squidex.Domain.Apps.Core.Operations/Scripting/Internal/Parser.cs +++ b/backend/src/Squidex.Domain.Apps.Core.Operations/Scripting/Internal/CacheParser.cs @@ -5,26 +5,26 @@ // All rights reserved. Licensed under the MIT license. // ========================================================================== -using Esprima.Ast; +using Acornima.Ast; using Jint; using Microsoft.Extensions.Caching.Memory; namespace Squidex.Domain.Apps.Core.Scripting.Internal; -internal sealed class Parser +internal sealed class CacheParser { private static readonly TimeSpan CacheDuration = TimeSpan.FromMinutes(10); private readonly IMemoryCache cache; - public Parser(IMemoryCache cache) + public CacheParser(IMemoryCache cache) { this.cache = cache; } public Prepared diff --git a/backend/src/Squidex/wwwroot/scripts/editor-log.html b/backend/src/Squidex/wwwroot/scripts/editor-log.html index 09ae1df7f..8754ab6d0 100644 --- a/backend/src/Squidex/wwwroot/scripts/editor-log.html +++ b/backend/src/Squidex/wwwroot/scripts/editor-log.html @@ -78,7 +78,7 @@ appendLabel('Value of Form'); appendLine(`<${JSON.stringify(field.getFormValue(), 2)}>`); - appendLabel('Disabled: '); + appendLabel('Disabled'); appendLine(field.isDisabled()); console.log(text); @@ -124,6 +124,10 @@ logState('Field language changed'); }); + field.onContextChanged(function () { + logState('Context changed'); + }); + field.onExpanded(function () { logState('Expanded changed'); }); diff --git a/backend/src/Squidex/wwwroot/scripts/editor-sdk.js b/backend/src/Squidex/wwwroot/scripts/editor-sdk.js index b59588756..b2f5d4796 100644 --- a/backend/src/Squidex/wwwroot/scripts/editor-sdk.js +++ b/backend/src/Squidex/wwwroot/scripts/editor-sdk.js @@ -259,6 +259,7 @@ function SquidexWidget(options) { */ function SquidexFormField(options) { var context; + var contextHandler; var currentConfirm; var currentPickAssets; var currentPickContents; @@ -324,6 +325,12 @@ function SquidexFormField(options) { } } + function raiseContextChanged() { + if (contextHandler && context) { + contextHandler(context); + } + } + function raisedMoved() { if (movedHandler && isNumber(index)) { movedHandler(index); @@ -386,6 +393,10 @@ function SquidexFormField(options) { context = event.data.context; raiseInit(); + } else if (type === 'contextChanged') { + context = event.data.context; + + raiseContextChanged(); } else if (type === 'confirmResult') { var correlationId = event.data.correlationId; @@ -631,7 +642,6 @@ function SquidexFormField(options) { } initHandler = callback; - raiseInit(); }, @@ -661,10 +671,23 @@ function SquidexFormField(options) { } disabledHandler = callback; - raiseDisabled(); }, + /** + * Register an function that is called whenever the context has been changed. + * + * @param {function} callback: The callback to invoke. Argument 1: New context. + */ + onContextChanged: function (callback) { + if (!isFunction(callback)) { + return; + } + + contextHandler = callback; + raiseContextChanged(); + }, + /** * Register an function that is called whenever the field language is changed. * @@ -676,7 +699,6 @@ function SquidexFormField(options) { } languageHandler = callback; - raiseLanguageChanged(); }, @@ -691,7 +713,6 @@ function SquidexFormField(options) { } valueHandler = callback; - raiseValueChanged(); }, @@ -706,7 +727,6 @@ function SquidexFormField(options) { } formValueHandler = callback; - raiseFormValueChanged(); }, @@ -721,7 +741,6 @@ function SquidexFormField(options) { } fullscreenHandler = callback; - raiseFullscreen(); }, @@ -736,7 +755,6 @@ function SquidexFormField(options) { } expandedHandler = callback; - raiseExpanded(); }, diff --git a/backend/src/Squidex/wwwroot/scripts/embed-sdk.js b/backend/src/Squidex/wwwroot/scripts/embed-sdk.js index 917469921..93256aeec 100644 --- a/backend/src/Squidex/wwwroot/scripts/embed-sdk.js +++ b/backend/src/Squidex/wwwroot/scripts/embed-sdk.js @@ -1,2 +1,2 @@ -!function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:r})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var o in e)t.d(r,o,function(t){return e[t]}.bind(null,o));return r},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/",t(t.s="mdyV")}({hosL:function(e,t,n){"use strict";function r(e,t){for(var n in t)e[n]=t[n];return e}function o(e){var t=e.parentNode;t&&t.removeChild(e)}function i(e,t,n){var r,o,i,l={};for(i in t)"key"==i?r=t[i]:"ref"==i?o=t[i]:l[i]=t[i];if(arguments.length>2&&(l.children=arguments.length>3?E.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(i in e.defaultProps)void 0===l[i]&&(l[i]=e.defaultProps[i]);return u(e,l,r,o,null)}function u(e,t,n,r,o){var i={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==o?++C:o};return null==o&&null!=P.vnode&&P.vnode(i),i}function l(e){return e.children}function _(e,t){this.props=e,this.context=t}function c(e,t){if(null==t)return e.__?c(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t0?u(m.type,m.props,m.key,null,m.__v):m)){if(m.__=n,m.__b=n.__b+1,null===(y=j[d])||y&&m.key==y.key&&m.type===y.type)j[d]=void 0;else for(h=0;h=n.__.length&&n.__.push({}),n.__[e]}function o(e){return C=1,function(e,t,n){var o=r(S++,2);return o.t=e,o.__c||(o.__=[n?n(t):d(void 0,t),function(e){var t=o.t(o.__[0],e);o.__[0]!==t&&(o.__=[t,o.__[1]],o.__c.setState({}))}],o.__c=A),o.__}(d,e)}function i(e,t){var n=r(S++,3);!P.c.__s&&s(n.__H,t)&&(n.__=e,n.__H=t,A.__H.__h.push(n))}function u(e,t){var n=r(S++,4);!P.c.__s&&s(n.__H,t)&&(n.__=e,n.__H=t,A.__h.push(n))}function l(e){return C=5,_((function(){return{current:e}}),[])}function _(e,t){var n=r(S++,7);return s(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function c(){var e;for(I.sort((function(e,t){return e.__v.__b-t.__v.__b}));e=I.pop();)if(e.__P)try{e.__H.__h.forEach(a),e.__H.__h.forEach(f),e.__H.__h=[]}catch(t){e.__H.__h=[],P.c.__e(t,e.__v)}}function a(e){var t=A,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),A=t}function f(e){var t=A;e.__c=e.__(),A=t}function s(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function d(e,t){return"function"==typeof t?t(e):t}function p(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,o,i=[],u=!0,l=!1;try{for(n=n.call(e);!(u=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);u=!0);}catch(e){l=!0,o=e}finally{try{u||null==n.return||n.return()}finally{if(l)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return v(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return v(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,u=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return u=e.done,e},e:function(e){l=!0,i=e},f:function(){try{u||null==n.return||n.return()}finally{if(l)throw i}}}}(t);try{for(i.s();!(o=i.n()).done;){var u=o.value;if(0===r.indexOf(u)){var l,_,c=r.substring(u.length+1).split("/");if("api"===c[0]&&"assets"===c[1]&&(null===(l=c[2])||void 0===l?void 0:l.length)>0&&(null===(_=c[3])||void 0===_?void 0:_.length)>0)return{u:u,a:c[2],i:c[3]}}}}catch(e){i.e(e)}finally{i.f()}if(0===r.indexOf(R)){var a,f,s=r.substring(R.length+1).split("/");if((null===(a=s[0])||void 0===a?void 0:a.length)>0&&(null===(f=s[1])||void 0===f?void 0:f.length)>0)return{u:R,a:s[0],i:s[1]}}}}if(!n)return null;try{var d=atob(n),p=JSON.parse(d);if(!p.u||!p.i||!p.a)return null;for(;p.u.endsWith("/");)p.u=p.u.substring(0,p.u.length-1);return p}catch(e){return null}}function j(){var e;e=B,V||(V=document.body.appendChild(document.createElement("div"))),Object(P.d)(Object(P.a)(W,{baseUrl:e}),V),function(){var e;if(!B)return;var t=document.createElement("link");t.rel="stylesheet",t.href="".concat(B,"/scripts/embed-sdk.css"),t.type="text/css",null===(e=document.head)||void 0===e||e.appendChild(t)}()}n.r(t);var S,A,E,P=n("hosL"),C=0,I=[],H=P.c.__b,T=P.c.__r,N=P.c.diffed,q=P.c.__c,D=P.c.unmount;P.c.__b=function(e){A=null,H&&H(e)},P.c.__r=function(e){T&&T(e),S=0;var t=(A=e.__c).__H;t&&(t.__h.forEach(a),t.__h.forEach(f),t.__h=[])},P.c.diffed=function(e){N&&N(e);var t=e.__c;t&&t.__H&&t.__H.__h.length&&(1!==I.push(t)&&E===P.c.requestAnimationFrame||((E=P.c.requestAnimationFrame)||function(e){var t,n=function(){clearTimeout(r),L&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);L&&(t=requestAnimationFrame(n))})(c)),A=null},P.c.__c=function(e,t){t.some((function(e){try{e.__h.forEach(a),e.__h=e.__h.filter((function(e){return!e.__||f(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],P.c.__e(n,e.__v)}})),q&&q(e,t)},P.c.unmount=function(e){D&&D(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{a(e)}catch(e){t=e}})),t&&P.c.__e(t,n.__v))};var L="function"==typeof requestAnimationFrame,M=function(e){var t=e.url,n=e.onClose;return Object(P.a)("div",{class:"squidex-iframe"},Object(P.a)("button",{class:"squidex-iframe-close",onClick:n},Object(P.a)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24"},Object(P.a)("path",{d:"M18.984 6.422l-5.578 5.578 5.578 5.578-1.406 1.406-5.578-5.578-5.578 5.578-1.406-1.406 5.578-5.578-5.578-5.578 1.406-1.406 5.578 5.578 5.578-5.578z"}))),Object(P.a)("iframe",{src:t,frameBorder:0}))},U=function(e){var t,n,r,c,a,f,s=e.onOpen,d=e.target,v=e.token,h=l(),y=l(),m=l(),b=p(o(0),2),g=b[1];i((function(){g((function(e){return e+1}))}),[v]),i((function(){function e(){var e=d.getBoundingClientRect(),t=m.current;t&&e.height===t.height&&e.width===t.width&&e.x===t.x&&e.y===t.y||(m.current=e,g((function(e){return e+1})))}document.body.addEventListener("scroll",e);var t=setInterval((function(){e()}),500);return e(),function(){clearInterval(t),document.body.removeEventListener("scroll",e)}}),[d]),u((function(){if(h.current){var e=h.current.getBoundingClientRect(),t=y.current;t&&e.height===t.height&&e.width===t.width||(y.current=e,g((function(e){return e+1})))}}),[g]);var k=_((function(){var e=v.a,t=v.i,n=v.s,r=v.u;return n?"".concat(r,"/app/").concat(e,"/content/").concat(n,"/").concat(t):"".concat(r,"/app/").concat(e,"/assets/?ref=").concat(t)}),[v]),O=_((function(){var e=v.a,t=v.i,n=v.s,r=v.u;return n?"".concat(r,"/embed/app/").concat(e,"/content/").concat(n,"/").concat(t):"".concat(r,"/embed/app/").concat(e,"/assets/?ref=").concat(t)}),[v]),w=((null===(t=m.current)||void 0===t?void 0:t.x)||0)-2,x=((null===(n=m.current)||void 0===n?void 0:n.y)||0)-2,j=((null===(r=m.current)||void 0===r?void 0:r.width)||0)+4,S=((null===(c=m.current)||void 0===c?void 0:c.height)||0)+4,A=(null===(a=y.current)||void 0===a?void 0:a.width)||0,E=(null===(f=y.current)||void 0===f?void 0:f.height)||0,C=w,I=x-E+2;return I<0&&(I=x+S-2),I+E>window.innerHeight&&(C=window.innerHeight-E),C<0&&(C=0),C+A>window.innerWidth&&(C=window.innerWidth-A),Object(P.a)("div",{class:"squidex-overlay"},Object(P.a)("div",{class:"squidex-overlay-border",style:{left:w,top:x,width:j,height:S}}),Object(P.a)("div",{class:"squidex-overlay-toolbar",style:{left:C,top:I},ref:h},Object(P.a)("div",{class:"squidex-overlay-schema"},(null==v?void 0:v.s)||"Asset"),Object(P.a)("div",{class:"squidex-overlay-links","data-links":!0},Object(P.a)("a",{onClick:function(){return s(O)}},"Edit Inline"),Object(P.a)("a",{href:k,target:"_blank"},"Edit In Squidex"))))},F={x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY},W=function(e){var t=l(),n=k(o({}),2),r=n[0],u=n[1],c=k(o(),2),a=c[0],f=c[1],s=k(o(),2),d=s[0],p=s[1],v=l(r);i((function(){function e(e){var t=e.target;if(t&&!function(e){for(var t=e;t;){if("squidex-overlay-toolbar"===t.className)return!0;t=t.parentElement}return!1}(t)){var o=function(e,t){for(var n=e;n;){var r=x(n,t);if(r)return{token:r,target:n};n=n.parentElement}return{}}(t,Object.keys(v.current)),i=o.token,u=o.target,l={x:e.clientX,y:e.clientY};i&&u?(r(u,i),n=l):Math.abs(l.x-n.x)+Math.abs(l.y-n.y)>20&&r(void 0,void 0),t}}var t=void 0,n=F,r=function(e,n){e!==t&&(f(e&&n?{target:e,token:n}:void 0),t=e)};return document.addEventListener("mousemove",e),function(){document.removeEventListener("mousemove",e)}}),[]);var m,O=(m=function(e){if(e&&!v.current[e]){var t=function(t){var n=b(b({},v.current),{},g({},e,t));v.current=n,u(n)};if(0!==e.indexOf("http://")){var n=function(){var n,r=(n=function*(){t("Pending");try{var n=yield fetch("".concat(e,"/identity-server/info"),{credentials:"include"}),r=yield n.json();t(r.displayName?"Authenticated":"Failed")}catch(e){t("Failed")}},function(){var e=this,t=arguments;return new Promise((function(r,o){function i(e){y(l,r,o,i,u,"next",e)}function u(e){y(l,r,o,i,u,"throw",e)}var l=n.apply(e,t);i(void 0)}))});return function(){return r.apply(this,arguments)}}();n()}else t("Authenticated")}},C=8,_((function(){return m}),[r]));i((function(){O(e.baseUrl)}),[e.baseUrl]),i((function(){O(null==a?void 0:a.token.u)}),[null==a?void 0:a.token.u]);var w="Authenticated"===r[null==a?void 0:a.token.u];return Object(P.a)("div",{class:"squidex",ref:t},a&&w&&Object(P.a)(U,h({onOpen:p},a)),d&&Object(P.a)(M,{url:d,onClose:function(){return p(void 0)}}))},R="https://assets.squidex.io",V=null,B=function(){var e,t,n=null===(e=document.currentScript)||void 0===e?void 0:e.src;if(!("string"==typeof(t=n)||t instanceof String))return null;var r=(n=n.trim()).indexOf("/","https://".length);return r>0&&(n=n.substring(0,r)),n}();"complete"===document.readyState?j():window.addEventListener("load",(function(){return j()}))}}); +!function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:r})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var o in e)t.d(r,o,function(t){return e[t]}.bind(null,o));return r},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/",t(t.s="mdyV")}({hosL:function(e,t,n){"use strict";function r(e,t){for(var n in t)e[n]=t[n];return e}function o(e){var t=e.parentNode;t&&t.removeChild(e)}function i(e,t,n){var r,o,i,l={};for(i in t)"key"==i?r=t[i]:"ref"==i?o=t[i]:l[i]=t[i];if(arguments.length>2&&(l.children=arguments.length>3?E.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(i in e.defaultProps)void 0===l[i]&&(l[i]=e.defaultProps[i]);return u(e,l,r,o,null)}function u(e,t,n,r,o){var i={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==o?++C:o};return null==o&&null!=P.vnode&&P.vnode(i),i}function l(e){return e.children}function _(e,t){this.props=e,this.context=t}function c(e,t){if(null==t)return e.__?c(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t0?u(m.type,m.props,m.key,null,m.__v):m)){if(m.__=n,m.__b=n.__b+1,null===(y=j[d])||y&&m.key==y.key&&m.type===y.type)j[d]=void 0;else for(h=0;h=n.__.length&&n.__.push({}),n.__[e]}function o(e){return C=1,function(e,t,n){var o=r(A++,2);return o.t=e,o.__c||(o.__=[n?n(t):d(void 0,t),function(e){var t=o.t(o.__[0],e);o.__[0]!==t&&(o.__=[t,o.__[1]],o.__c.setState({}))}],o.__c=S),o.__}(d,e)}function i(e,t){var n=r(A++,3);!P.c.__s&&s(n.__H,t)&&(n.__=e,n.__H=t,S.__H.__h.push(n))}function u(e,t){var n=r(A++,4);!P.c.__s&&s(n.__H,t)&&(n.__=e,n.__H=t,S.__h.push(n))}function l(e){return C=5,_((function(){return{current:e}}),[])}function _(e,t){var n=r(A++,7);return s(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function c(){var e;for(I.sort((function(e,t){return e.__v.__b-t.__v.__b}));e=I.pop();)if(e.__P)try{e.__H.__h.forEach(a),e.__H.__h.forEach(f),e.__H.__h=[]}catch(t){e.__H.__h=[],P.c.__e(t,e.__v)}}function a(e){var t=S,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),S=t}function f(e){var t=S;e.__c=e.__(),S=t}function s(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function d(e,t){return"function"==typeof t?t(e):t}function p(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,o,i=[],u=!0,l=!1;try{for(n=n.call(e);!(u=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);u=!0);}catch(e){l=!0,o=e}finally{try{u||null==n.return||n.return()}finally{if(l)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return v(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return v(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,u=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return u=e.done,e},e:function(e){l=!0,i=e},f:function(){try{u||null==n.return||n.return()}finally{if(l)throw i}}}}(t);try{for(i.s();!(o=i.n()).done;){var u=o.value;if(0===r.indexOf(u)){var l,_,c=r.substring(u.length+1).split("/");if("api"===c[0]&&"assets"===c[1]&&(null===(l=c[2])||void 0===l?void 0:l.length)>0&&(null===(_=c[3])||void 0===_?void 0:_.length)>0)return{u:u,a:c[2],i:c[3]}}}}catch(e){i.e(e)}finally{i.f()}if(0===r.indexOf(R)){var a,f,s=r.substring(R.length+1).split("/");if((null===(a=s[0])||void 0===a?void 0:a.length)>0&&(null===(f=s[1])||void 0===f?void 0:f.length)>0)return{u:R,a:s[0],i:s[1]}}}}if(!n)return null;try{var d=atob(n),p=JSON.parse(d);if(!p.u||!p.i||!p.a)return null;for(;p.u.endsWith("/");)p.u=p.u.substring(0,p.u.length-1);return p}catch(e){return null}}function j(){var e;e=B,V||(V=document.body.appendChild(document.createElement("div"))),Object(P.d)(Object(P.a)(W,{baseUrl:e}),V),function(){var e;if(!B)return;var t=document.createElement("link");t.rel="stylesheet",t.href="".concat(B,"/scripts/embed-sdk.css"),t.type="text/css",null===(e=document.head)||void 0===e||e.appendChild(t)}()}n.r(t);var A,S,E,P=n("hosL"),C=0,I=[],H=P.c.__b,T=P.c.__r,q=P.c.diffed,N=P.c.__c,D=P.c.unmount;P.c.__b=function(e){S=null,H&&H(e)},P.c.__r=function(e){T&&T(e),A=0;var t=(S=e.__c).__H;t&&(t.__h.forEach(a),t.__h.forEach(f),t.__h=[])},P.c.diffed=function(e){q&&q(e);var t=e.__c;t&&t.__H&&t.__H.__h.length&&(1!==I.push(t)&&E===P.c.requestAnimationFrame||((E=P.c.requestAnimationFrame)||function(e){var t,n=function(){clearTimeout(r),L&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);L&&(t=requestAnimationFrame(n))})(c)),S=null},P.c.__c=function(e,t){t.some((function(e){try{e.__h.forEach(a),e.__h=e.__h.filter((function(e){return!e.__||f(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],P.c.__e(n,e.__v)}})),N&&N(e,t)},P.c.unmount=function(e){D&&D(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{a(e)}catch(e){t=e}})),t&&P.c.__e(t,n.__v))};var L="function"==typeof requestAnimationFrame,M=function(e){var t=e.url,n=e.onClose;return Object(P.a)("div",{class:"squidex-iframe"},Object(P.a)("button",{class:"squidex-iframe-close",onClick:n},Object(P.a)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24"},Object(P.a)("path",{d:"M18.984 6.422l-5.578 5.578 5.578 5.578-1.406 1.406-5.578-5.578-5.578 5.578-1.406-1.406 5.578-5.578-5.578-5.578 1.406-1.406 5.578 5.578 5.578-5.578z"}))),Object(P.a)("iframe",{src:t,frameBorder:0}))},U=function(e){var t,n,r,c,a,f,s=e.onOpen,d=e.target,v=e.token,h=l(),y=l(),m=l(),b=p(o(0),2),g=b[1];i((function(){g((function(e){return e+1}))}),[v]),i((function(){function e(){var e=d.getBoundingClientRect(),t=m.current;t&&e.height===t.height&&e.width===t.width&&e.x===t.x&&e.y===t.y||(m.current=e,g((function(e){return e+1})))}document.body.addEventListener("scroll",e);var t=setInterval((function(){e()}),500);return e(),function(){clearInterval(t),document.body.removeEventListener("scroll",e)}}),[d]),u((function(){if(h.current){var e=h.current.getBoundingClientRect(),t=y.current;t&&e.height===t.height&&e.width===t.width||(y.current=e,g((function(e){return e+1})))}}),[g]);var k=_((function(){var e=v.a,t=v.i,n=v.s,r=v.u;return n?"".concat(r,"/app/").concat(e,"/content/").concat(n,"/").concat(t):"".concat(r,"/app/").concat(e,"/assets/?ref=").concat(t)}),[v]),O=_((function(){var e=v.a,t=v.i,n=v.s,r=v.u;return n?"".concat(r,"/embed/app/").concat(e,"/content/").concat(n,"/").concat(t):"".concat(r,"/embed/app/").concat(e,"/assets/?ref=").concat(t)}),[v]),w=((null===(t=m.current)||void 0===t?void 0:t.x)||0)-2,x=((null===(n=m.current)||void 0===n?void 0:n.y)||0)-2,j=((null===(r=m.current)||void 0===r?void 0:r.width)||0)+4,A=((null===(c=m.current)||void 0===c?void 0:c.height)||0)+4,S=(null===(a=y.current)||void 0===a?void 0:a.width)||0,E=(null===(f=y.current)||void 0===f?void 0:f.height)||0,C=w,I=x-E+2;return I<0&&(I=x+A-2),I+E>window.innerHeight&&(C=window.innerHeight-E),C<0&&(C=0),C+S>window.innerWidth&&(C=window.innerWidth-S),Object(P.a)("div",{class:"squidex-overlay"},Object(P.a)("div",{class:"squidex-overlay-border",style:{left:w,top:x,width:j,height:A}}),Object(P.a)("div",{class:"squidex-overlay-toolbar",style:{left:C,top:I},ref:h},Object(P.a)("div",{class:"squidex-overlay-schema"},(null==v?void 0:v.s)||"Asset"),Object(P.a)("div",{class:"squidex-overlay-links","data-links":!0},Object(P.a)("a",{onClick:function(){return s(O)}},"Edit Inline"),Object(P.a)("a",{href:k,target:"_blank"},"Edit In Squidex"))))},F={x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY},W=function(e){var t=l(),n=k(o({}),2),r=n[0],u=n[1],c=k(o(),2),a=c[0],f=c[1],s=k(o(),2),d=s[0],p=s[1],v=l(r);i((function(){function e(e){var t=e.target;if(t&&!function(e){for(var t=e;t;){if("squidex-overlay-toolbar"===t.className)return!0;t=t.parentElement}return!1}(t)){var o=function(e,t){for(var n=e;n;){var r=x(n,t);if(r)return{token:r,target:n};n=n.parentElement}return{}}(t,Object.keys(v.current)),i=o.token,u=o.target,l={x:e.clientX,y:e.clientY};i&&u?(r(u,i),n=l):Math.abs(l.x-n.x)+Math.abs(l.y-n.y)>20&&r(void 0,void 0),t}}var t=void 0,n=F,r=function(e,n){e!==t&&(f(e&&n?{target:e,token:n}:void 0),t=e)};return document.addEventListener("mousemove",e),function(){document.removeEventListener("mousemove",e)}}),[]);var m,O=(m=function(e){if(e&&!v.current[e]){var t=function(t){var n=b(b({},v.current),{},g({},e,t));v.current=n,u(n)};if(0!==e.indexOf("http://")){var n=function(){var n,r=(n=function*(){t("Pending");try{var n=yield fetch("".concat(e,"/identity-server/info"),{credentials:"include"}),r=yield n.json();t(r.displayName?"Authenticated":"Failed")}catch(e){t("Failed")}},function(){var e=this,t=arguments;return new Promise((function(r,o){function i(e){y(l,r,o,i,u,"next",e)}function u(e){y(l,r,o,i,u,"throw",e)}var l=n.apply(e,t);i(void 0)}))});return function(){return r.apply(this,arguments)}}();n()}else t("Authenticated")}},C=8,_((function(){return m}),[r]));i((function(){O(e.baseUrl)}),[e.baseUrl]),i((function(){O(null==a?void 0:a.token.u)}),[null==a?void 0:a.token.u]);var w="Authenticated"===r[null==a?void 0:a.token.u];return Object(P.a)("div",{class:"squidex",ref:t},a&&w&&Object(P.a)(U,h({onOpen:p},a)),d&&Object(P.a)(M,{url:d,onClose:function(){return p(void 0)}}))},R="https://assets.squidex.io",V=null,B=function(){var e,t,n=null===(e=document.currentScript)||void 0===e?void 0:e.src;if(!("string"==typeof(t=n)||t instanceof String))return null;var r=(n=n.trim()).indexOf("/","https://".length);return r>0&&(n=n.substring(0,r)),n}();"complete"===document.readyState?j():window.addEventListener("load",(function(){return j()}))}}); //# sourceMappingURL=embed-sdk.js.map \ No newline at end of file diff --git a/backend/src/Squidex/wwwroot/scripts/embed-sdk.js.map b/backend/src/Squidex/wwwroot/scripts/embed-sdk.js.map index 805b1d3c3..2f942df9a 100644 --- a/backend/src/Squidex/wwwroot/scripts/embed-sdk.js.map +++ b/backend/src/Squidex/wwwroot/scripts/embed-sdk.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///../src/util.js","webpack:///../src/create-element.js","webpack:///../src/component.js","webpack:///../src/diff/children.js","webpack:///../src/diff/props.js","webpack:///../src/diff/index.js","webpack:///../src/render.js","webpack:///../src/constants.js","webpack:///../src/options.js","webpack:///../src/diff/catch-error.js","webpack:///../node_modules/preact-cli/lib/lib/entry.js","webpack:///../src/index.js","webpack:///./components/overlay-container.tsx","webpack:///./index.ts","webpack:///./render.tsx","webpack:///./components/iframe.tsx","webpack:///./components/Overlay.tsx","webpack:///./utils.ts"],"names":["__webpack_require__","moduleId","installedModules","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","assign","obj","props","removeNode","node","parentNode","removeChild","createElement","type","children","ref","normalizedProps","arguments","length","slice","defaultProps","createVNode","original","vnode","undefined","constructor","vnodeId","options","Fragment","Component","context","getDomSibling","childIndex","indexOf","sibling","updateParentDomPointers","child","base","enqueueRender","rerenderQueue","push","process","prevDebounce","debounceRendering","defer","queue","sort","a","b","some","component","commitQueue","oldVNode","oldDom","parentDom","diff","ownerSVGElement","commitRoot","diffChildren","renderResult","newParentVNode","oldParentVNode","globalContext","isSvg","excessDomChildren","isHydrating","j","childVNode","newDom","firstChildDom","refs","oldChildren","EMPTY_ARR","oldChildrenLength","Array","isArray","EMPTY_OBJ","reorderChildren","placeChild","unmount","applyRef","tmp","nextDom","sibDom","outer","appendChild","nextSibling","insertBefore","setStyle","style","setProperty","IS_NON_DIMENSIONAL","test","dom","oldValue","useCapture","cssText","replace","toLowerCase","_listeners","addEventListener","eventProxyCapture","eventProxy","removeEventListener","e","setAttribute","removeAttribute","event","newVNode","isNew","oldProps","oldState","snapshot","clearProcessingException","newProps","provider","componentContext","newType","contextType","render","doRender","sub","state","getDerivedStateFromProps","componentWillMount","componentDidMount","componentWillReceiveProps","shouldComponentUpdate","forEach","componentWillUpdate","componentDidUpdate","getChildContext","getSnapshotBeforeUpdate","diffElementNodes","diffed","root","cb","oldHtml","newHtml","nodeType","localName","document","createTextNode","createElementNS","is","data","childNodes","dangerouslySetInnerHTML","attributes","innerHTML","hydrate","diffProps","checked","current","parentVNode","skipRemove","componentWillUnmount","this","replaceNode","firstChild","error","ctor","handled","getDerivedStateFromError","setState","componentDidCatch","update","callback","forceUpdate","Promise","then","resolve","setTimeout","h","Preact","interopDefault","default","require","getElementById","body","firstElementChild","app","preRenderData","inlineDataElement","querySelector","JSON","parse","decodeURI","url","CLI_DATA","init","getHookState","index","currentComponent","currentHook","hooks","useState","initialState","reducer","hookState","currentIndex","_reducer","invokeOrReturn","nextValue","action","useReducer","useEffect","args","argsChanged","useLayoutEffect","useRef","initialValue","useMemo","factory","flushAfterPaintEffects","afterPaintEffects","pop","invokeCleanup","invokeEffect","hook","comp","cleanup","oldArgs","newArgs","arg","f","parseToken","target","baseUrls","getAttribute","nodeName","src","baseUrl","parts","substring","split","u","CDN_URL","decoded","atob","token","endsWith","element","styleElement","rel","href","head","renderStyles","prevRaf","oldBeforeDiff","oldBeforeRender","oldAfterDiff","oldCommit","oldBeforeUnmount","requestAnimationFrame","raf","done","clearTimeout","timeout","HAS_RAF","cancelAnimationFrame","filter","hasErrored","IFrame","onClose","class","onClick","version","xmlns","width","height","viewBox","frameBorder","Overlay","onOpen","toolbarRef","linksRect","targetRect","x","layout","rect","getBoundingClientRect","y","timer","setInterval","clearInterval","externalUrl","embedUrl","overlayWidth","overlayHeight","toolbarWidth","toolbarHeight","linkX","linkY","window","innerHeight","innerWidth","left","top","UNSET","Number","NEGATIVE_INFINITY","OverlayContainer","div","auth","setAuth","setTarget","targetUrl","setTargetUrl","authRef","listen","console","log","className","parentElement","isToolbar","parseTokenInPath","keys","position","clientX","clientY","updateTarget","previousPosition","Math","abs","previousTarget","checkAuth","updateAuth","newAuth","fetchStatus","response","fetch","credentials","json","displayName","isAuthenticated","currentScript","String","indexOfHash","trim","getBaseUrl","readyState"],"mappings":"aAIE,SAASA,EAAoBC,GAG5B,GAAGC,EAAiBD,GACnB,OA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AA3B5I,EAAI3J,QAAQ,WAAhB,CAKA,IAAMwS,EAAW,e,EAAA,G,EAAG,YAChBF,EAAW,WAEX,IACI,IAAMG,QAAiBC,MAAM,GAAD,OAAI/I,EAAJ,yBAAgC,CACxDgJ,YAAa,YAGXC,QAAaH,EAASG,OAE5BN,EAAWM,EAAKC,YAAc,gBAAkB,UAClD,SACEP,EAAW,Y,+KAZF,qDAgBjBE,SApBIF,EAAW,mBDyItBrI,EAAc,EACPkB,GAAQ,kBAAM7C,ICrHf,CAACyI,KAEJlG,GAAU,WACNwH,EAAU/T,EAAMiO,WACjB,CAACjO,EAAMiO,UAEV1B,GAAU,WACNwH,EAAUnG,aAAD,EAACA,EAAQa,MAAMJ,KACzB,CAACT,aAAD,EAACA,EAAQa,MAAMJ,IAElB,IAAMmG,EAA6C,kBAA3B/B,EAAK7E,aAAD,EAACA,EAAQa,MAAMJ,GAE3C,OACI,mBAAK6B,MAAM,UAAU1P,IAAKgS,GACrB5E,GAAU4G,GACP,YAAC,EAAD,GAAS7D,OAAQkC,GAAkBjF,IAGtCgF,GACG,YAAC,EAAD,CAAQvH,IAAKuH,EAAW3C,QAAS,kBAAM4C,OAAa5R,QAM9DqN,EAAU,4BE9HZK,EAAiC,KDC/BV,EIwBC,WAAsB,MAxBJlP,EAyBjBsM,EAAG,QAAI,EAAA/C,SAASmM,qBAAb,aAAG,MAEV,KA1BwB,iBADH1V,EA2BPsM,IA1BsBtM,aAAiB2V,QA2BjD,OAAO,KAKX,IAAIC,GAFJtJ,EAAMA,EAAIuJ,QAEYlT,QAAQ,IAAK,WAAWf,QAM9C,OAJIgU,EAAc,IACdtJ,EAAMA,EAAI8C,UAAU,EAAGwG,IAGpBtJ,EJvCKwJ,GAqBY,aAAxBvM,SAASwM,WACTvJ,IAEAwG,OAAOlM,iBAAiB,QAAQ,kBAAM0F","file":"bundle.9d0e2.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"mdyV\");\n","import { EMPTY_ARR } from \"./constants\";\r\n\r\n/**\r\n * Assign properties from `props` to `obj`\r\n * @template O, P The obj and props types\r\n * @param {O} obj The object to copy properties to\r\n * @param {P} props The object to copy properties from\r\n * @returns {O & P}\r\n */\r\nexport function assign(obj, props) {\r\n\t// @ts-ignore We change the type of `obj` to be `O & P`\r\n\tfor (let i in props) obj[i] = props[i];\r\n\treturn /** @type {O & P} */ (obj);\r\n}\r\n\r\n/**\r\n * Remove a child node from its parent if attached. This is a workaround for\r\n * IE11 which doesn't support `Element.prototype.remove()`. Using this function\r\n * is smaller than including a dedicated polyfill.\r\n * @param {Node} node The node to remove\r\n */\r\nexport function removeNode(node) {\r\n\tlet parentNode = node.parentNode;\r\n\tif (parentNode) parentNode.removeChild(node);\r\n}\r\n\r\nexport const slice = EMPTY_ARR.slice;\r\n","import { slice } from './util';\r\nimport options from './options';\r\n\r\nlet vnodeId = 0;\r\n\r\n/**\r\n * Create an virtual node (used for JSX)\r\n * @param {import('./internal').VNode[\"type\"]} type The node name or Component\r\n * constructor for this virtual node\r\n * @param {object | null | undefined} [props] The properties of the virtual node\r\n * @param {Array} [children] The children of the virtual node\r\n * @returns {import('./internal').VNode}\r\n */\r\nexport function createElement(type, props, children) {\r\n\tlet normalizedProps = {},\r\n\t\tkey,\r\n\t\tref,\r\n\t\ti;\r\n\tfor (i in props) {\r\n\t\tif (i == 'key') key = props[i];\r\n\t\telse if (i == 'ref') ref = props[i];\r\n\t\telse normalizedProps[i] = props[i];\r\n\t}\r\n\r\n\tif (arguments.length > 2) {\r\n\t\tnormalizedProps.children =\r\n\t\t\targuments.length > 3 ? slice.call(arguments, 2) : children;\r\n\t}\r\n\r\n\t// If a Component VNode, check for and apply defaultProps\r\n\t// Note: type may be undefined in development, must never error here.\r\n\tif (typeof type == 'function' && type.defaultProps != null) {\r\n\t\tfor (i in type.defaultProps) {\r\n\t\t\tif (normalizedProps[i] === undefined) {\r\n\t\t\t\tnormalizedProps[i] = type.defaultProps[i];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn createVNode(type, normalizedProps, key, ref, null);\r\n}\r\n\r\n/**\r\n * Create a VNode (used internally by Preact)\r\n * @param {import('./internal').VNode[\"type\"]} type The node name or Component\r\n * Constructor for this virtual node\r\n * @param {object | string | number | null} props The properties of this virtual node.\r\n * If this virtual node represents a text node, this is the text of the node (string or number).\r\n * @param {string | number | null} key The key for this virtual node, used when\r\n * diffing it against its children\r\n * @param {import('./internal').VNode[\"ref\"]} ref The ref property that will\r\n * receive a reference to its created child\r\n * @returns {import('./internal').VNode}\r\n */\r\nexport function createVNode(type, props, key, ref, original) {\r\n\t// V8 seems to be better at detecting type shapes if the object is allocated from the same call site\r\n\t// Do not inline into createElement and coerceToVNode!\r\n\tconst vnode = {\r\n\t\ttype,\r\n\t\tprops,\r\n\t\tkey,\r\n\t\tref,\r\n\t\t_children: null,\r\n\t\t_parent: null,\r\n\t\t_depth: 0,\r\n\t\t_dom: null,\r\n\t\t// _nextDom must be initialized to undefined b/c it will eventually\r\n\t\t// be set to dom.nextSibling which can return `null` and it is important\r\n\t\t// to be able to distinguish between an uninitialized _nextDom and\r\n\t\t// a _nextDom that has been set to `null`\r\n\t\t_nextDom: undefined,\r\n\t\t_component: null,\r\n\t\t_hydrating: null,\r\n\t\tconstructor: undefined,\r\n\t\t_original: original == null ? ++vnodeId : original\r\n\t};\r\n\r\n\t// Only invoke the vnode hook if this was *not* a direct copy:\r\n\tif (original == null && options.vnode != null) options.vnode(vnode);\r\n\r\n\treturn vnode;\r\n}\r\n\r\nexport function createRef() {\r\n\treturn { current: null };\r\n}\r\n\r\nexport function Fragment(props) {\r\n\treturn props.children;\r\n}\r\n\r\n/**\r\n * Check if a the argument is a valid Preact VNode.\r\n * @param {*} vnode\r\n * @returns {vnode is import('./internal').VNode}\r\n */\r\nexport const isValidElement = vnode =>\r\n\tvnode != null && vnode.constructor === undefined;\r\n","import { assign } from './util';\r\nimport { diff, commitRoot } from './diff/index';\r\nimport options from './options';\r\nimport { Fragment } from './create-element';\r\n\r\n/**\r\n * Base Component class. Provides `setState()` and `forceUpdate()`, which\r\n * trigger rendering\r\n * @param {object} props The initial component props\r\n * @param {object} context The initial context from parent components'\r\n * getChildContext\r\n */\r\nexport function Component(props, context) {\r\n\tthis.props = props;\r\n\tthis.context = context;\r\n}\r\n\r\n/**\r\n * Update component state and schedule a re-render.\r\n * @this {import('./internal').Component}\r\n * @param {object | ((s: object, p: object) => object)} update A hash of state\r\n * properties to update with new values or a function that given the current\r\n * state and props returns a new partial state\r\n * @param {() => void} [callback] A function to be called once component state is\r\n * updated\r\n */\r\nComponent.prototype.setState = function(update, callback) {\r\n\t// only clone state when copying to nextState the first time.\r\n\tlet s;\r\n\tif (this._nextState != null && this._nextState !== this.state) {\r\n\t\ts = this._nextState;\r\n\t} else {\r\n\t\ts = this._nextState = assign({}, this.state);\r\n\t}\r\n\r\n\tif (typeof update == 'function') {\r\n\t\t// Some libraries like `immer` mark the current state as readonly,\r\n\t\t// preventing us from mutating it, so we need to clone it. See #2716\r\n\t\tupdate = update(assign({}, s), this.props);\r\n\t}\r\n\r\n\tif (update) {\r\n\t\tassign(s, update);\r\n\t}\r\n\r\n\t// Skip update if updater function returned null\r\n\tif (update == null) return;\r\n\r\n\tif (this._vnode) {\r\n\t\tif (callback) this._renderCallbacks.push(callback);\r\n\t\tenqueueRender(this);\r\n\t}\r\n};\r\n\r\n/**\r\n * Immediately perform a synchronous re-render of the component\r\n * @this {import('./internal').Component}\r\n * @param {() => void} [callback] A function to be called after component is\r\n * re-rendered\r\n */\r\nComponent.prototype.forceUpdate = function(callback) {\r\n\tif (this._vnode) {\r\n\t\t// Set render mode so that we can differentiate where the render request\r\n\t\t// is coming from. We need this because forceUpdate should never call\r\n\t\t// shouldComponentUpdate\r\n\t\tthis._force = true;\r\n\t\tif (callback) this._renderCallbacks.push(callback);\r\n\t\tenqueueRender(this);\r\n\t}\r\n};\r\n\r\n/**\r\n * Accepts `props` and `state`, and returns a new Virtual DOM tree to build.\r\n * Virtual DOM is generally constructed via [JSX](http://jasonformat.com/wtf-is-jsx).\r\n * @param {object} props Props (eg: JSX attributes) received from parent\r\n * element/component\r\n * @param {object} state The component's current state\r\n * @param {object} context Context object, as returned by the nearest\r\n * ancestor's `getChildContext()`\r\n * @returns {import('./index').ComponentChildren | void}\r\n */\r\nComponent.prototype.render = Fragment;\r\n\r\n/**\r\n * @param {import('./internal').VNode} vnode\r\n * @param {number | null} [childIndex]\r\n */\r\nexport function getDomSibling(vnode, childIndex) {\r\n\tif (childIndex == null) {\r\n\t\t// Use childIndex==null as a signal to resume the search from the vnode's sibling\r\n\t\treturn vnode._parent\r\n\t\t\t? getDomSibling(vnode._parent, vnode._parent._children.indexOf(vnode) + 1)\r\n\t\t\t: null;\r\n\t}\r\n\r\n\tlet sibling;\r\n\tfor (; childIndex < vnode._children.length; childIndex++) {\r\n\t\tsibling = vnode._children[childIndex];\r\n\r\n\t\tif (sibling != null && sibling._dom != null) {\r\n\t\t\t// Since updateParentDomPointers keeps _dom pointer correct,\r\n\t\t\t// we can rely on _dom to tell us if this subtree contains a\r\n\t\t\t// rendered DOM node, and what the first rendered DOM node is\r\n\t\t\treturn sibling._dom;\r\n\t\t}\r\n\t}\r\n\r\n\t// If we get here, we have not found a DOM node in this vnode's children.\r\n\t// We must resume from this vnode's sibling (in it's parent _children array)\r\n\t// Only climb up and search the parent if we aren't searching through a DOM\r\n\t// VNode (meaning we reached the DOM parent of the original vnode that began\r\n\t// the search)\r\n\treturn typeof vnode.type == 'function' ? getDomSibling(vnode) : null;\r\n}\r\n\r\n/**\r\n * Trigger in-place re-rendering of a component.\r\n * @param {import('./internal').Component} component The component to rerender\r\n */\r\nfunction renderComponent(component) {\r\n\tlet vnode = component._vnode,\r\n\t\toldDom = vnode._dom,\r\n\t\tparentDom = component._parentDom;\r\n\r\n\tif (parentDom) {\r\n\t\tlet commitQueue = [];\r\n\t\tconst oldVNode = assign({}, vnode);\r\n\t\toldVNode._original = vnode._original + 1;\r\n\r\n\t\tdiff(\r\n\t\t\tparentDom,\r\n\t\t\tvnode,\r\n\t\t\toldVNode,\r\n\t\t\tcomponent._globalContext,\r\n\t\t\tparentDom.ownerSVGElement !== undefined,\r\n\t\t\tvnode._hydrating != null ? [oldDom] : null,\r\n\t\t\tcommitQueue,\r\n\t\t\toldDom == null ? getDomSibling(vnode) : oldDom,\r\n\t\t\tvnode._hydrating\r\n\t\t);\r\n\t\tcommitRoot(commitQueue, vnode);\r\n\r\n\t\tif (vnode._dom != oldDom) {\r\n\t\t\tupdateParentDomPointers(vnode);\r\n\t\t}\r\n\t}\r\n}\r\n\r\n/**\r\n * @param {import('./internal').VNode} vnode\r\n */\r\nfunction updateParentDomPointers(vnode) {\r\n\tif ((vnode = vnode._parent) != null && vnode._component != null) {\r\n\t\tvnode._dom = vnode._component.base = null;\r\n\t\tfor (let i = 0; i < vnode._children.length; i++) {\r\n\t\t\tlet child = vnode._children[i];\r\n\t\t\tif (child != null && child._dom != null) {\r\n\t\t\t\tvnode._dom = vnode._component.base = child._dom;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn updateParentDomPointers(vnode);\r\n\t}\r\n}\r\n\r\n/**\r\n * The render queue\r\n * @type {Array}\r\n */\r\nlet rerenderQueue = [];\r\n\r\n/**\r\n * Asynchronously schedule a callback\r\n * @type {(cb: () => void) => void}\r\n */\r\n/* istanbul ignore next */\r\n// Note the following line isn't tree-shaken by rollup cuz of rollup/rollup#2566\r\nconst defer =\r\n\ttypeof Promise == 'function'\r\n\t\t? Promise.prototype.then.bind(Promise.resolve())\r\n\t\t: setTimeout;\r\n\r\n/*\r\n * The value of `Component.debounce` must asynchronously invoke the passed in callback. It is\r\n * important that contributors to Preact can consistently reason about what calls to `setState`, etc.\r\n * do, and when their effects will be applied. See the links below for some further reading on designing\r\n * asynchronous APIs.\r\n * * [Designing APIs for Asynchrony](https://blog.izs.me/2013/08/designing-apis-for-asynchrony)\r\n * * [Callbacks synchronous and asynchronous](https://blog.ometer.com/2011/07/24/callbacks-synchronous-and-asynchronous/)\r\n */\r\n\r\nlet prevDebounce;\r\n\r\n/**\r\n * Enqueue a rerender of a component\r\n * @param {import('./internal').Component} c The component to rerender\r\n */\r\nexport function enqueueRender(c) {\r\n\tif (\r\n\t\t(!c._dirty &&\r\n\t\t\t(c._dirty = true) &&\r\n\t\t\trerenderQueue.push(c) &&\r\n\t\t\t!process._rerenderCount++) ||\r\n\t\tprevDebounce !== options.debounceRendering\r\n\t) {\r\n\t\tprevDebounce = options.debounceRendering;\r\n\t\t(prevDebounce || defer)(process);\r\n\t}\r\n}\r\n\r\n/** Flush the render queue by rerendering all queued components */\r\nfunction process() {\r\n\tlet queue;\r\n\twhile ((process._rerenderCount = rerenderQueue.length)) {\r\n\t\tqueue = rerenderQueue.sort((a, b) => a._vnode._depth - b._vnode._depth);\r\n\t\trerenderQueue = [];\r\n\t\t// Don't update `renderCount` yet. Keep its value non-zero to prevent unnecessary\r\n\t\t// process() calls from getting scheduled while `queue` is still being consumed.\r\n\t\tqueue.some(c => {\r\n\t\t\tif (c._dirty) renderComponent(c);\r\n\t\t});\r\n\t}\r\n}\r\nprocess._rerenderCount = 0;\r\n","import { diff, unmount, applyRef } from './index';\r\nimport { createVNode, Fragment } from '../create-element';\r\nimport { EMPTY_OBJ, EMPTY_ARR } from '../constants';\r\nimport { getDomSibling } from '../component';\r\n\r\n/**\r\n * Diff the children of a virtual node\r\n * @param {import('../internal').PreactElement} parentDom The DOM element whose\r\n * children are being diffed\r\n * @param {import('../internal').ComponentChildren[]} renderResult\r\n * @param {import('../internal').VNode} newParentVNode The new virtual\r\n * node whose children should be diff'ed against oldParentVNode\r\n * @param {import('../internal').VNode} oldParentVNode The old virtual\r\n * node whose children should be diff'ed against newParentVNode\r\n * @param {object} globalContext The current context object - modified by getChildContext\r\n * @param {boolean} isSvg Whether or not this DOM node is an SVG node\r\n * @param {Array} excessDomChildren\r\n * @param {Array} commitQueue List of components\r\n * which have callbacks to invoke in commitRoot\r\n * @param {import('../internal').PreactElement} oldDom The current attached DOM\r\n * element any new dom elements should be placed around. Likely `null` on first\r\n * render (except when hydrating). Can be a sibling DOM element when diffing\r\n * Fragments that have siblings. In most cases, it starts out as `oldChildren[0]._dom`.\r\n * @param {boolean} isHydrating Whether or not we are in hydration\r\n */\r\nexport function diffChildren(\r\n\tparentDom,\r\n\trenderResult,\r\n\tnewParentVNode,\r\n\toldParentVNode,\r\n\tglobalContext,\r\n\tisSvg,\r\n\texcessDomChildren,\r\n\tcommitQueue,\r\n\toldDom,\r\n\tisHydrating\r\n) {\r\n\tlet i, j, oldVNode, childVNode, newDom, firstChildDom, refs;\r\n\r\n\t// This is a compression of oldParentVNode!=null && oldParentVNode != EMPTY_OBJ && oldParentVNode._children || EMPTY_ARR\r\n\t// as EMPTY_OBJ._children should be `undefined`.\r\n\tlet oldChildren = (oldParentVNode && oldParentVNode._children) || EMPTY_ARR;\r\n\r\n\tlet oldChildrenLength = oldChildren.length;\r\n\r\n\tnewParentVNode._children = [];\r\n\tfor (i = 0; i < renderResult.length; i++) {\r\n\t\tchildVNode = renderResult[i];\r\n\r\n\t\tif (childVNode == null || typeof childVNode == 'boolean') {\r\n\t\t\tchildVNode = newParentVNode._children[i] = null;\r\n\t\t}\r\n\t\t// If this newVNode is being reused (e.g.
{reuse}{reuse}
) in the same diff,\r\n\t\t// or we are rendering a component (e.g. setState) copy the oldVNodes so it can have\r\n\t\t// it's own DOM & etc. pointers\r\n\t\telse if (\r\n\t\t\ttypeof childVNode == 'string' ||\r\n\t\t\ttypeof childVNode == 'number' ||\r\n\t\t\t// eslint-disable-next-line valid-typeof\r\n\t\t\ttypeof childVNode == 'bigint'\r\n\t\t) {\r\n\t\t\tchildVNode = newParentVNode._children[i] = createVNode(\r\n\t\t\t\tnull,\r\n\t\t\t\tchildVNode,\r\n\t\t\t\tnull,\r\n\t\t\t\tnull,\r\n\t\t\t\tchildVNode\r\n\t\t\t);\r\n\t\t} else if (Array.isArray(childVNode)) {\r\n\t\t\tchildVNode = newParentVNode._children[i] = createVNode(\r\n\t\t\t\tFragment,\r\n\t\t\t\t{ children: childVNode },\r\n\t\t\t\tnull,\r\n\t\t\t\tnull,\r\n\t\t\t\tnull\r\n\t\t\t);\r\n\t\t} else if (childVNode._depth > 0) {\r\n\t\t\t// VNode is already in use, clone it. This can happen in the following\r\n\t\t\t// scenario:\r\n\t\t\t// const reuse =
\r\n\t\t\t//
{reuse}{reuse}
\r\n\t\t\tchildVNode = newParentVNode._children[i] = createVNode(\r\n\t\t\t\tchildVNode.type,\r\n\t\t\t\tchildVNode.props,\r\n\t\t\t\tchildVNode.key,\r\n\t\t\t\tnull,\r\n\t\t\t\tchildVNode._original\r\n\t\t\t);\r\n\t\t} else {\r\n\t\t\tchildVNode = newParentVNode._children[i] = childVNode;\r\n\t\t}\r\n\r\n\t\t// Terser removes the `continue` here and wraps the loop body\r\n\t\t// in a `if (childVNode) { ... } condition\r\n\t\tif (childVNode == null) {\r\n\t\t\tcontinue;\r\n\t\t}\r\n\r\n\t\tchildVNode._parent = newParentVNode;\r\n\t\tchildVNode._depth = newParentVNode._depth + 1;\r\n\r\n\t\t// Check if we find a corresponding element in oldChildren.\r\n\t\t// If found, delete the array item by setting to `undefined`.\r\n\t\t// We use `undefined`, as `null` is reserved for empty placeholders\r\n\t\t// (holes).\r\n\t\toldVNode = oldChildren[i];\r\n\r\n\t\tif (\r\n\t\t\toldVNode === null ||\r\n\t\t\t(oldVNode &&\r\n\t\t\t\tchildVNode.key == oldVNode.key &&\r\n\t\t\t\tchildVNode.type === oldVNode.type)\r\n\t\t) {\r\n\t\t\toldChildren[i] = undefined;\r\n\t\t} else {\r\n\t\t\t// Either oldVNode === undefined or oldChildrenLength > 0,\r\n\t\t\t// so after this loop oldVNode == null or oldVNode is a valid value.\r\n\t\t\tfor (j = 0; j < oldChildrenLength; j++) {\r\n\t\t\t\toldVNode = oldChildren[j];\r\n\t\t\t\t// If childVNode is unkeyed, we only match similarly unkeyed nodes, otherwise we match by key.\r\n\t\t\t\t// We always match by type (in either case).\r\n\t\t\t\tif (\r\n\t\t\t\t\toldVNode &&\r\n\t\t\t\t\tchildVNode.key == oldVNode.key &&\r\n\t\t\t\t\tchildVNode.type === oldVNode.type\r\n\t\t\t\t) {\r\n\t\t\t\t\toldChildren[j] = undefined;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\toldVNode = null;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\toldVNode = oldVNode || EMPTY_OBJ;\r\n\r\n\t\t// Morph the old element into the new one, but don't append it to the dom yet\r\n\t\tdiff(\r\n\t\t\tparentDom,\r\n\t\t\tchildVNode,\r\n\t\t\toldVNode,\r\n\t\t\tglobalContext,\r\n\t\t\tisSvg,\r\n\t\t\texcessDomChildren,\r\n\t\t\tcommitQueue,\r\n\t\t\toldDom,\r\n\t\t\tisHydrating\r\n\t\t);\r\n\r\n\t\tnewDom = childVNode._dom;\r\n\r\n\t\tif ((j = childVNode.ref) && oldVNode.ref != j) {\r\n\t\t\tif (!refs) refs = [];\r\n\t\t\tif (oldVNode.ref) refs.push(oldVNode.ref, null, childVNode);\r\n\t\t\trefs.push(j, childVNode._component || newDom, childVNode);\r\n\t\t}\r\n\r\n\t\tif (newDom != null) {\r\n\t\t\tif (firstChildDom == null) {\r\n\t\t\t\tfirstChildDom = newDom;\r\n\t\t\t}\r\n\r\n\t\t\tif (\r\n\t\t\t\ttypeof childVNode.type == 'function' &&\r\n\t\t\t\tchildVNode._children === oldVNode._children\r\n\t\t\t) {\r\n\t\t\t\tchildVNode._nextDom = oldDom = reorderChildren(\r\n\t\t\t\t\tchildVNode,\r\n\t\t\t\t\toldDom,\r\n\t\t\t\t\tparentDom\r\n\t\t\t\t);\r\n\t\t\t} else {\r\n\t\t\t\toldDom = placeChild(\r\n\t\t\t\t\tparentDom,\r\n\t\t\t\t\tchildVNode,\r\n\t\t\t\t\toldVNode,\r\n\t\t\t\t\toldChildren,\r\n\t\t\t\t\tnewDom,\r\n\t\t\t\t\toldDom\r\n\t\t\t\t);\r\n\t\t\t}\r\n\r\n\t\t\tif (typeof newParentVNode.type == 'function') {\r\n\t\t\t\t// Because the newParentVNode is Fragment-like, we need to set it's\r\n\t\t\t\t// _nextDom property to the nextSibling of its last child DOM node.\r\n\t\t\t\t//\r\n\t\t\t\t// `oldDom` contains the correct value here because if the last child\r\n\t\t\t\t// is a Fragment-like, then oldDom has already been set to that child's _nextDom.\r\n\t\t\t\t// If the last child is a DOM VNode, then oldDom will be set to that DOM\r\n\t\t\t\t// node's nextSibling.\r\n\t\t\t\tnewParentVNode._nextDom = oldDom;\r\n\t\t\t}\r\n\t\t} else if (\r\n\t\t\toldDom &&\r\n\t\t\toldVNode._dom == oldDom &&\r\n\t\t\toldDom.parentNode != parentDom\r\n\t\t) {\r\n\t\t\t// The above condition is to handle null placeholders. See test in placeholder.test.js:\r\n\t\t\t// `efficiently replace null placeholders in parent rerenders`\r\n\t\t\toldDom = getDomSibling(oldVNode);\r\n\t\t}\r\n\t}\r\n\r\n\tnewParentVNode._dom = firstChildDom;\r\n\r\n\t// Remove remaining oldChildren if there are any.\r\n\tfor (i = oldChildrenLength; i--; ) {\r\n\t\tif (oldChildren[i] != null) {\r\n\t\t\tif (\r\n\t\t\t\ttypeof newParentVNode.type == 'function' &&\r\n\t\t\t\toldChildren[i]._dom != null &&\r\n\t\t\t\toldChildren[i]._dom == newParentVNode._nextDom\r\n\t\t\t) {\r\n\t\t\t\t// If the newParentVNode.__nextDom points to a dom node that is about to\r\n\t\t\t\t// be unmounted, then get the next sibling of that vnode and set\r\n\t\t\t\t// _nextDom to it\r\n\t\t\t\tnewParentVNode._nextDom = getDomSibling(oldParentVNode, i + 1);\r\n\t\t\t}\r\n\r\n\t\t\tunmount(oldChildren[i], oldChildren[i]);\r\n\t\t}\r\n\t}\r\n\r\n\t// Set refs only after unmount\r\n\tif (refs) {\r\n\t\tfor (i = 0; i < refs.length; i++) {\r\n\t\t\tapplyRef(refs[i], refs[++i], refs[++i]);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nfunction reorderChildren(childVNode, oldDom, parentDom) {\r\n\t// Note: VNodes in nested suspended trees may be missing _children.\r\n\tlet c = childVNode._children;\r\n\tlet tmp = 0;\r\n\tfor (; c && tmp < c.length; tmp++) {\r\n\t\tlet vnode = c[tmp];\r\n\t\tif (vnode) {\r\n\t\t\t// We typically enter this code path on sCU bailout, where we copy\r\n\t\t\t// oldVNode._children to newVNode._children. If that is the case, we need\r\n\t\t\t// to update the old children's _parent pointer to point to the newVNode\r\n\t\t\t// (childVNode here).\r\n\t\t\tvnode._parent = childVNode;\r\n\r\n\t\t\tif (typeof vnode.type == 'function') {\r\n\t\t\t\toldDom = reorderChildren(vnode, oldDom, parentDom);\r\n\t\t\t} else {\r\n\t\t\t\toldDom = placeChild(\r\n\t\t\t\t\tparentDom,\r\n\t\t\t\t\tvnode,\r\n\t\t\t\t\tvnode,\r\n\t\t\t\t\tc,\r\n\t\t\t\t\tvnode._dom,\r\n\t\t\t\t\toldDom\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn oldDom;\r\n}\r\n\r\n/**\r\n * Flatten and loop through the children of a virtual node\r\n * @param {import('../index').ComponentChildren} children The unflattened\r\n * children of a virtual node\r\n * @returns {import('../internal').VNode[]}\r\n */\r\nexport function toChildArray(children, out) {\r\n\tout = out || [];\r\n\tif (children == null || typeof children == 'boolean') {\r\n\t} else if (Array.isArray(children)) {\r\n\t\tchildren.some(child => {\r\n\t\t\ttoChildArray(child, out);\r\n\t\t});\r\n\t} else {\r\n\t\tout.push(children);\r\n\t}\r\n\treturn out;\r\n}\r\n\r\nfunction placeChild(\r\n\tparentDom,\r\n\tchildVNode,\r\n\toldVNode,\r\n\toldChildren,\r\n\tnewDom,\r\n\toldDom\r\n) {\r\n\tlet nextDom;\r\n\tif (childVNode._nextDom !== undefined) {\r\n\t\t// Only Fragments or components that return Fragment like VNodes will\r\n\t\t// have a non-undefined _nextDom. Continue the diff from the sibling\r\n\t\t// of last DOM child of this child VNode\r\n\t\tnextDom = childVNode._nextDom;\r\n\r\n\t\t// Eagerly cleanup _nextDom. We don't need to persist the value because\r\n\t\t// it is only used by `diffChildren` to determine where to resume the diff after\r\n\t\t// diffing Components and Fragments. Once we store it the nextDOM local var, we\r\n\t\t// can clean up the property\r\n\t\tchildVNode._nextDom = undefined;\r\n\t} else if (\r\n\t\toldVNode == null ||\r\n\t\tnewDom != oldDom ||\r\n\t\tnewDom.parentNode == null\r\n\t) {\r\n\t\touter: if (oldDom == null || oldDom.parentNode !== parentDom) {\r\n\t\t\tparentDom.appendChild(newDom);\r\n\t\t\tnextDom = null;\r\n\t\t} else {\r\n\t\t\t// `j href (xlink:href was removed from SVG and isn't needed)\r\n\t\t\t// - className --> class\r\n\t\t\tname = name.replace(/xlink[H:h]/, 'h').replace(/sName$/, 's');\r\n\t\t} else if (\r\n\t\t\tname !== 'href' &&\r\n\t\t\tname !== 'list' &&\r\n\t\t\tname !== 'form' &&\r\n\t\t\t// Default value in browsers is `-1` and an empty string is\r\n\t\t\t// cast to `0` instead\r\n\t\t\tname !== 'tabIndex' &&\r\n\t\t\tname !== 'download' &&\r\n\t\t\tname in dom\r\n\t\t) {\r\n\t\t\ttry {\r\n\t\t\t\tdom[name] = value == null ? '' : value;\r\n\t\t\t\t// labelled break is 1b smaller here than a return statement (sorry)\r\n\t\t\t\tbreak o;\r\n\t\t\t} catch (e) {}\r\n\t\t}\r\n\r\n\t\t// ARIA-attributes have a different notion of boolean values.\r\n\t\t// The value `false` is different from the attribute not\r\n\t\t// existing on the DOM, so we can't remove it. For non-boolean\r\n\t\t// ARIA-attributes we could treat false as a removal, but the\r\n\t\t// amount of exceptions would cost us too many bytes. On top of\r\n\t\t// that other VDOM frameworks also always stringify `false`.\r\n\r\n\t\tif (typeof value === 'function') {\r\n\t\t\t// never serialize functions as attribute values\r\n\t\t} else if (\r\n\t\t\tvalue != null &&\r\n\t\t\t(value !== false || (name[0] === 'a' && name[1] === 'r'))\r\n\t\t) {\r\n\t\t\tdom.setAttribute(name, value);\r\n\t\t} else {\r\n\t\t\tdom.removeAttribute(name);\r\n\t\t}\r\n\t}\r\n}\r\n\r\n/**\r\n * Proxy an event to hooked event handlers\r\n * @param {Event} e The event object from the browser\r\n * @private\r\n */\r\nfunction eventProxy(e) {\r\n\tthis._listeners[e.type + false](options.event ? options.event(e) : e);\r\n}\r\n\r\nfunction eventProxyCapture(e) {\r\n\tthis._listeners[e.type + true](options.event ? options.event(e) : e);\r\n}\r\n","import { EMPTY_OBJ } from '../constants';\r\nimport { Component, getDomSibling } from '../component';\r\nimport { Fragment } from '../create-element';\r\nimport { diffChildren } from './children';\r\nimport { diffProps, setProperty } from './props';\r\nimport { assign, removeNode, slice } from '../util';\r\nimport options from '../options';\r\n\r\n/**\r\n * Diff two virtual nodes and apply proper changes to the DOM\r\n * @param {import('../internal').PreactElement} parentDom The parent of the DOM element\r\n * @param {import('../internal').VNode} newVNode The new virtual node\r\n * @param {import('../internal').VNode} oldVNode The old virtual node\r\n * @param {object} globalContext The current context object. Modified by getChildContext\r\n * @param {boolean} isSvg Whether or not this element is an SVG node\r\n * @param {Array} excessDomChildren\r\n * @param {Array} commitQueue List of components\r\n * which have callbacks to invoke in commitRoot\r\n * @param {import('../internal').PreactElement} oldDom The current attached DOM\r\n * element any new dom elements should be placed around. Likely `null` on first\r\n * render (except when hydrating). Can be a sibling DOM element when diffing\r\n * Fragments that have siblings. In most cases, it starts out as `oldChildren[0]._dom`.\r\n * @param {boolean} [isHydrating] Whether or not we are in hydration\r\n */\r\nexport function diff(\r\n\tparentDom,\r\n\tnewVNode,\r\n\toldVNode,\r\n\tglobalContext,\r\n\tisSvg,\r\n\texcessDomChildren,\r\n\tcommitQueue,\r\n\toldDom,\r\n\tisHydrating\r\n) {\r\n\tlet tmp,\r\n\t\tnewType = newVNode.type;\r\n\r\n\t// When passing through createElement it assigns the object\r\n\t// constructor as undefined. This to prevent JSON-injection.\r\n\tif (newVNode.constructor !== undefined) return null;\r\n\r\n\t// If the previous diff bailed out, resume creating/hydrating.\r\n\tif (oldVNode._hydrating != null) {\r\n\t\tisHydrating = oldVNode._hydrating;\r\n\t\toldDom = newVNode._dom = oldVNode._dom;\r\n\t\t// if we resume, we want the tree to be \"unlocked\"\r\n\t\tnewVNode._hydrating = null;\r\n\t\texcessDomChildren = [oldDom];\r\n\t}\r\n\r\n\tif ((tmp = options._diff)) tmp(newVNode);\r\n\r\n\ttry {\r\n\t\touter: if (typeof newType == 'function') {\r\n\t\t\tlet c, isNew, oldProps, oldState, snapshot, clearProcessingException;\r\n\t\t\tlet newProps = newVNode.props;\r\n\r\n\t\t\t// Necessary for createContext api. Setting this property will pass\r\n\t\t\t// the context value as `this.context` just for this component.\r\n\t\t\ttmp = newType.contextType;\r\n\t\t\tlet provider = tmp && globalContext[tmp._id];\r\n\t\t\tlet componentContext = tmp\r\n\t\t\t\t? provider\r\n\t\t\t\t\t? provider.props.value\r\n\t\t\t\t\t: tmp._defaultValue\r\n\t\t\t\t: globalContext;\r\n\r\n\t\t\t// Get component and set it to `c`\r\n\t\t\tif (oldVNode._component) {\r\n\t\t\t\tc = newVNode._component = oldVNode._component;\r\n\t\t\t\tclearProcessingException = c._processingException = c._pendingError;\r\n\t\t\t} else {\r\n\t\t\t\t// Instantiate the new component\r\n\t\t\t\tif ('prototype' in newType && newType.prototype.render) {\r\n\t\t\t\t\t// @ts-ignore The check above verifies that newType is suppose to be constructed\r\n\t\t\t\t\tnewVNode._component = c = new newType(newProps, componentContext); // eslint-disable-line new-cap\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// @ts-ignore Trust me, Component implements the interface we want\r\n\t\t\t\t\tnewVNode._component = c = new Component(newProps, componentContext);\r\n\t\t\t\t\tc.constructor = newType;\r\n\t\t\t\t\tc.render = doRender;\r\n\t\t\t\t}\r\n\t\t\t\tif (provider) provider.sub(c);\r\n\r\n\t\t\t\tc.props = newProps;\r\n\t\t\t\tif (!c.state) c.state = {};\r\n\t\t\t\tc.context = componentContext;\r\n\t\t\t\tc._globalContext = globalContext;\r\n\t\t\t\tisNew = c._dirty = true;\r\n\t\t\t\tc._renderCallbacks = [];\r\n\t\t\t}\r\n\r\n\t\t\t// Invoke getDerivedStateFromProps\r\n\t\t\tif (c._nextState == null) {\r\n\t\t\t\tc._nextState = c.state;\r\n\t\t\t}\r\n\t\t\tif (newType.getDerivedStateFromProps != null) {\r\n\t\t\t\tif (c._nextState == c.state) {\r\n\t\t\t\t\tc._nextState = assign({}, c._nextState);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tassign(\r\n\t\t\t\t\tc._nextState,\r\n\t\t\t\t\tnewType.getDerivedStateFromProps(newProps, c._nextState)\r\n\t\t\t\t);\r\n\t\t\t}\r\n\r\n\t\t\toldProps = c.props;\r\n\t\t\toldState = c.state;\r\n\r\n\t\t\t// Invoke pre-render lifecycle methods\r\n\t\t\tif (isNew) {\r\n\t\t\t\tif (\r\n\t\t\t\t\tnewType.getDerivedStateFromProps == null &&\r\n\t\t\t\t\tc.componentWillMount != null\r\n\t\t\t\t) {\r\n\t\t\t\t\tc.componentWillMount();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (c.componentDidMount != null) {\r\n\t\t\t\t\tc._renderCallbacks.push(c.componentDidMount);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif (\r\n\t\t\t\t\tnewType.getDerivedStateFromProps == null &&\r\n\t\t\t\t\tnewProps !== oldProps &&\r\n\t\t\t\t\tc.componentWillReceiveProps != null\r\n\t\t\t\t) {\r\n\t\t\t\t\tc.componentWillReceiveProps(newProps, componentContext);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (\r\n\t\t\t\t\t(!c._force &&\r\n\t\t\t\t\t\tc.shouldComponentUpdate != null &&\r\n\t\t\t\t\t\tc.shouldComponentUpdate(\r\n\t\t\t\t\t\t\tnewProps,\r\n\t\t\t\t\t\t\tc._nextState,\r\n\t\t\t\t\t\t\tcomponentContext\r\n\t\t\t\t\t\t) === false) ||\r\n\t\t\t\t\tnewVNode._original === oldVNode._original\r\n\t\t\t\t) {\r\n\t\t\t\t\tc.props = newProps;\r\n\t\t\t\t\tc.state = c._nextState;\r\n\t\t\t\t\t// More info about this here: https://gist.github.com/JoviDeCroock/bec5f2ce93544d2e6070ef8e0036e4e8\r\n\t\t\t\t\tif (newVNode._original !== oldVNode._original) c._dirty = false;\r\n\t\t\t\t\tc._vnode = newVNode;\r\n\t\t\t\t\tnewVNode._dom = oldVNode._dom;\r\n\t\t\t\t\tnewVNode._children = oldVNode._children;\r\n\t\t\t\t\tnewVNode._children.forEach(vnode => {\r\n\t\t\t\t\t\tif (vnode) vnode._parent = newVNode;\r\n\t\t\t\t\t});\r\n\t\t\t\t\tif (c._renderCallbacks.length) {\r\n\t\t\t\t\t\tcommitQueue.push(c);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tbreak outer;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (c.componentWillUpdate != null) {\r\n\t\t\t\t\tc.componentWillUpdate(newProps, c._nextState, componentContext);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (c.componentDidUpdate != null) {\r\n\t\t\t\t\tc._renderCallbacks.push(() => {\r\n\t\t\t\t\t\tc.componentDidUpdate(oldProps, oldState, snapshot);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tc.context = componentContext;\r\n\t\t\tc.props = newProps;\r\n\t\t\tc.state = c._nextState;\r\n\r\n\t\t\tif ((tmp = options._render)) tmp(newVNode);\r\n\r\n\t\t\tc._dirty = false;\r\n\t\t\tc._vnode = newVNode;\r\n\t\t\tc._parentDom = parentDom;\r\n\r\n\t\t\ttmp = c.render(c.props, c.state, c.context);\r\n\r\n\t\t\t// Handle setState called in render, see #2553\r\n\t\t\tc.state = c._nextState;\r\n\r\n\t\t\tif (c.getChildContext != null) {\r\n\t\t\t\tglobalContext = assign(assign({}, globalContext), c.getChildContext());\r\n\t\t\t}\r\n\r\n\t\t\tif (!isNew && c.getSnapshotBeforeUpdate != null) {\r\n\t\t\t\tsnapshot = c.getSnapshotBeforeUpdate(oldProps, oldState);\r\n\t\t\t}\r\n\r\n\t\t\tlet isTopLevelFragment =\r\n\t\t\t\ttmp != null && tmp.type === Fragment && tmp.key == null;\r\n\t\t\tlet renderResult = isTopLevelFragment ? tmp.props.children : tmp;\r\n\r\n\t\t\tdiffChildren(\r\n\t\t\t\tparentDom,\r\n\t\t\t\tArray.isArray(renderResult) ? renderResult : [renderResult],\r\n\t\t\t\tnewVNode,\r\n\t\t\t\toldVNode,\r\n\t\t\t\tglobalContext,\r\n\t\t\t\tisSvg,\r\n\t\t\t\texcessDomChildren,\r\n\t\t\t\tcommitQueue,\r\n\t\t\t\toldDom,\r\n\t\t\t\tisHydrating\r\n\t\t\t);\r\n\r\n\t\t\tc.base = newVNode._dom;\r\n\r\n\t\t\t// We successfully rendered this VNode, unset any stored hydration/bailout state:\r\n\t\t\tnewVNode._hydrating = null;\r\n\r\n\t\t\tif (c._renderCallbacks.length) {\r\n\t\t\t\tcommitQueue.push(c);\r\n\t\t\t}\r\n\r\n\t\t\tif (clearProcessingException) {\r\n\t\t\t\tc._pendingError = c._processingException = null;\r\n\t\t\t}\r\n\r\n\t\t\tc._force = false;\r\n\t\t} else if (\r\n\t\t\texcessDomChildren == null &&\r\n\t\t\tnewVNode._original === oldVNode._original\r\n\t\t) {\r\n\t\t\tnewVNode._children = oldVNode._children;\r\n\t\t\tnewVNode._dom = oldVNode._dom;\r\n\t\t} else {\r\n\t\t\tnewVNode._dom = diffElementNodes(\r\n\t\t\t\toldVNode._dom,\r\n\t\t\t\tnewVNode,\r\n\t\t\t\toldVNode,\r\n\t\t\t\tglobalContext,\r\n\t\t\t\tisSvg,\r\n\t\t\t\texcessDomChildren,\r\n\t\t\t\tcommitQueue,\r\n\t\t\t\tisHydrating\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\tif ((tmp = options.diffed)) tmp(newVNode);\r\n\t} catch (e) {\r\n\t\tnewVNode._original = null;\r\n\t\t// if hydrating or creating initial tree, bailout preserves DOM:\r\n\t\tif (isHydrating || excessDomChildren != null) {\r\n\t\t\tnewVNode._dom = oldDom;\r\n\t\t\tnewVNode._hydrating = !!isHydrating;\r\n\t\t\texcessDomChildren[excessDomChildren.indexOf(oldDom)] = null;\r\n\t\t\t// ^ could possibly be simplified to:\r\n\t\t\t// excessDomChildren.length = 0;\r\n\t\t}\r\n\t\toptions._catchError(e, newVNode, oldVNode);\r\n\t}\r\n}\r\n\r\n/**\r\n * @param {Array} commitQueue List of components\r\n * which have callbacks to invoke in commitRoot\r\n * @param {import('../internal').VNode} root\r\n */\r\nexport function commitRoot(commitQueue, root) {\r\n\tif (options._commit) options._commit(root, commitQueue);\r\n\r\n\tcommitQueue.some(c => {\r\n\t\ttry {\r\n\t\t\t// @ts-ignore Reuse the commitQueue variable here so the type changes\r\n\t\t\tcommitQueue = c._renderCallbacks;\r\n\t\t\tc._renderCallbacks = [];\r\n\t\t\tcommitQueue.some(cb => {\r\n\t\t\t\t// @ts-ignore See above ts-ignore on commitQueue\r\n\t\t\t\tcb.call(c);\r\n\t\t\t});\r\n\t\t} catch (e) {\r\n\t\t\toptions._catchError(e, c._vnode);\r\n\t\t}\r\n\t});\r\n}\r\n\r\n/**\r\n * Diff two virtual nodes representing DOM element\r\n * @param {import('../internal').PreactElement} dom The DOM element representing\r\n * the virtual nodes being diffed\r\n * @param {import('../internal').VNode} newVNode The new virtual node\r\n * @param {import('../internal').VNode} oldVNode The old virtual node\r\n * @param {object} globalContext The current context object\r\n * @param {boolean} isSvg Whether or not this DOM node is an SVG node\r\n * @param {*} excessDomChildren\r\n * @param {Array} commitQueue List of components\r\n * which have callbacks to invoke in commitRoot\r\n * @param {boolean} isHydrating Whether or not we are in hydration\r\n * @returns {import('../internal').PreactElement}\r\n */\r\nfunction diffElementNodes(\r\n\tdom,\r\n\tnewVNode,\r\n\toldVNode,\r\n\tglobalContext,\r\n\tisSvg,\r\n\texcessDomChildren,\r\n\tcommitQueue,\r\n\tisHydrating\r\n) {\r\n\tlet oldProps = oldVNode.props;\r\n\tlet newProps = newVNode.props;\r\n\tlet nodeType = newVNode.type;\r\n\tlet i = 0;\r\n\r\n\t// Tracks entering and exiting SVG namespace when descending through the tree.\r\n\tif (nodeType === 'svg') isSvg = true;\r\n\r\n\tif (excessDomChildren != null) {\r\n\t\tfor (; i < excessDomChildren.length; i++) {\r\n\t\t\tconst child = excessDomChildren[i];\r\n\r\n\t\t\t// if newVNode matches an element in excessDomChildren or the `dom`\r\n\t\t\t// argument matches an element in excessDomChildren, remove it from\r\n\t\t\t// excessDomChildren so it isn't later removed in diffChildren\r\n\t\t\tif (\r\n\t\t\t\tchild &&\r\n\t\t\t\t'setAttribute' in child === !!nodeType &&\r\n\t\t\t\t(nodeType ? child.localName === nodeType : child.nodeType === 3)\r\n\t\t\t) {\r\n\t\t\t\tdom = child;\r\n\t\t\t\texcessDomChildren[i] = null;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tif (dom == null) {\r\n\t\tif (nodeType === null) {\r\n\t\t\t// @ts-ignore createTextNode returns Text, we expect PreactElement\r\n\t\t\treturn document.createTextNode(newProps);\r\n\t\t}\r\n\r\n\t\tif (isSvg) {\r\n\t\t\tdom = document.createElementNS(\r\n\t\t\t\t'http://www.w3.org/2000/svg',\r\n\t\t\t\t// @ts-ignore We know `newVNode.type` is a string\r\n\t\t\t\tnodeType\r\n\t\t\t);\r\n\t\t} else {\r\n\t\t\tdom = document.createElement(\r\n\t\t\t\t// @ts-ignore We know `newVNode.type` is a string\r\n\t\t\t\tnodeType,\r\n\t\t\t\tnewProps.is && newProps\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\t// we created a new parent, so none of the previously attached children can be reused:\r\n\t\texcessDomChildren = null;\r\n\t\t// we are creating a new node, so we can assume this is a new subtree (in case we are hydrating), this deopts the hydrate\r\n\t\tisHydrating = false;\r\n\t}\r\n\r\n\tif (nodeType === null) {\r\n\t\t// During hydration, we still have to split merged text from SSR'd HTML.\r\n\t\tif (oldProps !== newProps && (!isHydrating || dom.data !== newProps)) {\r\n\t\t\tdom.data = newProps;\r\n\t\t}\r\n\t} else {\r\n\t\t// If excessDomChildren was not null, repopulate it with the current element's children:\r\n\t\texcessDomChildren = excessDomChildren && slice.call(dom.childNodes);\r\n\r\n\t\toldProps = oldVNode.props || EMPTY_OBJ;\r\n\r\n\t\tlet oldHtml = oldProps.dangerouslySetInnerHTML;\r\n\t\tlet newHtml = newProps.dangerouslySetInnerHTML;\r\n\r\n\t\t// During hydration, props are not diffed at all (including dangerouslySetInnerHTML)\r\n\t\t// @TODO we should warn in debug mode when props don't match here.\r\n\t\tif (!isHydrating) {\r\n\t\t\t// But, if we are in a situation where we are using existing DOM (e.g. replaceNode)\r\n\t\t\t// we should read the existing DOM attributes to diff them\r\n\t\t\tif (excessDomChildren != null) {\r\n\t\t\t\toldProps = {};\r\n\t\t\t\tfor (i = 0; i < dom.attributes.length; i++) {\r\n\t\t\t\t\toldProps[dom.attributes[i].name] = dom.attributes[i].value;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (newHtml || oldHtml) {\r\n\t\t\t\t// Avoid re-applying the same '__html' if it did not changed between re-render\r\n\t\t\t\tif (\r\n\t\t\t\t\t!newHtml ||\r\n\t\t\t\t\t((!oldHtml || newHtml.__html != oldHtml.__html) &&\r\n\t\t\t\t\t\tnewHtml.__html !== dom.innerHTML)\r\n\t\t\t\t) {\r\n\t\t\t\t\tdom.innerHTML = (newHtml && newHtml.__html) || '';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tdiffProps(dom, newProps, oldProps, isSvg, isHydrating);\r\n\r\n\t\t// If the new vnode didn't have dangerouslySetInnerHTML, diff its children\r\n\t\tif (newHtml) {\r\n\t\t\tnewVNode._children = [];\r\n\t\t} else {\r\n\t\t\ti = newVNode.props.children;\r\n\t\t\tdiffChildren(\r\n\t\t\t\tdom,\r\n\t\t\t\tArray.isArray(i) ? i : [i],\r\n\t\t\t\tnewVNode,\r\n\t\t\t\toldVNode,\r\n\t\t\t\tglobalContext,\r\n\t\t\t\tisSvg && nodeType !== 'foreignObject',\r\n\t\t\t\texcessDomChildren,\r\n\t\t\t\tcommitQueue,\r\n\t\t\t\texcessDomChildren\r\n\t\t\t\t\t? excessDomChildren[0]\r\n\t\t\t\t\t: oldVNode._children && getDomSibling(oldVNode, 0),\r\n\t\t\t\tisHydrating\r\n\t\t\t);\r\n\r\n\t\t\t// Remove children that are not part of any vnode.\r\n\t\t\tif (excessDomChildren != null) {\r\n\t\t\t\tfor (i = excessDomChildren.length; i--; ) {\r\n\t\t\t\t\tif (excessDomChildren[i] != null) removeNode(excessDomChildren[i]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// (as above, don't diff props during hydration)\r\n\t\tif (!isHydrating) {\r\n\t\t\tif (\r\n\t\t\t\t'value' in newProps &&\r\n\t\t\t\t(i = newProps.value) !== undefined &&\r\n\t\t\t\t// #2756 For the -element the initial value is 0,\r\n\t\t\t\t// despite the attribute not being present. When the attribute\r\n\t\t\t\t// is missing the progress bar is treated as indeterminate.\r\n\t\t\t\t// To fix that we'll always update it when it is 0 for progress elements\r\n\t\t\t\t(i !== oldProps.value ||\r\n\t\t\t\t\ti !== dom.value ||\r\n\t\t\t\t\t(nodeType === 'progress' && !i))\r\n\t\t\t) {\r\n\t\t\t\tsetProperty(dom, 'value', i, oldProps.value, false);\r\n\t\t\t}\r\n\t\t\tif (\r\n\t\t\t\t'checked' in newProps &&\r\n\t\t\t\t(i = newProps.checked) !== undefined &&\r\n\t\t\t\ti !== dom.checked\r\n\t\t\t) {\r\n\t\t\t\tsetProperty(dom, 'checked', i, oldProps.checked, false);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn dom;\r\n}\r\n\r\n/**\r\n * Invoke or update a ref, depending on whether it is a function or object ref.\r\n * @param {object|function} ref\r\n * @param {any} value\r\n * @param {import('../internal').VNode} vnode\r\n */\r\nexport function applyRef(ref, value, vnode) {\r\n\ttry {\r\n\t\tif (typeof ref == 'function') ref(value);\r\n\t\telse ref.current = value;\r\n\t} catch (e) {\r\n\t\toptions._catchError(e, vnode);\r\n\t}\r\n}\r\n\r\n/**\r\n * Unmount a virtual node from the tree and apply DOM changes\r\n * @param {import('../internal').VNode} vnode The virtual node to unmount\r\n * @param {import('../internal').VNode} parentVNode The parent of the VNode that\r\n * initiated the unmount\r\n * @param {boolean} [skipRemove] Flag that indicates that a parent node of the\r\n * current element is already detached from the DOM.\r\n */\r\nexport function unmount(vnode, parentVNode, skipRemove) {\r\n\tlet r;\r\n\tif (options.unmount) options.unmount(vnode);\r\n\r\n\tif ((r = vnode.ref)) {\r\n\t\tif (!r.current || r.current === vnode._dom) applyRef(r, null, parentVNode);\r\n\t}\r\n\r\n\tif ((r = vnode._component) != null) {\r\n\t\tif (r.componentWillUnmount) {\r\n\t\t\ttry {\r\n\t\t\t\tr.componentWillUnmount();\r\n\t\t\t} catch (e) {\r\n\t\t\t\toptions._catchError(e, parentVNode);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tr.base = r._parentDom = null;\r\n\t}\r\n\r\n\tif ((r = vnode._children)) {\r\n\t\tfor (let i = 0; i < r.length; i++) {\r\n\t\t\tif (r[i]) {\r\n\t\t\t\tunmount(r[i], parentVNode, typeof vnode.type != 'function');\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tif (!skipRemove && vnode._dom != null) removeNode(vnode._dom);\r\n\r\n\t// Must be set to `undefined` to properly clean up `_nextDom`\r\n\t// for which `null` is a valid value. See comment in `create-element.js`\r\n\tvnode._dom = vnode._nextDom = undefined;\r\n}\r\n\r\n/** The `.render()` method for a PFC backing instance. */\r\nfunction doRender(props, state, context) {\r\n\treturn this.constructor(props, context);\r\n}\r\n","import { EMPTY_OBJ } from './constants';\r\nimport { commitRoot, diff } from './diff/index';\r\nimport { createElement, Fragment } from './create-element';\r\nimport options from './options';\r\nimport { slice } from './util';\r\n\r\n/**\r\n * Render a Preact virtual node into a DOM element\r\n * @param {import('./internal').ComponentChild} vnode The virtual node to render\r\n * @param {import('./internal').PreactElement} parentDom The DOM element to\r\n * render into\r\n * @param {import('./internal').PreactElement | object} [replaceNode] Optional: Attempt to re-use an\r\n * existing DOM tree rooted at `replaceNode`\r\n */\r\nexport function render(vnode, parentDom, replaceNode) {\r\n\tif (options._root) options._root(vnode, parentDom);\r\n\r\n\t// We abuse the `replaceNode` parameter in `hydrate()` to signal if we are in\r\n\t// hydration mode or not by passing the `hydrate` function instead of a DOM\r\n\t// element..\r\n\tlet isHydrating = typeof replaceNode === 'function';\r\n\r\n\t// To be able to support calling `render()` multiple times on the same\r\n\t// DOM node, we need to obtain a reference to the previous tree. We do\r\n\t// this by assigning a new `_children` property to DOM nodes which points\r\n\t// to the last rendered tree. By default this property is not present, which\r\n\t// means that we are mounting a new tree for the first time.\r\n\tlet oldVNode = isHydrating\r\n\t\t? null\r\n\t\t: (replaceNode && replaceNode._children) || parentDom._children;\r\n\r\n\tvnode = (\r\n\t\t(!isHydrating && replaceNode) ||\r\n\t\tparentDom\r\n\t)._children = createElement(Fragment, null, [vnode]);\r\n\r\n\t// List of effects that need to be called after diffing.\r\n\tlet commitQueue = [];\r\n\tdiff(\r\n\t\tparentDom,\r\n\t\t// Determine the new vnode tree and store it on the DOM element on\r\n\t\t// our custom `_children` property.\r\n\t\tvnode,\r\n\t\toldVNode || EMPTY_OBJ,\r\n\t\tEMPTY_OBJ,\r\n\t\tparentDom.ownerSVGElement !== undefined,\r\n\t\t!isHydrating && replaceNode\r\n\t\t\t? [replaceNode]\r\n\t\t\t: oldVNode\r\n\t\t\t? null\r\n\t\t\t: parentDom.firstChild\r\n\t\t\t? slice.call(parentDom.childNodes)\r\n\t\t\t: null,\r\n\t\tcommitQueue,\r\n\t\t!isHydrating && replaceNode\r\n\t\t\t? replaceNode\r\n\t\t\t: oldVNode\r\n\t\t\t? oldVNode._dom\r\n\t\t\t: parentDom.firstChild,\r\n\t\tisHydrating\r\n\t);\r\n\r\n\t// Flush all queued effects\r\n\tcommitRoot(commitQueue, vnode);\r\n}\r\n\r\n/**\r\n * Update an existing DOM element with data from a Preact virtual node\r\n * @param {import('./internal').ComponentChild} vnode The virtual node to render\r\n * @param {import('./internal').PreactElement} parentDom The DOM element to\r\n * update\r\n */\r\nexport function hydrate(vnode, parentDom) {\r\n\trender(vnode, parentDom, hydrate);\r\n}\r\n","export const EMPTY_OBJ = {};\r\nexport const EMPTY_ARR = [];\r\nexport const IS_NON_DIMENSIONAL = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;\r\n","import { _catchError } from './diff/catch-error';\r\n\r\n/**\r\n * The `option` object can potentially contain callback functions\r\n * that are called during various stages of our renderer. This is the\r\n * foundation on which all our addons like `preact/debug`, `preact/compat`,\r\n * and `preact/hooks` are based on. See the `Options` type in `internal.d.ts`\r\n * for a full list of available option hooks (most editors/IDEs allow you to\r\n * ctrl+click or cmd+click on mac the type definition below).\r\n * @type {import('./internal').Options}\r\n */\r\nconst options = {\r\n\t_catchError\r\n};\r\n\r\nexport default options;\r\n","/**\r\n * Find the closest error boundary to a thrown error and call it\r\n * @param {object} error The thrown value\r\n * @param {import('../internal').VNode} vnode The vnode that threw\r\n * the error that was caught (except for unmounting when this parameter\r\n * is the highest parent that was being unmounted)\r\n */\r\nexport function _catchError(error, vnode) {\r\n\t/** @type {import('../internal').Component} */\r\n\tlet component, ctor, handled;\r\n\r\n\tfor (; (vnode = vnode._parent); ) {\r\n\t\tif ((component = vnode._component) && !component._processingException) {\r\n\t\t\ttry {\r\n\t\t\t\tctor = component.constructor;\r\n\r\n\t\t\t\tif (ctor && ctor.getDerivedStateFromError != null) {\r\n\t\t\t\t\tcomponent.setState(ctor.getDerivedStateFromError(error));\r\n\t\t\t\t\thandled = component._dirty;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (component.componentDidCatch != null) {\r\n\t\t\t\t\tcomponent.componentDidCatch(error);\r\n\t\t\t\t\thandled = component._dirty;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// This is an error boundary. Mark it as having bailed out, and whether it was mid-hydration.\r\n\t\t\t\tif (handled) {\r\n\t\t\t\t\treturn (component._pendingError = component);\r\n\t\t\t\t}\r\n\t\t\t} catch (e) {\r\n\t\t\t\terror = e;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tthrow error;\r\n}\r\n","/* global __webpack_public_path__ */\n\nimport * as Preact from 'preact';\nconst { h, render, hydrate } = Preact;\n\nconst interopDefault = m => (m && m.default ? m.default : m);\n\nconst normalizeURL = url => (url[url.length - 1] === '/' ? url : url + '/');\n\nif (process.env.NODE_ENV === 'development') {\n\t// enable preact devtools\n\trequire('preact/debug');\n\n\t// only add a debug sw if webpack service worker is not requested.\n\tif (process.env.ADD_SW === undefined && 'serviceWorker' in navigator) {\n\t\t// eslint-disable-next-line no-undef\n\t\tnavigator.serviceWorker.register(__webpack_public_path__ + 'sw-debug.js');\n\t} else if (process.env.ADD_SW && 'serviceWorker' in navigator) {\n\t\t// eslint-disable-next-line no-undef\n\t\tnavigator.serviceWorker.register(\n\t\t\t__webpack_public_path__ + (process.env.ES_BUILD ? 'sw-esm.js' : 'sw.js')\n\t\t);\n\t}\n} else if (process.env.ADD_SW && 'serviceWorker' in navigator) {\n\t// eslint-disable-next-line no-undef\n\tnavigator.serviceWorker.register(\n\t\t__webpack_public_path__ + (process.env.ES_BUILD ? 'sw-esm.js' : 'sw.js')\n\t);\n}\n\nlet app = interopDefault(require('preact-cli-entrypoint'));\n\nif (typeof app === 'function') {\n\tlet root =\n\t\tdocument.getElementById('preact_root') || document.body.firstElementChild;\n\n\tlet init = () => {\n\t\tlet app = interopDefault(require('preact-cli-entrypoint'));\n\t\tlet preRenderData = {};\n\t\tconst inlineDataElement = document.querySelector(\n\t\t\t'[type=\"__PREACT_CLI_DATA__\"]'\n\t\t);\n\t\tif (inlineDataElement) {\n\t\t\tpreRenderData =\n\t\t\t\tJSON.parse(decodeURI(inlineDataElement.innerHTML)).preRenderData ||\n\t\t\t\tpreRenderData;\n\t\t}\n\t\t/* An object named CLI_DATA is passed as a prop,\n\t\t * this keeps us future proof if in case we decide,\n\t\t * to send other data like at some point in time.\n\t\t */\n\t\tconst CLI_DATA = { preRenderData };\n\t\tconst currentURL = preRenderData.url ? normalizeURL(preRenderData.url) : '';\n\t\tconst canHydrate =\n\t\t\tprocess.env.PRERENDER &&\n\t\t\tprocess.env.NODE_ENV === 'production' &&\n\t\t\thydrate &&\n\t\t\tcurrentURL === normalizeURL(location.pathname);\n\t\tconst doRender = canHydrate ? hydrate : render;\n\t\troot = doRender(h(app, { CLI_DATA }), document.body, root);\n\t};\n\n\tif (module.hot) module.hot.accept('preact-cli-entrypoint', init);\n\n\tinit();\n}\n","import { options } from 'preact';\r\n\r\n/** @type {number} */\r\nlet currentIndex;\r\n\r\n/** @type {import('./internal').Component} */\r\nlet currentComponent;\r\n\r\n/** @type {number} */\r\nlet currentHook = 0;\r\n\r\n/** @type {Array} */\r\nlet afterPaintEffects = [];\r\n\r\nlet oldBeforeDiff = options._diff;\r\nlet oldBeforeRender = options._render;\r\nlet oldAfterDiff = options.diffed;\r\nlet oldCommit = options._commit;\r\nlet oldBeforeUnmount = options.unmount;\r\n\r\nconst RAF_TIMEOUT = 100;\r\nlet prevRaf;\r\n\r\noptions._diff = vnode => {\r\n\tcurrentComponent = null;\r\n\tif (oldBeforeDiff) oldBeforeDiff(vnode);\r\n};\r\n\r\noptions._render = vnode => {\r\n\tif (oldBeforeRender) oldBeforeRender(vnode);\r\n\r\n\tcurrentComponent = vnode._component;\r\n\tcurrentIndex = 0;\r\n\r\n\tconst hooks = currentComponent.__hooks;\r\n\tif (hooks) {\r\n\t\thooks._pendingEffects.forEach(invokeCleanup);\r\n\t\thooks._pendingEffects.forEach(invokeEffect);\r\n\t\thooks._pendingEffects = [];\r\n\t}\r\n};\r\n\r\noptions.diffed = vnode => {\r\n\tif (oldAfterDiff) oldAfterDiff(vnode);\r\n\r\n\tconst c = vnode._component;\r\n\tif (c && c.__hooks && c.__hooks._pendingEffects.length) {\r\n\t\tafterPaint(afterPaintEffects.push(c));\r\n\t}\r\n\tcurrentComponent = null;\r\n};\r\n\r\noptions._commit = (vnode, commitQueue) => {\r\n\tcommitQueue.some(component => {\r\n\t\ttry {\r\n\t\t\tcomponent._renderCallbacks.forEach(invokeCleanup);\r\n\t\t\tcomponent._renderCallbacks = component._renderCallbacks.filter(cb =>\r\n\t\t\t\tcb._value ? invokeEffect(cb) : true\r\n\t\t\t);\r\n\t\t} catch (e) {\r\n\t\t\tcommitQueue.some(c => {\r\n\t\t\t\tif (c._renderCallbacks) c._renderCallbacks = [];\r\n\t\t\t});\r\n\t\t\tcommitQueue = [];\r\n\t\t\toptions._catchError(e, component._vnode);\r\n\t\t}\r\n\t});\r\n\r\n\tif (oldCommit) oldCommit(vnode, commitQueue);\r\n};\r\n\r\noptions.unmount = vnode => {\r\n\tif (oldBeforeUnmount) oldBeforeUnmount(vnode);\r\n\r\n\tconst c = vnode._component;\r\n\tif (c && c.__hooks) {\r\n\t\tlet hasErrored;\r\n\t\tc.__hooks._list.forEach(s => {\r\n\t\t\ttry {\r\n\t\t\t\tinvokeCleanup(s);\r\n\t\t\t} catch (e) {\r\n\t\t\t\thasErrored = e;\r\n\t\t\t}\r\n\t\t});\r\n\t\tif (hasErrored) options._catchError(hasErrored, c._vnode);\r\n\t}\r\n};\r\n\r\n/**\r\n * Get a hook's state from the currentComponent\r\n * @param {number} index The index of the hook to get\r\n * @param {number} type The index of the hook to get\r\n * @returns {any}\r\n */\r\nfunction getHookState(index, type) {\r\n\tif (options._hook) {\r\n\t\toptions._hook(currentComponent, index, currentHook || type);\r\n\t}\r\n\tcurrentHook = 0;\r\n\r\n\t// Largely inspired by:\r\n\t// * https://github.com/michael-klein/funcy.js/blob/f6be73468e6ec46b0ff5aa3cc4c9baf72a29025a/src/hooks/core_hooks.mjs\r\n\t// * https://github.com/michael-klein/funcy.js/blob/650beaa58c43c33a74820a3c98b3c7079cf2e333/src/renderer.mjs\r\n\t// Other implementations to look at:\r\n\t// * https://codesandbox.io/s/mnox05qp8\r\n\tconst hooks =\r\n\t\tcurrentComponent.__hooks ||\r\n\t\t(currentComponent.__hooks = {\r\n\t\t\t_list: [],\r\n\t\t\t_pendingEffects: []\r\n\t\t});\r\n\r\n\tif (index >= hooks._list.length) {\r\n\t\thooks._list.push({});\r\n\t}\r\n\treturn hooks._list[index];\r\n}\r\n\r\n/**\r\n * @param {import('./index').StateUpdater} [initialState]\r\n */\r\nexport function useState(initialState) {\r\n\tcurrentHook = 1;\r\n\treturn useReducer(invokeOrReturn, initialState);\r\n}\r\n\r\n/**\r\n * @param {import('./index').Reducer} reducer\r\n * @param {import('./index').StateUpdater} initialState\r\n * @param {(initialState: any) => void} [init]\r\n * @returns {[ any, (state: any) => void ]}\r\n */\r\nexport function useReducer(reducer, initialState, init) {\r\n\t/** @type {import('./internal').ReducerHookState} */\r\n\tconst hookState = getHookState(currentIndex++, 2);\r\n\thookState._reducer = reducer;\r\n\tif (!hookState._component) {\r\n\t\thookState._value = [\r\n\t\t\t!init ? invokeOrReturn(undefined, initialState) : init(initialState),\r\n\r\n\t\t\taction => {\r\n\t\t\t\tconst nextValue = hookState._reducer(hookState._value[0], action);\r\n\t\t\t\tif (hookState._value[0] !== nextValue) {\r\n\t\t\t\t\thookState._value = [nextValue, hookState._value[1]];\r\n\t\t\t\t\thookState._component.setState({});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t];\r\n\r\n\t\thookState._component = currentComponent;\r\n\t}\r\n\r\n\treturn hookState._value;\r\n}\r\n\r\n/**\r\n * @param {import('./internal').Effect} callback\r\n * @param {any[]} args\r\n */\r\nexport function useEffect(callback, args) {\r\n\t/** @type {import('./internal').EffectHookState} */\r\n\tconst state = getHookState(currentIndex++, 3);\r\n\tif (!options._skipEffects && argsChanged(state._args, args)) {\r\n\t\tstate._value = callback;\r\n\t\tstate._args = args;\r\n\r\n\t\tcurrentComponent.__hooks._pendingEffects.push(state);\r\n\t}\r\n}\r\n\r\n/**\r\n * @param {import('./internal').Effect} callback\r\n * @param {any[]} args\r\n */\r\nexport function useLayoutEffect(callback, args) {\r\n\t/** @type {import('./internal').EffectHookState} */\r\n\tconst state = getHookState(currentIndex++, 4);\r\n\tif (!options._skipEffects && argsChanged(state._args, args)) {\r\n\t\tstate._value = callback;\r\n\t\tstate._args = args;\r\n\r\n\t\tcurrentComponent._renderCallbacks.push(state);\r\n\t}\r\n}\r\n\r\nexport function useRef(initialValue) {\r\n\tcurrentHook = 5;\r\n\treturn useMemo(() => ({ current: initialValue }), []);\r\n}\r\n\r\n/**\r\n * @param {object} ref\r\n * @param {() => object} createHandle\r\n * @param {any[]} args\r\n */\r\nexport function useImperativeHandle(ref, createHandle, args) {\r\n\tcurrentHook = 6;\r\n\tuseLayoutEffect(\r\n\t\t() => {\r\n\t\t\tif (typeof ref == 'function') ref(createHandle());\r\n\t\t\telse if (ref) ref.current = createHandle();\r\n\t\t},\r\n\t\targs == null ? args : args.concat(ref)\r\n\t);\r\n}\r\n\r\n/**\r\n * @param {() => any} factory\r\n * @param {any[]} args\r\n */\r\nexport function useMemo(factory, args) {\r\n\t/** @type {import('./internal').MemoHookState} */\r\n\tconst state = getHookState(currentIndex++, 7);\r\n\tif (argsChanged(state._args, args)) {\r\n\t\tstate._value = factory();\r\n\t\tstate._args = args;\r\n\t\tstate._factory = factory;\r\n\t}\r\n\r\n\treturn state._value;\r\n}\r\n\r\n/**\r\n * @param {() => void} callback\r\n * @param {any[]} args\r\n */\r\nexport function useCallback(callback, args) {\r\n\tcurrentHook = 8;\r\n\treturn useMemo(() => callback, args);\r\n}\r\n\r\n/**\r\n * @param {import('./internal').PreactContext} context\r\n */\r\nexport function useContext(context) {\r\n\tconst provider = currentComponent.context[context._id];\r\n\t// We could skip this call here, but than we'd not call\r\n\t// `options._hook`. We need to do that in order to make\r\n\t// the devtools aware of this hook.\r\n\t/** @type {import('./internal').ContextHookState} */\r\n\tconst state = getHookState(currentIndex++, 9);\r\n\t// The devtools needs access to the context object to\r\n\t// be able to pull of the default value when no provider\r\n\t// is present in the tree.\r\n\tstate._context = context;\r\n\tif (!provider) return context._defaultValue;\r\n\t// This is probably not safe to convert to \"!\"\r\n\tif (state._value == null) {\r\n\t\tstate._value = true;\r\n\t\tprovider.sub(currentComponent);\r\n\t}\r\n\treturn provider.props.value;\r\n}\r\n\r\n/**\r\n * Display a custom label for a custom hook for the devtools panel\r\n * @type {(value: T, cb?: (value: T) => string | number) => void}\r\n */\r\nexport function useDebugValue(value, formatter) {\r\n\tif (options.useDebugValue) {\r\n\t\toptions.useDebugValue(formatter ? formatter(value) : value);\r\n\t}\r\n}\r\n\r\n/**\r\n * @param {(error: any) => void} cb\r\n */\r\nexport function useErrorBoundary(cb) {\r\n\t/** @type {import('./internal').ErrorBoundaryHookState} */\r\n\tconst state = getHookState(currentIndex++, 10);\r\n\tconst errState = useState();\r\n\tstate._value = cb;\r\n\tif (!currentComponent.componentDidCatch) {\r\n\t\tcurrentComponent.componentDidCatch = err => {\r\n\t\t\tif (state._value) state._value(err);\r\n\t\t\terrState[1](err);\r\n\t\t};\r\n\t}\r\n\treturn [\r\n\t\terrState[0],\r\n\t\t() => {\r\n\t\t\terrState[1](undefined);\r\n\t\t}\r\n\t];\r\n}\r\n\r\n/**\r\n * After paint effects consumer.\r\n */\r\nfunction flushAfterPaintEffects() {\r\n\tlet component;\r\n\t// sort the queue by depth (outermost to innermost)\r\n\tafterPaintEffects.sort((a, b) => a._vnode._depth - b._vnode._depth);\r\n\twhile (component = afterPaintEffects.pop()) {\r\n\t\tif (!component._parentDom) continue;\r\n\t\ttry {\r\n\t\t\tcomponent.__hooks._pendingEffects.forEach(invokeCleanup);\r\n\t\t\tcomponent.__hooks._pendingEffects.forEach(invokeEffect);\r\n\t\t\tcomponent.__hooks._pendingEffects = [];\r\n\t\t} catch (e) {\r\n\t\t\tcomponent.__hooks._pendingEffects = [];\r\n\t\t\toptions._catchError(e, component._vnode);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nlet HAS_RAF = typeof requestAnimationFrame == 'function';\r\n\r\n/**\r\n * Schedule a callback to be invoked after the browser has a chance to paint a new frame.\r\n * Do this by combining requestAnimationFrame (rAF) + setTimeout to invoke a callback after\r\n * the next browser frame.\r\n *\r\n * Also, schedule a timeout in parallel to the the rAF to ensure the callback is invoked\r\n * even if RAF doesn't fire (for example if the browser tab is not visible)\r\n *\r\n * @param {() => void} callback\r\n */\r\nfunction afterNextFrame(callback) {\r\n\tconst done = () => {\r\n\t\tclearTimeout(timeout);\r\n\t\tif (HAS_RAF) cancelAnimationFrame(raf);\r\n\t\tsetTimeout(callback);\r\n\t};\r\n\tconst timeout = setTimeout(done, RAF_TIMEOUT);\r\n\r\n\tlet raf;\r\n\tif (HAS_RAF) {\r\n\t\traf = requestAnimationFrame(done);\r\n\t}\r\n}\r\n\r\n// Note: if someone used options.debounceRendering = requestAnimationFrame,\r\n// then effects will ALWAYS run on the NEXT frame instead of the current one, incurring a ~16ms delay.\r\n// Perhaps this is not such a big deal.\r\n/**\r\n * Schedule afterPaintEffects flush after the browser paints\r\n * @param {number} newQueueLength\r\n */\r\nfunction afterPaint(newQueueLength) {\r\n\tif (newQueueLength === 1 || prevRaf !== options.requestAnimationFrame) {\r\n\t\tprevRaf = options.requestAnimationFrame;\r\n\t\t(prevRaf || afterNextFrame)(flushAfterPaintEffects);\r\n\t}\r\n}\r\n\r\n/**\r\n * @param {import('./internal').EffectHookState} hook\r\n */\r\nfunction invokeCleanup(hook) {\r\n\t// A hook cleanup can introduce a call to render which creates a new root, this will call options.vnode\r\n\t// and move the currentComponent away.\r\n\tconst comp = currentComponent;\r\n\tlet cleanup = hook._cleanup;\r\n\tif (typeof cleanup == 'function') {\r\n\t\thook._cleanup = undefined;\r\n\t\tcleanup();\r\n\t}\r\n\tcurrentComponent = comp;\r\n}\r\n\r\n/**\r\n * Invoke a Hook's effect\r\n * @param {import('./internal').EffectHookState} hook\r\n */\r\nfunction invokeEffect(hook) {\r\n\t// A hook call can introduce a call to render which creates a new root, this will call options.vnode\r\n\t// and move the currentComponent away.\r\n\tconst comp = currentComponent;\r\n\thook._cleanup = hook._value();\r\n\tcurrentComponent = comp;\r\n}\r\n\r\n/**\r\n * @param {any[]} oldArgs\r\n * @param {any[]} newArgs\r\n */\r\nfunction argsChanged(oldArgs, newArgs) {\r\n\treturn (\r\n\t\t!oldArgs ||\r\n\t\toldArgs.length !== newArgs.length ||\r\n\t\tnewArgs.some((arg, index) => arg !== oldArgs[index])\r\n\t);\r\n}\r\n\r\nfunction invokeOrReturn(arg, f) {\r\n\treturn typeof f == 'function' ? f(arg) : f;\r\n}\r\n","import { h } from 'preact';\r\nimport { useCallback, useEffect, useRef, useState } from 'preact/hooks';\r\nimport { IFrame } from './iframe';\r\nimport { Overlay } from './Overlay';\r\nimport { TokenInfo } from './shared';\r\n\r\nexport interface OverlayContainerProps {\r\n // The base url of the script.\r\n baseUrl: string | null | undefined;\r\n}\r\n\r\ntype AuthState = 'Authenticated' | 'Failed' | 'Pending';\r\n\r\nconst UNSET = { x: Number.NEGATIVE_INFINITY, y: Number.NEGATIVE_INFINITY };\r\n\r\nexport const OverlayContainer = (props: OverlayContainerProps) => {\r\n const div = useRef();\r\n const [auth, setAuth] = useState<{ [url: string]: AuthState }>({});\r\n const [target, setTarget] = useState<{ target: HTMLElement, token: TokenInfo }>();\r\n const [targetUrl, setTargetUrl] = useState();\r\n const authRef = useRef(auth);\r\n \r\n useEffect(() => {\r\n let previousElement: any;\r\n let previousTarget: HTMLElement | undefined = undefined;\r\n let previousPosition = UNSET;\r\n\r\n const updateTarget = (target?: HTMLElement, token?: TokenInfo) => {\r\n if (target !== previousTarget) {\r\n if (target && token) {\r\n setTarget({ target, token });\r\n } else {\r\n setTarget(undefined);\r\n }\r\n\r\n previousTarget = target;\r\n }\r\n };\r\n\r\n function listen(event: MouseEvent) {\r\n const element = event.target as HTMLElement;\r\n\r\n console.log(element);\r\n\r\n if (!element || isToolbar(element)) {\r\n return;\r\n }\r\n\r\n const { token, target } = parseTokenInPath(element, Object.keys(authRef.current));\r\n const position = { x: event.clientX, y: event.clientY };\r\n\r\n if (token && target) { \r\n updateTarget(target, token);\r\n\r\n previousPosition = position;\r\n } else if (Math.abs(position.x - previousPosition.x) + Math.abs(position.y - previousPosition.y) > 20) {\r\n updateTarget(undefined, undefined);\r\n }\r\n\r\n previousElement = element;\r\n }\r\n\r\n document.addEventListener('mousemove', listen);\r\n\r\n return () => {\r\n document.removeEventListener('mousemove', listen);\r\n }\r\n }, []);\r\n\r\n const checkAuth = useCallback((url: string | null | undefined) => {\r\n if (!url) {\r\n return;\r\n }\r\n\r\n if (authRef.current[url]) {\r\n return;\r\n }\r\n\r\n const updateAuth = (state: AuthState) => {\r\n const newAuth = {\r\n ...authRef.current,\r\n [url]: state\r\n };\r\n\r\n authRef.current = newAuth;\r\n\r\n setAuth(newAuth);\r\n };\r\n\r\n if (url.indexOf('http://') === 0) {\r\n updateAuth('Authenticated');\r\n return;\r\n }\r\n\r\n const fetchStatus = async () => {\r\n updateAuth('Pending');\r\n\r\n try {\r\n const response = await fetch(`${url}/identity-server/info`, {\r\n credentials: 'include'\r\n });\r\n\r\n const json = await response.json();\r\n\r\n updateAuth(json.displayName ? 'Authenticated' : 'Failed');\r\n } catch {\r\n updateAuth('Failed');\r\n }\r\n };\r\n\r\n fetchStatus();\r\n }, [auth]);\r\n\r\n useEffect(() => {\r\n checkAuth(props.baseUrl);\r\n }, [props.baseUrl]);\r\n\r\n useEffect(() => {\r\n checkAuth(target?.token.u);\r\n }, [target?.token.u]);\r\n \r\n const isAuthenticated = auth[target?.token.u!] === 'Authenticated'\r\n\r\n return (\r\n
\r\n {target && isAuthenticated &&\r\n \r\n }\r\n\r\n {targetUrl &&\r\n \r\n
\r\n );\r\n};","import { h } from 'preact';\r\nimport { useEffect, useState, useMemo, useRef, useLayoutEffect } from 'preact/hooks';\r\nimport { TokenInfo } from './shared';\r\n\r\nexport interface OverlayProps {\r\n // The target element ot attach to.\r\n target: HTMLElement;\r\n\r\n // The token string.\r\n token: TokenInfo;\r\n\r\n // When opened.\r\n onOpen: (url: string) => void;\r\n}\r\n\r\nconst PADDING = 2;\r\n\r\nexport const Overlay = (props: OverlayProps) => {\r\n const { onOpen, target, token } = props;\r\n const toolbarRef = useRef();\r\n const linksRect = useRef();\r\n const targetRect = useRef();\r\n const [_, render] = useState(0);\r\n\r\n useEffect(() => {\r\n render(x => x + 1);\r\n }, [token]);\r\n\r\n useEffect(() => {\r\n function layout() {\r\n const rect = target.getBoundingClientRect();\r\n\r\n const current = targetRect.current;\r\n\r\n if (!current ||\r\n rect.height !== current.height ||\r\n rect.width !== current.width ||\r\n rect.x !== current.x ||\r\n rect.y !== current.y) {\r\n targetRect.current = rect;\r\n render(x => x + 1);\r\n }\r\n }\r\n\r\n document.body.addEventListener('scroll', layout);\r\n\r\n const timer = setInterval(() => {\r\n layout();\r\n }, 500);\r\n\r\n layout();\r\n\r\n return () => {\r\n clearInterval(timer);\r\n\r\n document.body.removeEventListener('scroll', layout);\r\n };\r\n }, [target]);\r\n\r\n useLayoutEffect(() => {\r\n if (!toolbarRef.current) {\r\n return;\r\n }\r\n\r\n const rect = toolbarRef.current.getBoundingClientRect();\r\n\r\n const current = linksRect.current;\r\n\r\n if (!current ||\r\n rect.height !== current.height ||\r\n rect.width !== current.width) {\r\n linksRect.current = rect;\r\n render(x => x + 1);\r\n }\r\n }, [render]);\r\n\r\n const externalUrl = useMemo(() => {\r\n let { a, i, s, u } = token;\r\n\r\n if (s) {\r\n return `${u}/app/${a}/content/${s}/${i}`;\r\n } else {\r\n return `${u}/app/${a}/assets/?ref=${i}`;\r\n }\r\n }, [token]);\r\n\r\n const embedUrl = useMemo(() => {\r\n let { a, i, s, u } = token;\r\n\r\n if (s) {\r\n return `${u}/embed/app/${a}/content/${s}/${i}`;\r\n } else {\r\n return `${u}/embed/app/${a}/assets/?ref=${i}`;\r\n }\r\n }, [token]);\r\n\r\n const x = (targetRect.current?.x || 0) - PADDING;\r\n const y = (targetRect.current?.y || 0) - PADDING;\r\n\r\n const overlayWidth = (targetRect.current?.width || 0) + 2 * PADDING;\r\n const overlayHeight = (targetRect.current?.height || 0) + 2 * PADDING;\r\n\r\n const toolbarWidth = (linksRect.current?.width || 0);\r\n const toolbarHeight = (linksRect.current?.height || 0);\r\n\r\n let linkX = x;\r\n let linkY = y - toolbarHeight + 2;\r\n\r\n if (linkY < 0) {\r\n linkY = y + overlayHeight - 2;\r\n }\r\n\r\n if (linkY + toolbarHeight > window.innerHeight) {\r\n linkX = window.innerHeight - toolbarHeight;\r\n }\r\n\r\n if (linkX < 0) {\r\n linkX = 0;\r\n }\r\n\r\n if (linkX + toolbarWidth > window.innerWidth) {\r\n linkX = window.innerWidth - toolbarWidth;\r\n }\r\n\r\n return (\r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n {token?.s || 'Asset'}\r\n
\r\n\r\n \r\n
\r\n
\r\n );\r\n};","/*\r\n * Squidex Headless CMS\r\n *\r\n * @license\r\n * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved.\r\n */\r\n\r\nexport function isArray(value: any): value is any[] {\r\n return Array.isArray(value);\r\n}\r\n\r\nexport function isString(value: any): value is string {\r\n return typeof value === 'string' || value instanceof String;\r\n}\r\n\r\nexport function isUndefined(value: any): value is undefined {\r\n return typeof value === 'undefined';\r\n}\r\n\r\nexport function isBoolean(value: any): value is boolean {\r\n return typeof value === 'boolean';\r\n}\r\n\r\nexport function isFunction(value: any): value is Function {\r\n return typeof value === 'function';\r\n}\r\n\r\nexport function isNumber(value: any): value is number {\r\n return typeof value === 'number' && Number.isFinite(value);\r\n}\r\n\r\nexport function isObject(value: any): value is Object {\r\n return value && typeof value === 'object' && value.constructor === Object;\r\n}\r\n\r\nexport function getBaseUrl() {\r\n let url = (document.currentScript as any)?.['src'] as string;\r\n\r\n if (!isString(url)) {\r\n return null;\r\n }\r\n\r\n url = url.trim();\r\n\r\n let indexOfHash = url.indexOf('/', 'https://'.length);\r\n\r\n if (indexOfHash > 0) {\r\n url = url.substring(0, indexOfHash);\r\n }\r\n\r\n return url;\r\n}"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///../src/util.js","webpack:///../src/create-element.js","webpack:///../src/component.js","webpack:///../src/diff/children.js","webpack:///../src/diff/props.js","webpack:///../src/diff/index.js","webpack:///../src/render.js","webpack:///../src/constants.js","webpack:///../src/options.js","webpack:///../src/diff/catch-error.js","webpack:///../node_modules/preact-cli/lib/lib/entry.js","webpack:///../src/index.js","webpack:///./components/overlay-container.tsx","webpack:///./index.ts","webpack:///./render.tsx","webpack:///./components/iframe.tsx","webpack:///./components/Overlay.tsx","webpack:///./utils.ts"],"names":["__webpack_require__","moduleId","installedModules","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","assign","obj","props","removeNode","node","parentNode","removeChild","createElement","type","children","ref","normalizedProps","arguments","length","slice","defaultProps","createVNode","original","vnode","undefined","constructor","vnodeId","options","Fragment","Component","context","getDomSibling","childIndex","indexOf","sibling","updateParentDomPointers","child","base","enqueueRender","rerenderQueue","push","process","prevDebounce","debounceRendering","defer","queue","sort","a","b","some","component","commitQueue","oldVNode","oldDom","parentDom","diff","ownerSVGElement","commitRoot","diffChildren","renderResult","newParentVNode","oldParentVNode","globalContext","isSvg","excessDomChildren","isHydrating","j","childVNode","newDom","firstChildDom","refs","oldChildren","EMPTY_ARR","oldChildrenLength","Array","isArray","EMPTY_OBJ","reorderChildren","placeChild","unmount","applyRef","tmp","nextDom","sibDom","outer","appendChild","nextSibling","insertBefore","setStyle","style","setProperty","IS_NON_DIMENSIONAL","test","dom","oldValue","useCapture","cssText","replace","toLowerCase","_listeners","addEventListener","eventProxyCapture","eventProxy","removeEventListener","e","setAttribute","removeAttribute","event","newVNode","isNew","oldProps","oldState","snapshot","clearProcessingException","newProps","provider","componentContext","newType","contextType","render","doRender","sub","state","getDerivedStateFromProps","componentWillMount","componentDidMount","componentWillReceiveProps","shouldComponentUpdate","forEach","componentWillUpdate","componentDidUpdate","getChildContext","getSnapshotBeforeUpdate","diffElementNodes","diffed","root","cb","oldHtml","newHtml","nodeType","localName","document","createTextNode","createElementNS","is","data","childNodes","dangerouslySetInnerHTML","attributes","innerHTML","hydrate","diffProps","checked","current","parentVNode","skipRemove","componentWillUnmount","this","replaceNode","firstChild","error","ctor","handled","getDerivedStateFromError","setState","componentDidCatch","update","callback","forceUpdate","Promise","then","resolve","setTimeout","h","Preact","interopDefault","default","require","getElementById","body","firstElementChild","app","preRenderData","inlineDataElement","querySelector","JSON","parse","decodeURI","url","CLI_DATA","init","getHookState","index","currentComponent","currentHook","hooks","useState","initialState","reducer","hookState","currentIndex","_reducer","invokeOrReturn","nextValue","action","useReducer","useEffect","args","argsChanged","useLayoutEffect","useRef","initialValue","useMemo","factory","flushAfterPaintEffects","afterPaintEffects","pop","invokeCleanup","invokeEffect","hook","comp","cleanup","oldArgs","newArgs","arg","f","parseToken","target","baseUrls","getAttribute","nodeName","src","baseUrl","parts","substring","split","u","CDN_URL","decoded","atob","token","endsWith","element","styleElement","rel","href","head","renderStyles","prevRaf","oldBeforeDiff","oldBeforeRender","oldAfterDiff","oldCommit","oldBeforeUnmount","requestAnimationFrame","raf","done","clearTimeout","timeout","HAS_RAF","cancelAnimationFrame","filter","hasErrored","IFrame","onClose","class","onClick","version","xmlns","width","height","viewBox","frameBorder","Overlay","onOpen","toolbarRef","linksRect","targetRect","x","layout","rect","getBoundingClientRect","y","timer","setInterval","clearInterval","externalUrl","embedUrl","overlayWidth","overlayHeight","toolbarWidth","toolbarHeight","linkX","linkY","window","innerHeight","innerWidth","left","top","UNSET","Number","NEGATIVE_INFINITY","OverlayContainer","div","auth","setAuth","setTarget","targetUrl","setTargetUrl","authRef","listen","className","parentElement","isToolbar","parseTokenInPath","keys","position","clientX","clientY","updateTarget","previousPosition","Math","abs","previousTarget","checkAuth","updateAuth","newAuth","fetchStatus","response","fetch","credentials","json","displayName","isAuthenticated","currentScript","String","indexOfHash","trim","getBaseUrl","readyState"],"mappings":"aAIE,SAASA,EAAoBC,GAG5B,GAAGC,EAAiBD,GACnB,OAAOC,EAAiBD,GAAUE,QAGnC,IAAIC,EAASF,EAAiBD,GAAY,CACzCI,EAAGJ,EACHK,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQN,GAAUO,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASH,GAG/DI,EAAOE,GAAI,EAGJF,EAAOD,QAvBf,IAAID,EAAmB,GA4BvBF,EAAoBS,EAAIF,EAGxBP,EAAoBU,EAAIR,EAGxBF,EAAoBW,EAAI,SAASR,EAASS,EAAMC,GAC3Cb,EAAoBc,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEb,EAAoBmB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,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AAQa,MAAMJ,IAElB,IAAMiG,EAA6C,kBAA3B7B,EAAK7E,aAAD,EAACA,EAAQa,MAAMJ,GAE3C,OACI,mBAAK6B,MAAM,UAAU1P,IAAKgS,GACrB5E,GAAU0G,GACP,YAAC,EAAD,GAAS3D,OAAQkC,GAAkBjF,IAGtCgF,GACG,YAAC,EAAD,CAAQvH,IAAKuH,EAAW3C,QAAS,kBAAM4C,OAAa5R,QAM9DqN,EAAU,4BE5HZK,EAAiC,KDC/BV,EIwBC,WAAsB,MAxBJlP,EAyBjBsM,EAAG,QAAI,EAAA/C,SAASiM,qBAAb,aAAG,MAEV,KA1BwB,iBADHxV,EA2BPsM,IA1BsBtM,aAAiByV,QA2BjD,OAAO,KAKX,IAAIC,GAFJpJ,EAAMA,EAAIqJ,QAEYhT,QAAQ,IAAK,WAAWf,QAM9C,OAJI8T,EAAc,IACdpJ,EAAMA,EAAI8C,UAAU,EAAGsG,IAGpBpJ,EJvCKsJ,GAqBY,aAAxBrM,SAASsM,WACTrJ,IAEAwG,OAAOlM,iBAAiB,QAAQ,kBAAM0F","file":"embed-sdk.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"mdyV\");\n","import { EMPTY_ARR } from \"./constants\";\r\n\r\n/**\r\n * Assign properties from `props` to `obj`\r\n * @template O, P The obj and props types\r\n * @param {O} obj The object to copy properties to\r\n * @param {P} props The object to copy properties from\r\n * @returns {O & P}\r\n */\r\nexport function assign(obj, props) {\r\n\t// @ts-ignore We change the type of `obj` to be `O & P`\r\n\tfor (let i in props) obj[i] = props[i];\r\n\treturn /** @type {O & P} */ (obj);\r\n}\r\n\r\n/**\r\n * Remove a child node from its parent if attached. This is a workaround for\r\n * IE11 which doesn't support `Element.prototype.remove()`. Using this function\r\n * is smaller than including a dedicated polyfill.\r\n * @param {Node} node The node to remove\r\n */\r\nexport function removeNode(node) {\r\n\tlet parentNode = node.parentNode;\r\n\tif (parentNode) parentNode.removeChild(node);\r\n}\r\n\r\nexport const slice = EMPTY_ARR.slice;\r\n","import { slice } from './util';\r\nimport options from './options';\r\n\r\nlet vnodeId = 0;\r\n\r\n/**\r\n * Create an virtual node (used for JSX)\r\n * @param {import('./internal').VNode[\"type\"]} type The node name or Component\r\n * constructor for this virtual node\r\n * @param {object | null | undefined} [props] The properties of the virtual node\r\n * @param {Array} [children] The children of the virtual node\r\n * @returns {import('./internal').VNode}\r\n */\r\nexport function createElement(type, props, children) {\r\n\tlet normalizedProps = {},\r\n\t\tkey,\r\n\t\tref,\r\n\t\ti;\r\n\tfor (i in props) {\r\n\t\tif (i == 'key') key = props[i];\r\n\t\telse if (i == 'ref') ref = props[i];\r\n\t\telse normalizedProps[i] = props[i];\r\n\t}\r\n\r\n\tif (arguments.length > 2) {\r\n\t\tnormalizedProps.children =\r\n\t\t\targuments.length > 3 ? slice.call(arguments, 2) : children;\r\n\t}\r\n\r\n\t// If a Component VNode, check for and apply defaultProps\r\n\t// Note: type may be undefined in development, must never error here.\r\n\tif (typeof type == 'function' && type.defaultProps != null) {\r\n\t\tfor (i in type.defaultProps) {\r\n\t\t\tif (normalizedProps[i] === undefined) {\r\n\t\t\t\tnormalizedProps[i] = type.defaultProps[i];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn createVNode(type, normalizedProps, key, ref, null);\r\n}\r\n\r\n/**\r\n * Create a VNode (used internally by Preact)\r\n * @param {import('./internal').VNode[\"type\"]} type The node name or Component\r\n * Constructor for this virtual node\r\n * @param {object | string | number | null} props The properties of this virtual node.\r\n * If this virtual node represents a text node, this is the text of the node (string or number).\r\n * @param {string | number | null} key The key for this virtual node, used when\r\n * diffing it against its children\r\n * @param {import('./internal').VNode[\"ref\"]} ref The ref property that will\r\n * receive a reference to its created child\r\n * @returns {import('./internal').VNode}\r\n */\r\nexport function createVNode(type, props, key, ref, original) {\r\n\t// V8 seems to be better at detecting type shapes if the object is allocated from the same call site\r\n\t// Do not inline into createElement and coerceToVNode!\r\n\tconst vnode = {\r\n\t\ttype,\r\n\t\tprops,\r\n\t\tkey,\r\n\t\tref,\r\n\t\t_children: null,\r\n\t\t_parent: null,\r\n\t\t_depth: 0,\r\n\t\t_dom: null,\r\n\t\t// _nextDom must be initialized to undefined b/c it will eventually\r\n\t\t// be set to dom.nextSibling which can return `null` and it is important\r\n\t\t// to be able to distinguish between an uninitialized _nextDom and\r\n\t\t// a _nextDom that has been set to `null`\r\n\t\t_nextDom: undefined,\r\n\t\t_component: null,\r\n\t\t_hydrating: null,\r\n\t\tconstructor: undefined,\r\n\t\t_original: original == null ? ++vnodeId : original\r\n\t};\r\n\r\n\t// Only invoke the vnode hook if this was *not* a direct copy:\r\n\tif (original == null && options.vnode != null) options.vnode(vnode);\r\n\r\n\treturn vnode;\r\n}\r\n\r\nexport function createRef() {\r\n\treturn { current: null };\r\n}\r\n\r\nexport function Fragment(props) {\r\n\treturn props.children;\r\n}\r\n\r\n/**\r\n * Check if a the argument is a valid Preact VNode.\r\n * @param {*} vnode\r\n * @returns {vnode is import('./internal').VNode}\r\n */\r\nexport const isValidElement = vnode =>\r\n\tvnode != null && vnode.constructor === undefined;\r\n","import { assign } from './util';\r\nimport { diff, commitRoot } from './diff/index';\r\nimport options from './options';\r\nimport { Fragment } from './create-element';\r\n\r\n/**\r\n * Base Component class. Provides `setState()` and `forceUpdate()`, which\r\n * trigger rendering\r\n * @param {object} props The initial component props\r\n * @param {object} context The initial context from parent components'\r\n * getChildContext\r\n */\r\nexport function Component(props, context) {\r\n\tthis.props = props;\r\n\tthis.context = context;\r\n}\r\n\r\n/**\r\n * Update component state and schedule a re-render.\r\n * @this {import('./internal').Component}\r\n * @param {object | ((s: object, p: object) => object)} update A hash of state\r\n * properties to update with new values or a function that given the current\r\n * state and props returns a new partial state\r\n * @param {() => void} [callback] A function to be called once component state is\r\n * updated\r\n */\r\nComponent.prototype.setState = function(update, callback) {\r\n\t// only clone state when copying to nextState the first time.\r\n\tlet s;\r\n\tif (this._nextState != null && this._nextState !== this.state) {\r\n\t\ts = this._nextState;\r\n\t} else {\r\n\t\ts = this._nextState = assign({}, this.state);\r\n\t}\r\n\r\n\tif (typeof update == 'function') {\r\n\t\t// Some libraries like `immer` mark the current state as readonly,\r\n\t\t// preventing us from mutating it, so we need to clone it. See #2716\r\n\t\tupdate = update(assign({}, s), this.props);\r\n\t}\r\n\r\n\tif (update) {\r\n\t\tassign(s, update);\r\n\t}\r\n\r\n\t// Skip update if updater function returned null\r\n\tif (update == null) return;\r\n\r\n\tif (this._vnode) {\r\n\t\tif (callback) this._renderCallbacks.push(callback);\r\n\t\tenqueueRender(this);\r\n\t}\r\n};\r\n\r\n/**\r\n * Immediately perform a synchronous re-render of the component\r\n * @this {import('./internal').Component}\r\n * @param {() => void} [callback] A function to be called after component is\r\n * re-rendered\r\n */\r\nComponent.prototype.forceUpdate = function(callback) {\r\n\tif (this._vnode) {\r\n\t\t// Set render mode so that we can differentiate where the render request\r\n\t\t// is coming from. We need this because forceUpdate should never call\r\n\t\t// shouldComponentUpdate\r\n\t\tthis._force = true;\r\n\t\tif (callback) this._renderCallbacks.push(callback);\r\n\t\tenqueueRender(this);\r\n\t}\r\n};\r\n\r\n/**\r\n * Accepts `props` and `state`, and returns a new Virtual DOM tree to build.\r\n * Virtual DOM is generally constructed via [JSX](http://jasonformat.com/wtf-is-jsx).\r\n * @param {object} props Props (eg: JSX attributes) received from parent\r\n * element/component\r\n * @param {object} state The component's current state\r\n * @param {object} context Context object, as returned by the nearest\r\n * ancestor's `getChildContext()`\r\n * @returns {import('./index').ComponentChildren | void}\r\n */\r\nComponent.prototype.render = Fragment;\r\n\r\n/**\r\n * @param {import('./internal').VNode} vnode\r\n * @param {number | null} [childIndex]\r\n */\r\nexport function getDomSibling(vnode, childIndex) {\r\n\tif (childIndex == null) {\r\n\t\t// Use childIndex==null as a signal to resume the search from the vnode's sibling\r\n\t\treturn vnode._parent\r\n\t\t\t? getDomSibling(vnode._parent, vnode._parent._children.indexOf(vnode) + 1)\r\n\t\t\t: null;\r\n\t}\r\n\r\n\tlet sibling;\r\n\tfor (; childIndex < vnode._children.length; childIndex++) {\r\n\t\tsibling = vnode._children[childIndex];\r\n\r\n\t\tif (sibling != null && sibling._dom != null) {\r\n\t\t\t// Since updateParentDomPointers keeps _dom pointer correct,\r\n\t\t\t// we can rely on _dom to tell us if this subtree contains a\r\n\t\t\t// rendered DOM node, and what the first rendered DOM node is\r\n\t\t\treturn sibling._dom;\r\n\t\t}\r\n\t}\r\n\r\n\t// If we get here, we have not found a DOM node in this vnode's children.\r\n\t// We must resume from this vnode's sibling (in it's parent _children array)\r\n\t// Only climb up and search the parent if we aren't searching through a DOM\r\n\t// VNode (meaning we reached the DOM parent of the original vnode that began\r\n\t// the search)\r\n\treturn typeof vnode.type == 'function' ? getDomSibling(vnode) : null;\r\n}\r\n\r\n/**\r\n * Trigger in-place re-rendering of a component.\r\n * @param {import('./internal').Component} component The component to rerender\r\n */\r\nfunction renderComponent(component) {\r\n\tlet vnode = component._vnode,\r\n\t\toldDom = vnode._dom,\r\n\t\tparentDom = component._parentDom;\r\n\r\n\tif (parentDom) {\r\n\t\tlet commitQueue = [];\r\n\t\tconst oldVNode = assign({}, vnode);\r\n\t\toldVNode._original = vnode._original + 1;\r\n\r\n\t\tdiff(\r\n\t\t\tparentDom,\r\n\t\t\tvnode,\r\n\t\t\toldVNode,\r\n\t\t\tcomponent._globalContext,\r\n\t\t\tparentDom.ownerSVGElement !== undefined,\r\n\t\t\tvnode._hydrating != null ? [oldDom] : null,\r\n\t\t\tcommitQueue,\r\n\t\t\toldDom == null ? getDomSibling(vnode) : oldDom,\r\n\t\t\tvnode._hydrating\r\n\t\t);\r\n\t\tcommitRoot(commitQueue, vnode);\r\n\r\n\t\tif (vnode._dom != oldDom) {\r\n\t\t\tupdateParentDomPointers(vnode);\r\n\t\t}\r\n\t}\r\n}\r\n\r\n/**\r\n * @param {import('./internal').VNode} vnode\r\n */\r\nfunction updateParentDomPointers(vnode) {\r\n\tif ((vnode = vnode._parent) != null && vnode._component != null) {\r\n\t\tvnode._dom = vnode._component.base = null;\r\n\t\tfor (let i = 0; i < vnode._children.length; i++) {\r\n\t\t\tlet child = vnode._children[i];\r\n\t\t\tif (child != null && child._dom != null) {\r\n\t\t\t\tvnode._dom = vnode._component.base = child._dom;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn updateParentDomPointers(vnode);\r\n\t}\r\n}\r\n\r\n/**\r\n * The render queue\r\n * @type {Array}\r\n */\r\nlet rerenderQueue = [];\r\n\r\n/**\r\n * Asynchronously schedule a callback\r\n * @type {(cb: () => void) => void}\r\n */\r\n/* istanbul ignore next */\r\n// Note the following line isn't tree-shaken by rollup cuz of rollup/rollup#2566\r\nconst defer =\r\n\ttypeof Promise == 'function'\r\n\t\t? Promise.prototype.then.bind(Promise.resolve())\r\n\t\t: setTimeout;\r\n\r\n/*\r\n * The value of `Component.debounce` must asynchronously invoke the passed in callback. It is\r\n * important that contributors to Preact can consistently reason about what calls to `setState`, etc.\r\n * do, and when their effects will be applied. See the links below for some further reading on designing\r\n * asynchronous APIs.\r\n * * [Designing APIs for Asynchrony](https://blog.izs.me/2013/08/designing-apis-for-asynchrony)\r\n * * [Callbacks synchronous and asynchronous](https://blog.ometer.com/2011/07/24/callbacks-synchronous-and-asynchronous/)\r\n */\r\n\r\nlet prevDebounce;\r\n\r\n/**\r\n * Enqueue a rerender of a component\r\n * @param {import('./internal').Component} c The component to rerender\r\n */\r\nexport function enqueueRender(c) {\r\n\tif (\r\n\t\t(!c._dirty &&\r\n\t\t\t(c._dirty = true) &&\r\n\t\t\trerenderQueue.push(c) &&\r\n\t\t\t!process._rerenderCount++) ||\r\n\t\tprevDebounce !== options.debounceRendering\r\n\t) {\r\n\t\tprevDebounce = options.debounceRendering;\r\n\t\t(prevDebounce || defer)(process);\r\n\t}\r\n}\r\n\r\n/** Flush the render queue by rerendering all queued components */\r\nfunction process() {\r\n\tlet queue;\r\n\twhile ((process._rerenderCount = rerenderQueue.length)) {\r\n\t\tqueue = rerenderQueue.sort((a, b) => a._vnode._depth - b._vnode._depth);\r\n\t\trerenderQueue = [];\r\n\t\t// Don't update `renderCount` yet. Keep its value non-zero to prevent unnecessary\r\n\t\t// process() calls from getting scheduled while `queue` is still being consumed.\r\n\t\tqueue.some(c => {\r\n\t\t\tif (c._dirty) renderComponent(c);\r\n\t\t});\r\n\t}\r\n}\r\nprocess._rerenderCount = 0;\r\n","import { diff, unmount, applyRef } from './index';\r\nimport { createVNode, Fragment } from '../create-element';\r\nimport { EMPTY_OBJ, EMPTY_ARR } from '../constants';\r\nimport { getDomSibling } from '../component';\r\n\r\n/**\r\n * Diff the children of a virtual node\r\n * @param {import('../internal').PreactElement} parentDom The DOM element whose\r\n * children are being diffed\r\n * @param {import('../internal').ComponentChildren[]} renderResult\r\n * @param {import('../internal').VNode} newParentVNode The new virtual\r\n * node whose children should be diff'ed against oldParentVNode\r\n * @param {import('../internal').VNode} oldParentVNode The old virtual\r\n * node whose children should be diff'ed against newParentVNode\r\n * @param {object} globalContext The current context object - modified by getChildContext\r\n * @param {boolean} isSvg Whether or not this DOM node is an SVG node\r\n * @param {Array} excessDomChildren\r\n * @param {Array} commitQueue List of components\r\n * which have callbacks to invoke in commitRoot\r\n * @param {import('../internal').PreactElement} oldDom The current attached DOM\r\n * element any new dom elements should be placed around. Likely `null` on first\r\n * render (except when hydrating). Can be a sibling DOM element when diffing\r\n * Fragments that have siblings. In most cases, it starts out as `oldChildren[0]._dom`.\r\n * @param {boolean} isHydrating Whether or not we are in hydration\r\n */\r\nexport function diffChildren(\r\n\tparentDom,\r\n\trenderResult,\r\n\tnewParentVNode,\r\n\toldParentVNode,\r\n\tglobalContext,\r\n\tisSvg,\r\n\texcessDomChildren,\r\n\tcommitQueue,\r\n\toldDom,\r\n\tisHydrating\r\n) {\r\n\tlet i, j, oldVNode, childVNode, newDom, firstChildDom, refs;\r\n\r\n\t// This is a compression of oldParentVNode!=null && oldParentVNode != EMPTY_OBJ && oldParentVNode._children || EMPTY_ARR\r\n\t// as EMPTY_OBJ._children should be `undefined`.\r\n\tlet oldChildren = (oldParentVNode && oldParentVNode._children) || EMPTY_ARR;\r\n\r\n\tlet oldChildrenLength = oldChildren.length;\r\n\r\n\tnewParentVNode._children = [];\r\n\tfor (i = 0; i < renderResult.length; i++) {\r\n\t\tchildVNode = renderResult[i];\r\n\r\n\t\tif (childVNode == null || typeof childVNode == 'boolean') {\r\n\t\t\tchildVNode = newParentVNode._children[i] = null;\r\n\t\t}\r\n\t\t// If this newVNode is being reused (e.g.
{reuse}{reuse}
) in the same diff,\r\n\t\t// or we are rendering a component (e.g. setState) copy the oldVNodes so it can have\r\n\t\t// it's own DOM & etc. pointers\r\n\t\telse if (\r\n\t\t\ttypeof childVNode == 'string' ||\r\n\t\t\ttypeof childVNode == 'number' ||\r\n\t\t\t// eslint-disable-next-line valid-typeof\r\n\t\t\ttypeof childVNode == 'bigint'\r\n\t\t) {\r\n\t\t\tchildVNode = newParentVNode._children[i] = createVNode(\r\n\t\t\t\tnull,\r\n\t\t\t\tchildVNode,\r\n\t\t\t\tnull,\r\n\t\t\t\tnull,\r\n\t\t\t\tchildVNode\r\n\t\t\t);\r\n\t\t} else if (Array.isArray(childVNode)) {\r\n\t\t\tchildVNode = newParentVNode._children[i] = createVNode(\r\n\t\t\t\tFragment,\r\n\t\t\t\t{ children: childVNode },\r\n\t\t\t\tnull,\r\n\t\t\t\tnull,\r\n\t\t\t\tnull\r\n\t\t\t);\r\n\t\t} else if (childVNode._depth > 0) {\r\n\t\t\t// VNode is already in use, clone it. This can happen in the following\r\n\t\t\t// scenario:\r\n\t\t\t// const reuse =
\r\n\t\t\t//
{reuse}{reuse}
\r\n\t\t\tchildVNode = newParentVNode._children[i] = createVNode(\r\n\t\t\t\tchildVNode.type,\r\n\t\t\t\tchildVNode.props,\r\n\t\t\t\tchildVNode.key,\r\n\t\t\t\tnull,\r\n\t\t\t\tchildVNode._original\r\n\t\t\t);\r\n\t\t} else {\r\n\t\t\tchildVNode = newParentVNode._children[i] = childVNode;\r\n\t\t}\r\n\r\n\t\t// Terser removes the `continue` here and wraps the loop body\r\n\t\t// in a `if (childVNode) { ... } condition\r\n\t\tif (childVNode == null) {\r\n\t\t\tcontinue;\r\n\t\t}\r\n\r\n\t\tchildVNode._parent = newParentVNode;\r\n\t\tchildVNode._depth = newParentVNode._depth + 1;\r\n\r\n\t\t// Check if we find a corresponding element in oldChildren.\r\n\t\t// If found, delete the array item by setting to `undefined`.\r\n\t\t// We use `undefined`, as `null` is reserved for empty placeholders\r\n\t\t// (holes).\r\n\t\toldVNode = oldChildren[i];\r\n\r\n\t\tif (\r\n\t\t\toldVNode === null ||\r\n\t\t\t(oldVNode &&\r\n\t\t\t\tchildVNode.key == oldVNode.key &&\r\n\t\t\t\tchildVNode.type === oldVNode.type)\r\n\t\t) {\r\n\t\t\toldChildren[i] = undefined;\r\n\t\t} else {\r\n\t\t\t// Either oldVNode === undefined or oldChildrenLength > 0,\r\n\t\t\t// so after this loop oldVNode == null or oldVNode is a valid value.\r\n\t\t\tfor (j = 0; j < oldChildrenLength; j++) {\r\n\t\t\t\toldVNode = oldChildren[j];\r\n\t\t\t\t// If childVNode is unkeyed, we only match similarly unkeyed nodes, otherwise we match by key.\r\n\t\t\t\t// We always match by type (in either case).\r\n\t\t\t\tif (\r\n\t\t\t\t\toldVNode &&\r\n\t\t\t\t\tchildVNode.key == oldVNode.key &&\r\n\t\t\t\t\tchildVNode.type === oldVNode.type\r\n\t\t\t\t) {\r\n\t\t\t\t\toldChildren[j] = undefined;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\toldVNode = null;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\toldVNode = oldVNode || EMPTY_OBJ;\r\n\r\n\t\t// Morph the old element into the new one, but don't append it to the dom yet\r\n\t\tdiff(\r\n\t\t\tparentDom,\r\n\t\t\tchildVNode,\r\n\t\t\toldVNode,\r\n\t\t\tglobalContext,\r\n\t\t\tisSvg,\r\n\t\t\texcessDomChildren,\r\n\t\t\tcommitQueue,\r\n\t\t\toldDom,\r\n\t\t\tisHydrating\r\n\t\t);\r\n\r\n\t\tnewDom = childVNode._dom;\r\n\r\n\t\tif ((j = childVNode.ref) && oldVNode.ref != j) {\r\n\t\t\tif (!refs) refs = [];\r\n\t\t\tif (oldVNode.ref) refs.push(oldVNode.ref, null, childVNode);\r\n\t\t\trefs.push(j, childVNode._component || newDom, childVNode);\r\n\t\t}\r\n\r\n\t\tif (newDom != null) {\r\n\t\t\tif (firstChildDom == null) {\r\n\t\t\t\tfirstChildDom = newDom;\r\n\t\t\t}\r\n\r\n\t\t\tif (\r\n\t\t\t\ttypeof childVNode.type == 'function' &&\r\n\t\t\t\tchildVNode._children === oldVNode._children\r\n\t\t\t) {\r\n\t\t\t\tchildVNode._nextDom = oldDom = reorderChildren(\r\n\t\t\t\t\tchildVNode,\r\n\t\t\t\t\toldDom,\r\n\t\t\t\t\tparentDom\r\n\t\t\t\t);\r\n\t\t\t} else {\r\n\t\t\t\toldDom = placeChild(\r\n\t\t\t\t\tparentDom,\r\n\t\t\t\t\tchildVNode,\r\n\t\t\t\t\toldVNode,\r\n\t\t\t\t\toldChildren,\r\n\t\t\t\t\tnewDom,\r\n\t\t\t\t\toldDom\r\n\t\t\t\t);\r\n\t\t\t}\r\n\r\n\t\t\tif (typeof newParentVNode.type == 'function') {\r\n\t\t\t\t// Because the newParentVNode is Fragment-like, we need to set it's\r\n\t\t\t\t// _nextDom property to the nextSibling of its last child DOM node.\r\n\t\t\t\t//\r\n\t\t\t\t// `oldDom` contains the correct value here because if the last child\r\n\t\t\t\t// is a Fragment-like, then oldDom has already been set to that child's _nextDom.\r\n\t\t\t\t// If the last child is a DOM VNode, then oldDom will be set to that DOM\r\n\t\t\t\t// node's nextSibling.\r\n\t\t\t\tnewParentVNode._nextDom = oldDom;\r\n\t\t\t}\r\n\t\t} else if (\r\n\t\t\toldDom &&\r\n\t\t\toldVNode._dom == oldDom &&\r\n\t\t\toldDom.parentNode != parentDom\r\n\t\t) {\r\n\t\t\t// The above condition is to handle null placeholders. See test in placeholder.test.js:\r\n\t\t\t// `efficiently replace null placeholders in parent rerenders`\r\n\t\t\toldDom = getDomSibling(oldVNode);\r\n\t\t}\r\n\t}\r\n\r\n\tnewParentVNode._dom = firstChildDom;\r\n\r\n\t// Remove remaining oldChildren if there are any.\r\n\tfor (i = oldChildrenLength; i--; ) {\r\n\t\tif (oldChildren[i] != null) {\r\n\t\t\tif (\r\n\t\t\t\ttypeof newParentVNode.type == 'function' &&\r\n\t\t\t\toldChildren[i]._dom != null &&\r\n\t\t\t\toldChildren[i]._dom == newParentVNode._nextDom\r\n\t\t\t) {\r\n\t\t\t\t// If the newParentVNode.__nextDom points to a dom node that is about to\r\n\t\t\t\t// be unmounted, then get the next sibling of that vnode and set\r\n\t\t\t\t// _nextDom to it\r\n\t\t\t\tnewParentVNode._nextDom = getDomSibling(oldParentVNode, i + 1);\r\n\t\t\t}\r\n\r\n\t\t\tunmount(oldChildren[i], oldChildren[i]);\r\n\t\t}\r\n\t}\r\n\r\n\t// Set refs only after unmount\r\n\tif (refs) {\r\n\t\tfor (i = 0; i < refs.length; i++) {\r\n\t\t\tapplyRef(refs[i], refs[++i], refs[++i]);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nfunction reorderChildren(childVNode, oldDom, parentDom) {\r\n\t// Note: VNodes in nested suspended trees may be missing _children.\r\n\tlet c = childVNode._children;\r\n\tlet tmp = 0;\r\n\tfor (; c && tmp < c.length; tmp++) {\r\n\t\tlet vnode = c[tmp];\r\n\t\tif (vnode) {\r\n\t\t\t// We typically enter this code path on sCU bailout, where we copy\r\n\t\t\t// oldVNode._children to newVNode._children. If that is the case, we need\r\n\t\t\t// to update the old children's _parent pointer to point to the newVNode\r\n\t\t\t// (childVNode here).\r\n\t\t\tvnode._parent = childVNode;\r\n\r\n\t\t\tif (typeof vnode.type == 'function') {\r\n\t\t\t\toldDom = reorderChildren(vnode, oldDom, parentDom);\r\n\t\t\t} else {\r\n\t\t\t\toldDom = placeChild(\r\n\t\t\t\t\tparentDom,\r\n\t\t\t\t\tvnode,\r\n\t\t\t\t\tvnode,\r\n\t\t\t\t\tc,\r\n\t\t\t\t\tvnode._dom,\r\n\t\t\t\t\toldDom\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn oldDom;\r\n}\r\n\r\n/**\r\n * Flatten and loop through the children of a virtual node\r\n * @param {import('../index').ComponentChildren} children The unflattened\r\n * children of a virtual node\r\n * @returns {import('../internal').VNode[]}\r\n */\r\nexport function toChildArray(children, out) {\r\n\tout = out || [];\r\n\tif (children == null || typeof children == 'boolean') {\r\n\t} else if (Array.isArray(children)) {\r\n\t\tchildren.some(child => {\r\n\t\t\ttoChildArray(child, out);\r\n\t\t});\r\n\t} else {\r\n\t\tout.push(children);\r\n\t}\r\n\treturn out;\r\n}\r\n\r\nfunction placeChild(\r\n\tparentDom,\r\n\tchildVNode,\r\n\toldVNode,\r\n\toldChildren,\r\n\tnewDom,\r\n\toldDom\r\n) {\r\n\tlet nextDom;\r\n\tif (childVNode._nextDom !== undefined) {\r\n\t\t// Only Fragments or components that return Fragment like VNodes will\r\n\t\t// have a non-undefined _nextDom. Continue the diff from the sibling\r\n\t\t// of last DOM child of this child VNode\r\n\t\tnextDom = childVNode._nextDom;\r\n\r\n\t\t// Eagerly cleanup _nextDom. We don't need to persist the value because\r\n\t\t// it is only used by `diffChildren` to determine where to resume the diff after\r\n\t\t// diffing Components and Fragments. Once we store it the nextDOM local var, we\r\n\t\t// can clean up the property\r\n\t\tchildVNode._nextDom = undefined;\r\n\t} else if (\r\n\t\toldVNode == null ||\r\n\t\tnewDom != oldDom ||\r\n\t\tnewDom.parentNode == null\r\n\t) {\r\n\t\touter: if (oldDom == null || oldDom.parentNode !== parentDom) {\r\n\t\t\tparentDom.appendChild(newDom);\r\n\t\t\tnextDom = null;\r\n\t\t} else {\r\n\t\t\t// `j href (xlink:href was removed from SVG and isn't needed)\r\n\t\t\t// - className --> class\r\n\t\t\tname = name.replace(/xlink[H:h]/, 'h').replace(/sName$/, 's');\r\n\t\t} else if (\r\n\t\t\tname !== 'href' &&\r\n\t\t\tname !== 'list' &&\r\n\t\t\tname !== 'form' &&\r\n\t\t\t// Default value in browsers is `-1` and an empty string is\r\n\t\t\t// cast to `0` instead\r\n\t\t\tname !== 'tabIndex' &&\r\n\t\t\tname !== 'download' &&\r\n\t\t\tname in dom\r\n\t\t) {\r\n\t\t\ttry {\r\n\t\t\t\tdom[name] = value == null ? '' : value;\r\n\t\t\t\t// labelled break is 1b smaller here than a return statement (sorry)\r\n\t\t\t\tbreak o;\r\n\t\t\t} catch (e) {}\r\n\t\t}\r\n\r\n\t\t// ARIA-attributes have a different notion of boolean values.\r\n\t\t// The value `false` is different from the attribute not\r\n\t\t// existing on the DOM, so we can't remove it. For non-boolean\r\n\t\t// ARIA-attributes we could treat false as a removal, but the\r\n\t\t// amount of exceptions would cost us too many bytes. On top of\r\n\t\t// that other VDOM frameworks also always stringify `false`.\r\n\r\n\t\tif (typeof value === 'function') {\r\n\t\t\t// never serialize functions as attribute values\r\n\t\t} else if (\r\n\t\t\tvalue != null &&\r\n\t\t\t(value !== false || (name[0] === 'a' && name[1] === 'r'))\r\n\t\t) {\r\n\t\t\tdom.setAttribute(name, value);\r\n\t\t} else {\r\n\t\t\tdom.removeAttribute(name);\r\n\t\t}\r\n\t}\r\n}\r\n\r\n/**\r\n * Proxy an event to hooked event handlers\r\n * @param {Event} e The event object from the browser\r\n * @private\r\n */\r\nfunction eventProxy(e) {\r\n\tthis._listeners[e.type + false](options.event ? options.event(e) : e);\r\n}\r\n\r\nfunction eventProxyCapture(e) {\r\n\tthis._listeners[e.type + true](options.event ? options.event(e) : e);\r\n}\r\n","import { EMPTY_OBJ } from '../constants';\r\nimport { Component, getDomSibling } from '../component';\r\nimport { Fragment } from '../create-element';\r\nimport { diffChildren } from './children';\r\nimport { diffProps, setProperty } from './props';\r\nimport { assign, removeNode, slice } from '../util';\r\nimport options from '../options';\r\n\r\n/**\r\n * Diff two virtual nodes and apply proper changes to the DOM\r\n * @param {import('../internal').PreactElement} parentDom The parent of the DOM element\r\n * @param {import('../internal').VNode} newVNode The new virtual node\r\n * @param {import('../internal').VNode} oldVNode The old virtual node\r\n * @param {object} globalContext The current context object. Modified by getChildContext\r\n * @param {boolean} isSvg Whether or not this element is an SVG node\r\n * @param {Array} excessDomChildren\r\n * @param {Array} commitQueue List of components\r\n * which have callbacks to invoke in commitRoot\r\n * @param {import('../internal').PreactElement} oldDom The current attached DOM\r\n * element any new dom elements should be placed around. Likely `null` on first\r\n * render (except when hydrating). Can be a sibling DOM element when diffing\r\n * Fragments that have siblings. In most cases, it starts out as `oldChildren[0]._dom`.\r\n * @param {boolean} [isHydrating] Whether or not we are in hydration\r\n */\r\nexport function diff(\r\n\tparentDom,\r\n\tnewVNode,\r\n\toldVNode,\r\n\tglobalContext,\r\n\tisSvg,\r\n\texcessDomChildren,\r\n\tcommitQueue,\r\n\toldDom,\r\n\tisHydrating\r\n) {\r\n\tlet tmp,\r\n\t\tnewType = newVNode.type;\r\n\r\n\t// When passing through createElement it assigns the object\r\n\t// constructor as undefined. This to prevent JSON-injection.\r\n\tif (newVNode.constructor !== undefined) return null;\r\n\r\n\t// If the previous diff bailed out, resume creating/hydrating.\r\n\tif (oldVNode._hydrating != null) {\r\n\t\tisHydrating = oldVNode._hydrating;\r\n\t\toldDom = newVNode._dom = oldVNode._dom;\r\n\t\t// if we resume, we want the tree to be \"unlocked\"\r\n\t\tnewVNode._hydrating = null;\r\n\t\texcessDomChildren = [oldDom];\r\n\t}\r\n\r\n\tif ((tmp = options._diff)) tmp(newVNode);\r\n\r\n\ttry {\r\n\t\touter: if (typeof newType == 'function') {\r\n\t\t\tlet c, isNew, oldProps, oldState, snapshot, clearProcessingException;\r\n\t\t\tlet newProps = newVNode.props;\r\n\r\n\t\t\t// Necessary for createContext api. Setting this property will pass\r\n\t\t\t// the context value as `this.context` just for this component.\r\n\t\t\ttmp = newType.contextType;\r\n\t\t\tlet provider = tmp && globalContext[tmp._id];\r\n\t\t\tlet componentContext = tmp\r\n\t\t\t\t? provider\r\n\t\t\t\t\t? provider.props.value\r\n\t\t\t\t\t: tmp._defaultValue\r\n\t\t\t\t: globalContext;\r\n\r\n\t\t\t// Get component and set it to `c`\r\n\t\t\tif (oldVNode._component) {\r\n\t\t\t\tc = newVNode._component = oldVNode._component;\r\n\t\t\t\tclearProcessingException = c._processingException = c._pendingError;\r\n\t\t\t} else {\r\n\t\t\t\t// Instantiate the new component\r\n\t\t\t\tif ('prototype' in newType && newType.prototype.render) {\r\n\t\t\t\t\t// @ts-ignore The check above verifies that newType is suppose to be constructed\r\n\t\t\t\t\tnewVNode._component = c = new newType(newProps, componentContext); // eslint-disable-line new-cap\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// @ts-ignore Trust me, Component implements the interface we want\r\n\t\t\t\t\tnewVNode._component = c = new Component(newProps, componentContext);\r\n\t\t\t\t\tc.constructor = newType;\r\n\t\t\t\t\tc.render = doRender;\r\n\t\t\t\t}\r\n\t\t\t\tif (provider) provider.sub(c);\r\n\r\n\t\t\t\tc.props = newProps;\r\n\t\t\t\tif (!c.state) c.state = {};\r\n\t\t\t\tc.context = componentContext;\r\n\t\t\t\tc._globalContext = globalContext;\r\n\t\t\t\tisNew = c._dirty = true;\r\n\t\t\t\tc._renderCallbacks = [];\r\n\t\t\t}\r\n\r\n\t\t\t// Invoke getDerivedStateFromProps\r\n\t\t\tif (c._nextState == null) {\r\n\t\t\t\tc._nextState = c.state;\r\n\t\t\t}\r\n\t\t\tif (newType.getDerivedStateFromProps != null) {\r\n\t\t\t\tif (c._nextState == c.state) {\r\n\t\t\t\t\tc._nextState = assign({}, c._nextState);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tassign(\r\n\t\t\t\t\tc._nextState,\r\n\t\t\t\t\tnewType.getDerivedStateFromProps(newProps, c._nextState)\r\n\t\t\t\t);\r\n\t\t\t}\r\n\r\n\t\t\toldProps = c.props;\r\n\t\t\toldState = c.state;\r\n\r\n\t\t\t// Invoke pre-render lifecycle methods\r\n\t\t\tif (isNew) {\r\n\t\t\t\tif (\r\n\t\t\t\t\tnewType.getDerivedStateFromProps == null &&\r\n\t\t\t\t\tc.componentWillMount != null\r\n\t\t\t\t) {\r\n\t\t\t\t\tc.componentWillMount();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (c.componentDidMount != null) {\r\n\t\t\t\t\tc._renderCallbacks.push(c.componentDidMount);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif (\r\n\t\t\t\t\tnewType.getDerivedStateFromProps == null &&\r\n\t\t\t\t\tnewProps !== oldProps &&\r\n\t\t\t\t\tc.componentWillReceiveProps != null\r\n\t\t\t\t) {\r\n\t\t\t\t\tc.componentWillReceiveProps(newProps, componentContext);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (\r\n\t\t\t\t\t(!c._force &&\r\n\t\t\t\t\t\tc.shouldComponentUpdate != null &&\r\n\t\t\t\t\t\tc.shouldComponentUpdate(\r\n\t\t\t\t\t\t\tnewProps,\r\n\t\t\t\t\t\t\tc._nextState,\r\n\t\t\t\t\t\t\tcomponentContext\r\n\t\t\t\t\t\t) === false) ||\r\n\t\t\t\t\tnewVNode._original === oldVNode._original\r\n\t\t\t\t) {\r\n\t\t\t\t\tc.props = newProps;\r\n\t\t\t\t\tc.state = c._nextState;\r\n\t\t\t\t\t// More info about this here: https://gist.github.com/JoviDeCroock/bec5f2ce93544d2e6070ef8e0036e4e8\r\n\t\t\t\t\tif (newVNode._original !== oldVNode._original) c._dirty = false;\r\n\t\t\t\t\tc._vnode = newVNode;\r\n\t\t\t\t\tnewVNode._dom = oldVNode._dom;\r\n\t\t\t\t\tnewVNode._children = oldVNode._children;\r\n\t\t\t\t\tnewVNode._children.forEach(vnode => {\r\n\t\t\t\t\t\tif (vnode) vnode._parent = newVNode;\r\n\t\t\t\t\t});\r\n\t\t\t\t\tif (c._renderCallbacks.length) {\r\n\t\t\t\t\t\tcommitQueue.push(c);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tbreak outer;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (c.componentWillUpdate != null) {\r\n\t\t\t\t\tc.componentWillUpdate(newProps, c._nextState, componentContext);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (c.componentDidUpdate != null) {\r\n\t\t\t\t\tc._renderCallbacks.push(() => {\r\n\t\t\t\t\t\tc.componentDidUpdate(oldProps, oldState, snapshot);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tc.context = componentContext;\r\n\t\t\tc.props = newProps;\r\n\t\t\tc.state = c._nextState;\r\n\r\n\t\t\tif ((tmp = options._render)) tmp(newVNode);\r\n\r\n\t\t\tc._dirty = false;\r\n\t\t\tc._vnode = newVNode;\r\n\t\t\tc._parentDom = parentDom;\r\n\r\n\t\t\ttmp = c.render(c.props, c.state, c.context);\r\n\r\n\t\t\t// Handle setState called in render, see #2553\r\n\t\t\tc.state = c._nextState;\r\n\r\n\t\t\tif (c.getChildContext != null) {\r\n\t\t\t\tglobalContext = assign(assign({}, globalContext), c.getChildContext());\r\n\t\t\t}\r\n\r\n\t\t\tif (!isNew && c.getSnapshotBeforeUpdate != null) {\r\n\t\t\t\tsnapshot = c.getSnapshotBeforeUpdate(oldProps, oldState);\r\n\t\t\t}\r\n\r\n\t\t\tlet isTopLevelFragment =\r\n\t\t\t\ttmp != null && tmp.type === Fragment && tmp.key == null;\r\n\t\t\tlet renderResult = isTopLevelFragment ? tmp.props.children : tmp;\r\n\r\n\t\t\tdiffChildren(\r\n\t\t\t\tparentDom,\r\n\t\t\t\tArray.isArray(renderResult) ? renderResult : [renderResult],\r\n\t\t\t\tnewVNode,\r\n\t\t\t\toldVNode,\r\n\t\t\t\tglobalContext,\r\n\t\t\t\tisSvg,\r\n\t\t\t\texcessDomChildren,\r\n\t\t\t\tcommitQueue,\r\n\t\t\t\toldDom,\r\n\t\t\t\tisHydrating\r\n\t\t\t);\r\n\r\n\t\t\tc.base = newVNode._dom;\r\n\r\n\t\t\t// We successfully rendered this VNode, unset any stored hydration/bailout state:\r\n\t\t\tnewVNode._hydrating = null;\r\n\r\n\t\t\tif (c._renderCallbacks.length) {\r\n\t\t\t\tcommitQueue.push(c);\r\n\t\t\t}\r\n\r\n\t\t\tif (clearProcessingException) {\r\n\t\t\t\tc._pendingError = c._processingException = null;\r\n\t\t\t}\r\n\r\n\t\t\tc._force = false;\r\n\t\t} else if (\r\n\t\t\texcessDomChildren == null &&\r\n\t\t\tnewVNode._original === oldVNode._original\r\n\t\t) {\r\n\t\t\tnewVNode._children = oldVNode._children;\r\n\t\t\tnewVNode._dom = oldVNode._dom;\r\n\t\t} else {\r\n\t\t\tnewVNode._dom = diffElementNodes(\r\n\t\t\t\toldVNode._dom,\r\n\t\t\t\tnewVNode,\r\n\t\t\t\toldVNode,\r\n\t\t\t\tglobalContext,\r\n\t\t\t\tisSvg,\r\n\t\t\t\texcessDomChildren,\r\n\t\t\t\tcommitQueue,\r\n\t\t\t\tisHydrating\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\tif ((tmp = options.diffed)) tmp(newVNode);\r\n\t} catch (e) {\r\n\t\tnewVNode._original = null;\r\n\t\t// if hydrating or creating initial tree, bailout preserves DOM:\r\n\t\tif (isHydrating || excessDomChildren != null) {\r\n\t\t\tnewVNode._dom = oldDom;\r\n\t\t\tnewVNode._hydrating = !!isHydrating;\r\n\t\t\texcessDomChildren[excessDomChildren.indexOf(oldDom)] = null;\r\n\t\t\t// ^ could possibly be simplified to:\r\n\t\t\t// excessDomChildren.length = 0;\r\n\t\t}\r\n\t\toptions._catchError(e, newVNode, oldVNode);\r\n\t}\r\n}\r\n\r\n/**\r\n * @param {Array} commitQueue List of components\r\n * which have callbacks to invoke in commitRoot\r\n * @param {import('../internal').VNode} root\r\n */\r\nexport function commitRoot(commitQueue, root) {\r\n\tif (options._commit) options._commit(root, commitQueue);\r\n\r\n\tcommitQueue.some(c => {\r\n\t\ttry {\r\n\t\t\t// @ts-ignore Reuse the commitQueue variable here so the type changes\r\n\t\t\tcommitQueue = c._renderCallbacks;\r\n\t\t\tc._renderCallbacks = [];\r\n\t\t\tcommitQueue.some(cb => {\r\n\t\t\t\t// @ts-ignore See above ts-ignore on commitQueue\r\n\t\t\t\tcb.call(c);\r\n\t\t\t});\r\n\t\t} catch (e) {\r\n\t\t\toptions._catchError(e, c._vnode);\r\n\t\t}\r\n\t});\r\n}\r\n\r\n/**\r\n * Diff two virtual nodes representing DOM element\r\n * @param {import('../internal').PreactElement} dom The DOM element representing\r\n * the virtual nodes being diffed\r\n * @param {import('../internal').VNode} newVNode The new virtual node\r\n * @param {import('../internal').VNode} oldVNode The old virtual node\r\n * @param {object} globalContext The current context object\r\n * @param {boolean} isSvg Whether or not this DOM node is an SVG node\r\n * @param {*} excessDomChildren\r\n * @param {Array} commitQueue List of components\r\n * which have callbacks to invoke in commitRoot\r\n * @param {boolean} isHydrating Whether or not we are in hydration\r\n * @returns {import('../internal').PreactElement}\r\n */\r\nfunction diffElementNodes(\r\n\tdom,\r\n\tnewVNode,\r\n\toldVNode,\r\n\tglobalContext,\r\n\tisSvg,\r\n\texcessDomChildren,\r\n\tcommitQueue,\r\n\tisHydrating\r\n) {\r\n\tlet oldProps = oldVNode.props;\r\n\tlet newProps = newVNode.props;\r\n\tlet nodeType = newVNode.type;\r\n\tlet i = 0;\r\n\r\n\t// Tracks entering and exiting SVG namespace when descending through the tree.\r\n\tif (nodeType === 'svg') isSvg = true;\r\n\r\n\tif (excessDomChildren != null) {\r\n\t\tfor (; i < excessDomChildren.length; i++) {\r\n\t\t\tconst child = excessDomChildren[i];\r\n\r\n\t\t\t// if newVNode matches an element in excessDomChildren or the `dom`\r\n\t\t\t// argument matches an element in excessDomChildren, remove it from\r\n\t\t\t// excessDomChildren so it isn't later removed in diffChildren\r\n\t\t\tif (\r\n\t\t\t\tchild &&\r\n\t\t\t\t'setAttribute' in child === !!nodeType &&\r\n\t\t\t\t(nodeType ? child.localName === nodeType : child.nodeType === 3)\r\n\t\t\t) {\r\n\t\t\t\tdom = child;\r\n\t\t\t\texcessDomChildren[i] = null;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tif (dom == null) {\r\n\t\tif (nodeType === null) {\r\n\t\t\t// @ts-ignore createTextNode returns Text, we expect PreactElement\r\n\t\t\treturn document.createTextNode(newProps);\r\n\t\t}\r\n\r\n\t\tif (isSvg) {\r\n\t\t\tdom = document.createElementNS(\r\n\t\t\t\t'http://www.w3.org/2000/svg',\r\n\t\t\t\t// @ts-ignore We know `newVNode.type` is a string\r\n\t\t\t\tnodeType\r\n\t\t\t);\r\n\t\t} else {\r\n\t\t\tdom = document.createElement(\r\n\t\t\t\t// @ts-ignore We know `newVNode.type` is a string\r\n\t\t\t\tnodeType,\r\n\t\t\t\tnewProps.is && newProps\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\t// we created a new parent, so none of the previously attached children can be reused:\r\n\t\texcessDomChildren = null;\r\n\t\t// we are creating a new node, so we can assume this is a new subtree (in case we are hydrating), this deopts the hydrate\r\n\t\tisHydrating = false;\r\n\t}\r\n\r\n\tif (nodeType === null) {\r\n\t\t// During hydration, we still have to split merged text from SSR'd HTML.\r\n\t\tif (oldProps !== newProps && (!isHydrating || dom.data !== newProps)) {\r\n\t\t\tdom.data = newProps;\r\n\t\t}\r\n\t} else {\r\n\t\t// If excessDomChildren was not null, repopulate it with the current element's children:\r\n\t\texcessDomChildren = excessDomChildren && slice.call(dom.childNodes);\r\n\r\n\t\toldProps = oldVNode.props || EMPTY_OBJ;\r\n\r\n\t\tlet oldHtml = oldProps.dangerouslySetInnerHTML;\r\n\t\tlet newHtml = newProps.dangerouslySetInnerHTML;\r\n\r\n\t\t// During hydration, props are not diffed at all (including dangerouslySetInnerHTML)\r\n\t\t// @TODO we should warn in debug mode when props don't match here.\r\n\t\tif (!isHydrating) {\r\n\t\t\t// But, if we are in a situation where we are using existing DOM (e.g. replaceNode)\r\n\t\t\t// we should read the existing DOM attributes to diff them\r\n\t\t\tif (excessDomChildren != null) {\r\n\t\t\t\toldProps = {};\r\n\t\t\t\tfor (i = 0; i < dom.attributes.length; i++) {\r\n\t\t\t\t\toldProps[dom.attributes[i].name] = dom.attributes[i].value;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (newHtml || oldHtml) {\r\n\t\t\t\t// Avoid re-applying the same '__html' if it did not changed between re-render\r\n\t\t\t\tif (\r\n\t\t\t\t\t!newHtml ||\r\n\t\t\t\t\t((!oldHtml || newHtml.__html != oldHtml.__html) &&\r\n\t\t\t\t\t\tnewHtml.__html !== dom.innerHTML)\r\n\t\t\t\t) {\r\n\t\t\t\t\tdom.innerHTML = (newHtml && newHtml.__html) || '';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tdiffProps(dom, newProps, oldProps, isSvg, isHydrating);\r\n\r\n\t\t// If the new vnode didn't have dangerouslySetInnerHTML, diff its children\r\n\t\tif (newHtml) {\r\n\t\t\tnewVNode._children = [];\r\n\t\t} else {\r\n\t\t\ti = newVNode.props.children;\r\n\t\t\tdiffChildren(\r\n\t\t\t\tdom,\r\n\t\t\t\tArray.isArray(i) ? i : [i],\r\n\t\t\t\tnewVNode,\r\n\t\t\t\toldVNode,\r\n\t\t\t\tglobalContext,\r\n\t\t\t\tisSvg && nodeType !== 'foreignObject',\r\n\t\t\t\texcessDomChildren,\r\n\t\t\t\tcommitQueue,\r\n\t\t\t\texcessDomChildren\r\n\t\t\t\t\t? excessDomChildren[0]\r\n\t\t\t\t\t: oldVNode._children && getDomSibling(oldVNode, 0),\r\n\t\t\t\tisHydrating\r\n\t\t\t);\r\n\r\n\t\t\t// Remove children that are not part of any vnode.\r\n\t\t\tif (excessDomChildren != null) {\r\n\t\t\t\tfor (i = excessDomChildren.length; i--; ) {\r\n\t\t\t\t\tif (excessDomChildren[i] != null) removeNode(excessDomChildren[i]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// (as above, don't diff props during hydration)\r\n\t\tif (!isHydrating) {\r\n\t\t\tif (\r\n\t\t\t\t'value' in newProps &&\r\n\t\t\t\t(i = newProps.value) !== undefined &&\r\n\t\t\t\t// #2756 For the -element the initial value is 0,\r\n\t\t\t\t// despite the attribute not being present. When the attribute\r\n\t\t\t\t// is missing the progress bar is treated as indeterminate.\r\n\t\t\t\t// To fix that we'll always update it when it is 0 for progress elements\r\n\t\t\t\t(i !== oldProps.value ||\r\n\t\t\t\t\ti !== dom.value ||\r\n\t\t\t\t\t(nodeType === 'progress' && !i))\r\n\t\t\t) {\r\n\t\t\t\tsetProperty(dom, 'value', i, oldProps.value, false);\r\n\t\t\t}\r\n\t\t\tif (\r\n\t\t\t\t'checked' in newProps &&\r\n\t\t\t\t(i = newProps.checked) !== undefined &&\r\n\t\t\t\ti !== dom.checked\r\n\t\t\t) {\r\n\t\t\t\tsetProperty(dom, 'checked', i, oldProps.checked, false);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn dom;\r\n}\r\n\r\n/**\r\n * Invoke or update a ref, depending on whether it is a function or object ref.\r\n * @param {object|function} ref\r\n * @param {any} value\r\n * @param {import('../internal').VNode} vnode\r\n */\r\nexport function applyRef(ref, value, vnode) {\r\n\ttry {\r\n\t\tif (typeof ref == 'function') ref(value);\r\n\t\telse ref.current = value;\r\n\t} catch (e) {\r\n\t\toptions._catchError(e, vnode);\r\n\t}\r\n}\r\n\r\n/**\r\n * Unmount a virtual node from the tree and apply DOM changes\r\n * @param {import('../internal').VNode} vnode The virtual node to unmount\r\n * @param {import('../internal').VNode} parentVNode The parent of the VNode that\r\n * initiated the unmount\r\n * @param {boolean} [skipRemove] Flag that indicates that a parent node of the\r\n * current element is already detached from the DOM.\r\n */\r\nexport function unmount(vnode, parentVNode, skipRemove) {\r\n\tlet r;\r\n\tif (options.unmount) options.unmount(vnode);\r\n\r\n\tif ((r = vnode.ref)) {\r\n\t\tif (!r.current || r.current === vnode._dom) applyRef(r, null, parentVNode);\r\n\t}\r\n\r\n\tif ((r = vnode._component) != null) {\r\n\t\tif (r.componentWillUnmount) {\r\n\t\t\ttry {\r\n\t\t\t\tr.componentWillUnmount();\r\n\t\t\t} catch (e) {\r\n\t\t\t\toptions._catchError(e, parentVNode);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tr.base = r._parentDom = null;\r\n\t}\r\n\r\n\tif ((r = vnode._children)) {\r\n\t\tfor (let i = 0; i < r.length; i++) {\r\n\t\t\tif (r[i]) {\r\n\t\t\t\tunmount(r[i], parentVNode, typeof vnode.type != 'function');\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tif (!skipRemove && vnode._dom != null) removeNode(vnode._dom);\r\n\r\n\t// Must be set to `undefined` to properly clean up `_nextDom`\r\n\t// for which `null` is a valid value. See comment in `create-element.js`\r\n\tvnode._dom = vnode._nextDom = undefined;\r\n}\r\n\r\n/** The `.render()` method for a PFC backing instance. */\r\nfunction doRender(props, state, context) {\r\n\treturn this.constructor(props, context);\r\n}\r\n","import { EMPTY_OBJ } from './constants';\r\nimport { commitRoot, diff } from './diff/index';\r\nimport { createElement, Fragment } from './create-element';\r\nimport options from './options';\r\nimport { slice } from './util';\r\n\r\n/**\r\n * Render a Preact virtual node into a DOM element\r\n * @param {import('./internal').ComponentChild} vnode The virtual node to render\r\n * @param {import('./internal').PreactElement} parentDom The DOM element to\r\n * render into\r\n * @param {import('./internal').PreactElement | object} [replaceNode] Optional: Attempt to re-use an\r\n * existing DOM tree rooted at `replaceNode`\r\n */\r\nexport function render(vnode, parentDom, replaceNode) {\r\n\tif (options._root) options._root(vnode, parentDom);\r\n\r\n\t// We abuse the `replaceNode` parameter in `hydrate()` to signal if we are in\r\n\t// hydration mode or not by passing the `hydrate` function instead of a DOM\r\n\t// element..\r\n\tlet isHydrating = typeof replaceNode === 'function';\r\n\r\n\t// To be able to support calling `render()` multiple times on the same\r\n\t// DOM node, we need to obtain a reference to the previous tree. We do\r\n\t// this by assigning a new `_children` property to DOM nodes which points\r\n\t// to the last rendered tree. By default this property is not present, which\r\n\t// means that we are mounting a new tree for the first time.\r\n\tlet oldVNode = isHydrating\r\n\t\t? null\r\n\t\t: (replaceNode && replaceNode._children) || parentDom._children;\r\n\r\n\tvnode = (\r\n\t\t(!isHydrating && replaceNode) ||\r\n\t\tparentDom\r\n\t)._children = createElement(Fragment, null, [vnode]);\r\n\r\n\t// List of effects that need to be called after diffing.\r\n\tlet commitQueue = [];\r\n\tdiff(\r\n\t\tparentDom,\r\n\t\t// Determine the new vnode tree and store it on the DOM element on\r\n\t\t// our custom `_children` property.\r\n\t\tvnode,\r\n\t\toldVNode || EMPTY_OBJ,\r\n\t\tEMPTY_OBJ,\r\n\t\tparentDom.ownerSVGElement !== undefined,\r\n\t\t!isHydrating && replaceNode\r\n\t\t\t? [replaceNode]\r\n\t\t\t: oldVNode\r\n\t\t\t? null\r\n\t\t\t: parentDom.firstChild\r\n\t\t\t? slice.call(parentDom.childNodes)\r\n\t\t\t: null,\r\n\t\tcommitQueue,\r\n\t\t!isHydrating && replaceNode\r\n\t\t\t? replaceNode\r\n\t\t\t: oldVNode\r\n\t\t\t? oldVNode._dom\r\n\t\t\t: parentDom.firstChild,\r\n\t\tisHydrating\r\n\t);\r\n\r\n\t// Flush all queued effects\r\n\tcommitRoot(commitQueue, vnode);\r\n}\r\n\r\n/**\r\n * Update an existing DOM element with data from a Preact virtual node\r\n * @param {import('./internal').ComponentChild} vnode The virtual node to render\r\n * @param {import('./internal').PreactElement} parentDom The DOM element to\r\n * update\r\n */\r\nexport function hydrate(vnode, parentDom) {\r\n\trender(vnode, parentDom, hydrate);\r\n}\r\n","export const EMPTY_OBJ = {};\r\nexport const EMPTY_ARR = [];\r\nexport const IS_NON_DIMENSIONAL = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;\r\n","import { _catchError } from './diff/catch-error';\r\n\r\n/**\r\n * The `option` object can potentially contain callback functions\r\n * that are called during various stages of our renderer. This is the\r\n * foundation on which all our addons like `preact/debug`, `preact/compat`,\r\n * and `preact/hooks` are based on. See the `Options` type in `internal.d.ts`\r\n * for a full list of available option hooks (most editors/IDEs allow you to\r\n * ctrl+click or cmd+click on mac the type definition below).\r\n * @type {import('./internal').Options}\r\n */\r\nconst options = {\r\n\t_catchError\r\n};\r\n\r\nexport default options;\r\n","/**\r\n * Find the closest error boundary to a thrown error and call it\r\n * @param {object} error The thrown value\r\n * @param {import('../internal').VNode} vnode The vnode that threw\r\n * the error that was caught (except for unmounting when this parameter\r\n * is the highest parent that was being unmounted)\r\n */\r\nexport function _catchError(error, vnode) {\r\n\t/** @type {import('../internal').Component} */\r\n\tlet component, ctor, handled;\r\n\r\n\tfor (; (vnode = vnode._parent); ) {\r\n\t\tif ((component = vnode._component) && !component._processingException) {\r\n\t\t\ttry {\r\n\t\t\t\tctor = component.constructor;\r\n\r\n\t\t\t\tif (ctor && ctor.getDerivedStateFromError != null) {\r\n\t\t\t\t\tcomponent.setState(ctor.getDerivedStateFromError(error));\r\n\t\t\t\t\thandled = component._dirty;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (component.componentDidCatch != null) {\r\n\t\t\t\t\tcomponent.componentDidCatch(error);\r\n\t\t\t\t\thandled = component._dirty;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// This is an error boundary. Mark it as having bailed out, and whether it was mid-hydration.\r\n\t\t\t\tif (handled) {\r\n\t\t\t\t\treturn (component._pendingError = component);\r\n\t\t\t\t}\r\n\t\t\t} catch (e) {\r\n\t\t\t\terror = e;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tthrow error;\r\n}\r\n","/* global __webpack_public_path__ */\n\nimport * as Preact from 'preact';\nconst { h, render, hydrate } = Preact;\n\nconst interopDefault = m => (m && m.default ? m.default : m);\n\nconst normalizeURL = url => (url[url.length - 1] === '/' ? url : url + '/');\n\nif (process.env.NODE_ENV === 'development') {\n\t// enable preact devtools\n\trequire('preact/debug');\n\n\t// only add a debug sw if webpack service worker is not requested.\n\tif (process.env.ADD_SW === undefined && 'serviceWorker' in navigator) {\n\t\t// eslint-disable-next-line no-undef\n\t\tnavigator.serviceWorker.register(__webpack_public_path__ + 'sw-debug.js');\n\t} else if (process.env.ADD_SW && 'serviceWorker' in navigator) {\n\t\t// eslint-disable-next-line no-undef\n\t\tnavigator.serviceWorker.register(\n\t\t\t__webpack_public_path__ + (process.env.ES_BUILD ? 'sw-esm.js' : 'sw.js')\n\t\t);\n\t}\n} else if (process.env.ADD_SW && 'serviceWorker' in navigator) {\n\t// eslint-disable-next-line no-undef\n\tnavigator.serviceWorker.register(\n\t\t__webpack_public_path__ + (process.env.ES_BUILD ? 'sw-esm.js' : 'sw.js')\n\t);\n}\n\nlet app = interopDefault(require('preact-cli-entrypoint'));\n\nif (typeof app === 'function') {\n\tlet root =\n\t\tdocument.getElementById('preact_root') || document.body.firstElementChild;\n\n\tlet init = () => {\n\t\tlet app = interopDefault(require('preact-cli-entrypoint'));\n\t\tlet preRenderData = {};\n\t\tconst inlineDataElement = document.querySelector(\n\t\t\t'[type=\"__PREACT_CLI_DATA__\"]'\n\t\t);\n\t\tif (inlineDataElement) {\n\t\t\tpreRenderData =\n\t\t\t\tJSON.parse(decodeURI(inlineDataElement.innerHTML)).preRenderData ||\n\t\t\t\tpreRenderData;\n\t\t}\n\t\t/* An object named CLI_DATA is passed as a prop,\n\t\t * this keeps us future proof if in case we decide,\n\t\t * to send other data like at some point in time.\n\t\t */\n\t\tconst CLI_DATA = { preRenderData };\n\t\tconst currentURL = preRenderData.url ? normalizeURL(preRenderData.url) : '';\n\t\tconst canHydrate =\n\t\t\tprocess.env.PRERENDER &&\n\t\t\tprocess.env.NODE_ENV === 'production' &&\n\t\t\thydrate &&\n\t\t\tcurrentURL === normalizeURL(location.pathname);\n\t\tconst doRender = canHydrate ? hydrate : render;\n\t\troot = doRender(h(app, { CLI_DATA }), document.body, root);\n\t};\n\n\tif (module.hot) module.hot.accept('preact-cli-entrypoint', init);\n\n\tinit();\n}\n","import { options } from 'preact';\r\n\r\n/** @type {number} */\r\nlet currentIndex;\r\n\r\n/** @type {import('./internal').Component} */\r\nlet currentComponent;\r\n\r\n/** @type {number} */\r\nlet currentHook = 0;\r\n\r\n/** @type {Array} */\r\nlet afterPaintEffects = [];\r\n\r\nlet oldBeforeDiff = options._diff;\r\nlet oldBeforeRender = options._render;\r\nlet oldAfterDiff = options.diffed;\r\nlet oldCommit = options._commit;\r\nlet oldBeforeUnmount = options.unmount;\r\n\r\nconst RAF_TIMEOUT = 100;\r\nlet prevRaf;\r\n\r\noptions._diff = vnode => {\r\n\tcurrentComponent = null;\r\n\tif (oldBeforeDiff) oldBeforeDiff(vnode);\r\n};\r\n\r\noptions._render = vnode => {\r\n\tif (oldBeforeRender) oldBeforeRender(vnode);\r\n\r\n\tcurrentComponent = vnode._component;\r\n\tcurrentIndex = 0;\r\n\r\n\tconst hooks = currentComponent.__hooks;\r\n\tif (hooks) {\r\n\t\thooks._pendingEffects.forEach(invokeCleanup);\r\n\t\thooks._pendingEffects.forEach(invokeEffect);\r\n\t\thooks._pendingEffects = [];\r\n\t}\r\n};\r\n\r\noptions.diffed = vnode => {\r\n\tif (oldAfterDiff) oldAfterDiff(vnode);\r\n\r\n\tconst c = vnode._component;\r\n\tif (c && c.__hooks && c.__hooks._pendingEffects.length) {\r\n\t\tafterPaint(afterPaintEffects.push(c));\r\n\t}\r\n\tcurrentComponent = null;\r\n};\r\n\r\noptions._commit = (vnode, commitQueue) => {\r\n\tcommitQueue.some(component => {\r\n\t\ttry {\r\n\t\t\tcomponent._renderCallbacks.forEach(invokeCleanup);\r\n\t\t\tcomponent._renderCallbacks = component._renderCallbacks.filter(cb =>\r\n\t\t\t\tcb._value ? invokeEffect(cb) : true\r\n\t\t\t);\r\n\t\t} catch (e) {\r\n\t\t\tcommitQueue.some(c => {\r\n\t\t\t\tif (c._renderCallbacks) c._renderCallbacks = [];\r\n\t\t\t});\r\n\t\t\tcommitQueue = [];\r\n\t\t\toptions._catchError(e, component._vnode);\r\n\t\t}\r\n\t});\r\n\r\n\tif (oldCommit) oldCommit(vnode, commitQueue);\r\n};\r\n\r\noptions.unmount = vnode => {\r\n\tif (oldBeforeUnmount) oldBeforeUnmount(vnode);\r\n\r\n\tconst c = vnode._component;\r\n\tif (c && c.__hooks) {\r\n\t\tlet hasErrored;\r\n\t\tc.__hooks._list.forEach(s => {\r\n\t\t\ttry {\r\n\t\t\t\tinvokeCleanup(s);\r\n\t\t\t} catch (e) {\r\n\t\t\t\thasErrored = e;\r\n\t\t\t}\r\n\t\t});\r\n\t\tif (hasErrored) options._catchError(hasErrored, c._vnode);\r\n\t}\r\n};\r\n\r\n/**\r\n * Get a hook's state from the currentComponent\r\n * @param {number} index The index of the hook to get\r\n * @param {number} type The index of the hook to get\r\n * @returns {any}\r\n */\r\nfunction getHookState(index, type) {\r\n\tif (options._hook) {\r\n\t\toptions._hook(currentComponent, index, currentHook || type);\r\n\t}\r\n\tcurrentHook = 0;\r\n\r\n\t// Largely inspired by:\r\n\t// * https://github.com/michael-klein/funcy.js/blob/f6be73468e6ec46b0ff5aa3cc4c9baf72a29025a/src/hooks/core_hooks.mjs\r\n\t// * https://github.com/michael-klein/funcy.js/blob/650beaa58c43c33a74820a3c98b3c7079cf2e333/src/renderer.mjs\r\n\t// Other implementations to look at:\r\n\t// * https://codesandbox.io/s/mnox05qp8\r\n\tconst hooks =\r\n\t\tcurrentComponent.__hooks ||\r\n\t\t(currentComponent.__hooks = {\r\n\t\t\t_list: [],\r\n\t\t\t_pendingEffects: []\r\n\t\t});\r\n\r\n\tif (index >= hooks._list.length) {\r\n\t\thooks._list.push({});\r\n\t}\r\n\treturn hooks._list[index];\r\n}\r\n\r\n/**\r\n * @param {import('./index').StateUpdater} [initialState]\r\n */\r\nexport function useState(initialState) {\r\n\tcurrentHook = 1;\r\n\treturn useReducer(invokeOrReturn, initialState);\r\n}\r\n\r\n/**\r\n * @param {import('./index').Reducer} reducer\r\n * @param {import('./index').StateUpdater} initialState\r\n * @param {(initialState: any) => void} [init]\r\n * @returns {[ any, (state: any) => void ]}\r\n */\r\nexport function useReducer(reducer, initialState, init) {\r\n\t/** @type {import('./internal').ReducerHookState} */\r\n\tconst hookState = getHookState(currentIndex++, 2);\r\n\thookState._reducer = reducer;\r\n\tif (!hookState._component) {\r\n\t\thookState._value = [\r\n\t\t\t!init ? invokeOrReturn(undefined, initialState) : init(initialState),\r\n\r\n\t\t\taction => {\r\n\t\t\t\tconst nextValue = hookState._reducer(hookState._value[0], action);\r\n\t\t\t\tif (hookState._value[0] !== nextValue) {\r\n\t\t\t\t\thookState._value = [nextValue, hookState._value[1]];\r\n\t\t\t\t\thookState._component.setState({});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t];\r\n\r\n\t\thookState._component = currentComponent;\r\n\t}\r\n\r\n\treturn hookState._value;\r\n}\r\n\r\n/**\r\n * @param {import('./internal').Effect} callback\r\n * @param {any[]} args\r\n */\r\nexport function useEffect(callback, args) {\r\n\t/** @type {import('./internal').EffectHookState} */\r\n\tconst state = getHookState(currentIndex++, 3);\r\n\tif (!options._skipEffects && argsChanged(state._args, args)) {\r\n\t\tstate._value = callback;\r\n\t\tstate._args = args;\r\n\r\n\t\tcurrentComponent.__hooks._pendingEffects.push(state);\r\n\t}\r\n}\r\n\r\n/**\r\n * @param {import('./internal').Effect} callback\r\n * @param {any[]} args\r\n */\r\nexport function useLayoutEffect(callback, args) {\r\n\t/** @type {import('./internal').EffectHookState} */\r\n\tconst state = getHookState(currentIndex++, 4);\r\n\tif (!options._skipEffects && argsChanged(state._args, args)) {\r\n\t\tstate._value = callback;\r\n\t\tstate._args = args;\r\n\r\n\t\tcurrentComponent._renderCallbacks.push(state);\r\n\t}\r\n}\r\n\r\nexport function useRef(initialValue) {\r\n\tcurrentHook = 5;\r\n\treturn useMemo(() => ({ current: initialValue }), []);\r\n}\r\n\r\n/**\r\n * @param {object} ref\r\n * @param {() => object} createHandle\r\n * @param {any[]} args\r\n */\r\nexport function useImperativeHandle(ref, createHandle, args) {\r\n\tcurrentHook = 6;\r\n\tuseLayoutEffect(\r\n\t\t() => {\r\n\t\t\tif (typeof ref == 'function') ref(createHandle());\r\n\t\t\telse if (ref) ref.current = createHandle();\r\n\t\t},\r\n\t\targs == null ? args : args.concat(ref)\r\n\t);\r\n}\r\n\r\n/**\r\n * @param {() => any} factory\r\n * @param {any[]} args\r\n */\r\nexport function useMemo(factory, args) {\r\n\t/** @type {import('./internal').MemoHookState} */\r\n\tconst state = getHookState(currentIndex++, 7);\r\n\tif (argsChanged(state._args, args)) {\r\n\t\tstate._value = factory();\r\n\t\tstate._args = args;\r\n\t\tstate._factory = factory;\r\n\t}\r\n\r\n\treturn state._value;\r\n}\r\n\r\n/**\r\n * @param {() => void} callback\r\n * @param {any[]} args\r\n */\r\nexport function useCallback(callback, args) {\r\n\tcurrentHook = 8;\r\n\treturn useMemo(() => callback, args);\r\n}\r\n\r\n/**\r\n * @param {import('./internal').PreactContext} context\r\n */\r\nexport function useContext(context) {\r\n\tconst provider = currentComponent.context[context._id];\r\n\t// We could skip this call here, but than we'd not call\r\n\t// `options._hook`. We need to do that in order to make\r\n\t// the devtools aware of this hook.\r\n\t/** @type {import('./internal').ContextHookState} */\r\n\tconst state = getHookState(currentIndex++, 9);\r\n\t// The devtools needs access to the context object to\r\n\t// be able to pull of the default value when no provider\r\n\t// is present in the tree.\r\n\tstate._context = context;\r\n\tif (!provider) return context._defaultValue;\r\n\t// This is probably not safe to convert to \"!\"\r\n\tif (state._value == null) {\r\n\t\tstate._value = true;\r\n\t\tprovider.sub(currentComponent);\r\n\t}\r\n\treturn provider.props.value;\r\n}\r\n\r\n/**\r\n * Display a custom label for a custom hook for the devtools panel\r\n * @type {(value: T, cb?: (value: T) => string | number) => void}\r\n */\r\nexport function useDebugValue(value, formatter) {\r\n\tif (options.useDebugValue) {\r\n\t\toptions.useDebugValue(formatter ? formatter(value) : value);\r\n\t}\r\n}\r\n\r\n/**\r\n * @param {(error: any) => void} cb\r\n */\r\nexport function useErrorBoundary(cb) {\r\n\t/** @type {import('./internal').ErrorBoundaryHookState} */\r\n\tconst state = getHookState(currentIndex++, 10);\r\n\tconst errState = useState();\r\n\tstate._value = cb;\r\n\tif (!currentComponent.componentDidCatch) {\r\n\t\tcurrentComponent.componentDidCatch = err => {\r\n\t\t\tif (state._value) state._value(err);\r\n\t\t\terrState[1](err);\r\n\t\t};\r\n\t}\r\n\treturn [\r\n\t\terrState[0],\r\n\t\t() => {\r\n\t\t\terrState[1](undefined);\r\n\t\t}\r\n\t];\r\n}\r\n\r\n/**\r\n * After paint effects consumer.\r\n */\r\nfunction flushAfterPaintEffects() {\r\n\tlet component;\r\n\t// sort the queue by depth (outermost to innermost)\r\n\tafterPaintEffects.sort((a, b) => a._vnode._depth - b._vnode._depth);\r\n\twhile (component = afterPaintEffects.pop()) {\r\n\t\tif (!component._parentDom) continue;\r\n\t\ttry {\r\n\t\t\tcomponent.__hooks._pendingEffects.forEach(invokeCleanup);\r\n\t\t\tcomponent.__hooks._pendingEffects.forEach(invokeEffect);\r\n\t\t\tcomponent.__hooks._pendingEffects = [];\r\n\t\t} catch (e) {\r\n\t\t\tcomponent.__hooks._pendingEffects = [];\r\n\t\t\toptions._catchError(e, component._vnode);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nlet HAS_RAF = typeof requestAnimationFrame == 'function';\r\n\r\n/**\r\n * Schedule a callback to be invoked after the browser has a chance to paint a new frame.\r\n * Do this by combining requestAnimationFrame (rAF) + setTimeout to invoke a callback after\r\n * the next browser frame.\r\n *\r\n * Also, schedule a timeout in parallel to the the rAF to ensure the callback is invoked\r\n * even if RAF doesn't fire (for example if the browser tab is not visible)\r\n *\r\n * @param {() => void} callback\r\n */\r\nfunction afterNextFrame(callback) {\r\n\tconst done = () => {\r\n\t\tclearTimeout(timeout);\r\n\t\tif (HAS_RAF) cancelAnimationFrame(raf);\r\n\t\tsetTimeout(callback);\r\n\t};\r\n\tconst timeout = setTimeout(done, RAF_TIMEOUT);\r\n\r\n\tlet raf;\r\n\tif (HAS_RAF) {\r\n\t\traf = requestAnimationFrame(done);\r\n\t}\r\n}\r\n\r\n// Note: if someone used options.debounceRendering = requestAnimationFrame,\r\n// then effects will ALWAYS run on the NEXT frame instead of the current one, incurring a ~16ms delay.\r\n// Perhaps this is not such a big deal.\r\n/**\r\n * Schedule afterPaintEffects flush after the browser paints\r\n * @param {number} newQueueLength\r\n */\r\nfunction afterPaint(newQueueLength) {\r\n\tif (newQueueLength === 1 || prevRaf !== options.requestAnimationFrame) {\r\n\t\tprevRaf = options.requestAnimationFrame;\r\n\t\t(prevRaf || afterNextFrame)(flushAfterPaintEffects);\r\n\t}\r\n}\r\n\r\n/**\r\n * @param {import('./internal').EffectHookState} hook\r\n */\r\nfunction invokeCleanup(hook) {\r\n\t// A hook cleanup can introduce a call to render which creates a new root, this will call options.vnode\r\n\t// and move the currentComponent away.\r\n\tconst comp = currentComponent;\r\n\tlet cleanup = hook._cleanup;\r\n\tif (typeof cleanup == 'function') {\r\n\t\thook._cleanup = undefined;\r\n\t\tcleanup();\r\n\t}\r\n\tcurrentComponent = comp;\r\n}\r\n\r\n/**\r\n * Invoke a Hook's effect\r\n * @param {import('./internal').EffectHookState} hook\r\n */\r\nfunction invokeEffect(hook) {\r\n\t// A hook call can introduce a call to render which creates a new root, this will call options.vnode\r\n\t// and move the currentComponent away.\r\n\tconst comp = currentComponent;\r\n\thook._cleanup = hook._value();\r\n\tcurrentComponent = comp;\r\n}\r\n\r\n/**\r\n * @param {any[]} oldArgs\r\n * @param {any[]} newArgs\r\n */\r\nfunction argsChanged(oldArgs, newArgs) {\r\n\treturn (\r\n\t\t!oldArgs ||\r\n\t\toldArgs.length !== newArgs.length ||\r\n\t\tnewArgs.some((arg, index) => arg !== oldArgs[index])\r\n\t);\r\n}\r\n\r\nfunction invokeOrReturn(arg, f) {\r\n\treturn typeof f == 'function' ? f(arg) : f;\r\n}\r\n","import { h } from 'preact';\r\nimport { useCallback, useEffect, useRef, useState } from 'preact/hooks';\r\nimport { IFrame } from './iframe';\r\nimport { Overlay } from './Overlay';\r\nimport { TokenInfo } from './shared';\r\n\r\nexport interface OverlayContainerProps {\r\n // The base url of the script.\r\n baseUrl: string | null | undefined;\r\n}\r\n\r\ntype AuthState = 'Authenticated' | 'Failed' | 'Pending';\r\n\r\nconst UNSET = { x: Number.NEGATIVE_INFINITY, y: Number.NEGATIVE_INFINITY };\r\n\r\nexport const OverlayContainer = (props: OverlayContainerProps) => {\r\n const div = useRef();\r\n const [auth, setAuth] = useState<{ [url: string]: AuthState }>({});\r\n const [target, setTarget] = useState<{ target: HTMLElement, token: TokenInfo }>();\r\n const [targetUrl, setTargetUrl] = useState();\r\n const authRef = useRef(auth);\r\n \r\n useEffect(() => {\r\n let previousElement: any;\r\n let previousTarget: HTMLElement | undefined = undefined;\r\n let previousPosition = UNSET;\r\n\r\n const updateTarget = (target?: HTMLElement, token?: TokenInfo) => {\r\n if (target !== previousTarget) {\r\n if (target && token) {\r\n setTarget({ target, token });\r\n } else {\r\n setTarget(undefined);\r\n }\r\n\r\n previousTarget = target;\r\n }\r\n };\r\n\r\n function listen(event: MouseEvent) {\r\n const element = event.target as HTMLElement;\r\n\r\n if (!element || isToolbar(element)) {\r\n return;\r\n }\r\n\r\n const { token, target } = parseTokenInPath(element, Object.keys(authRef.current));\r\n const position = { x: event.clientX, y: event.clientY };\r\n\r\n if (token && target) { \r\n updateTarget(target, token);\r\n\r\n previousPosition = position;\r\n } else if (Math.abs(position.x - previousPosition.x) + Math.abs(position.y - previousPosition.y) > 20) {\r\n updateTarget(undefined, undefined);\r\n }\r\n\r\n previousElement = element;\r\n }\r\n\r\n document.addEventListener('mousemove', listen);\r\n\r\n return () => {\r\n document.removeEventListener('mousemove', listen);\r\n }\r\n }, []);\r\n\r\n const checkAuth = useCallback((url: string | null | undefined) => {\r\n if (!url) {\r\n return;\r\n }\r\n\r\n if (authRef.current[url]) {\r\n return;\r\n }\r\n\r\n const updateAuth = (state: AuthState) => {\r\n const newAuth = {\r\n ...authRef.current,\r\n [url]: state\r\n };\r\n\r\n authRef.current = newAuth;\r\n\r\n setAuth(newAuth);\r\n };\r\n\r\n if (url.indexOf('http://') === 0) {\r\n updateAuth('Authenticated');\r\n return;\r\n }\r\n\r\n const fetchStatus = async () => {\r\n updateAuth('Pending');\r\n\r\n try {\r\n const response = await fetch(`${url}/identity-server/info`, {\r\n credentials: 'include'\r\n });\r\n\r\n const json = await response.json();\r\n\r\n updateAuth(json.displayName ? 'Authenticated' : 'Failed');\r\n } catch {\r\n updateAuth('Failed');\r\n }\r\n };\r\n\r\n fetchStatus();\r\n }, [auth]);\r\n\r\n useEffect(() => {\r\n checkAuth(props.baseUrl);\r\n }, [props.baseUrl]);\r\n\r\n useEffect(() => {\r\n checkAuth(target?.token.u);\r\n }, [target?.token.u]);\r\n \r\n const isAuthenticated = auth[target?.token.u!] === 'Authenticated'\r\n\r\n return (\r\n
\r\n {target && isAuthenticated &&\r\n \r\n }\r\n\r\n {targetUrl &&\r\n \r\n
\r\n );\r\n};","import { h } from 'preact';\r\nimport { useEffect, useState, useMemo, useRef, useLayoutEffect } from 'preact/hooks';\r\nimport { TokenInfo } from './shared';\r\n\r\nexport interface OverlayProps {\r\n // The target element ot attach to.\r\n target: HTMLElement;\r\n\r\n // The token string.\r\n token: TokenInfo;\r\n\r\n // When opened.\r\n onOpen: (url: string) => void;\r\n}\r\n\r\nconst PADDING = 2;\r\n\r\nexport const Overlay = (props: OverlayProps) => {\r\n const { onOpen, target, token } = props;\r\n const toolbarRef = useRef();\r\n const linksRect = useRef();\r\n const targetRect = useRef();\r\n const [_, render] = useState(0);\r\n\r\n useEffect(() => {\r\n render(x => x + 1);\r\n }, [token]);\r\n\r\n useEffect(() => {\r\n function layout() {\r\n const rect = target.getBoundingClientRect();\r\n\r\n const current = targetRect.current;\r\n\r\n if (!current ||\r\n rect.height !== current.height ||\r\n rect.width !== current.width ||\r\n rect.x !== current.x ||\r\n rect.y !== current.y) {\r\n targetRect.current = rect;\r\n render(x => x + 1);\r\n }\r\n }\r\n\r\n document.body.addEventListener('scroll', layout);\r\n\r\n const timer = setInterval(() => {\r\n layout();\r\n }, 500);\r\n\r\n layout();\r\n\r\n return () => {\r\n clearInterval(timer);\r\n\r\n document.body.removeEventListener('scroll', layout);\r\n };\r\n }, [target]);\r\n\r\n useLayoutEffect(() => {\r\n if (!toolbarRef.current) {\r\n return;\r\n }\r\n\r\n const rect = toolbarRef.current.getBoundingClientRect();\r\n\r\n const current = linksRect.current;\r\n\r\n if (!current ||\r\n rect.height !== current.height ||\r\n rect.width !== current.width) {\r\n linksRect.current = rect;\r\n render(x => x + 1);\r\n }\r\n }, [render]);\r\n\r\n const externalUrl = useMemo(() => {\r\n let { a, i, s, u } = token;\r\n\r\n if (s) {\r\n return `${u}/app/${a}/content/${s}/${i}`;\r\n } else {\r\n return `${u}/app/${a}/assets/?ref=${i}`;\r\n }\r\n }, [token]);\r\n\r\n const embedUrl = useMemo(() => {\r\n let { a, i, s, u } = token;\r\n\r\n if (s) {\r\n return `${u}/embed/app/${a}/content/${s}/${i}`;\r\n } else {\r\n return `${u}/embed/app/${a}/assets/?ref=${i}`;\r\n }\r\n }, [token]);\r\n\r\n const x = (targetRect.current?.x || 0) - PADDING;\r\n const y = (targetRect.current?.y || 0) - PADDING;\r\n\r\n const overlayWidth = (targetRect.current?.width || 0) + 2 * PADDING;\r\n const overlayHeight = (targetRect.current?.height || 0) + 2 * PADDING;\r\n\r\n const toolbarWidth = (linksRect.current?.width || 0);\r\n const toolbarHeight = (linksRect.current?.height || 0);\r\n\r\n let linkX = x;\r\n let linkY = y - toolbarHeight + 2;\r\n\r\n if (linkY < 0) {\r\n linkY = y + overlayHeight - 2;\r\n }\r\n\r\n if (linkY + toolbarHeight > window.innerHeight) {\r\n linkX = window.innerHeight - toolbarHeight;\r\n }\r\n\r\n if (linkX < 0) {\r\n linkX = 0;\r\n }\r\n\r\n if (linkX + toolbarWidth > window.innerWidth) {\r\n linkX = window.innerWidth - toolbarWidth;\r\n }\r\n\r\n return (\r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n {token?.s || 'Asset'}\r\n
\r\n\r\n \r\n
\r\n
\r\n );\r\n};","/*\r\n * Squidex Headless CMS\r\n *\r\n * @license\r\n * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved.\r\n */\r\n\r\nexport function isArray(value: any): value is any[] {\r\n return Array.isArray(value);\r\n}\r\n\r\nexport function isString(value: any): value is string {\r\n return typeof value === 'string' || value instanceof String;\r\n}\r\n\r\nexport function isUndefined(value: any): value is undefined {\r\n return typeof value === 'undefined';\r\n}\r\n\r\nexport function isBoolean(value: any): value is boolean {\r\n return typeof value === 'boolean';\r\n}\r\n\r\nexport function isFunction(value: any): value is Function {\r\n return typeof value === 'function';\r\n}\r\n\r\nexport function isNumber(value: any): value is number {\r\n return typeof value === 'number' && Number.isFinite(value);\r\n}\r\n\r\nexport function isObject(value: any): value is Object {\r\n return value && typeof value === 'object' && value.constructor === Object;\r\n}\r\n\r\nexport function getBaseUrl() {\r\n let url = (document.currentScript as any)?.['src'] as string;\r\n\r\n if (!isString(url)) {\r\n return null;\r\n }\r\n\r\n url = url.trim();\r\n\r\n let indexOfHash = url.indexOf('/', 'https://'.length);\r\n\r\n if (indexOfHash > 0) {\r\n url = url.substring(0, indexOfHash);\r\n }\r\n\r\n return url;\r\n}"],"sourceRoot":""} \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Core.Tests/Model/Assets/AssetTests.cs b/backend/tests/Squidex.Domain.Apps.Core.Tests/Model/Assets/AssetTests.cs index af94e0052..23271719f 100644 --- a/backend/tests/Squidex.Domain.Apps.Core.Tests/Model/Assets/AssetTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Core.Tests/Model/Assets/AssetTests.cs @@ -143,6 +143,23 @@ public class AssetTests Assert.Same(asset_1, asset_2); } + [Fact] + public void Should_annotate_with_multiple_properties() + { + var newSlug = "my-file.png"; + var newFile = "My File"; + + var asset_1 = asset_0.Annotate(fileName: newFile, slug: newSlug); + var asset_2 = asset_1.Annotate(fileName: newFile, slug: newSlug); + + Assert.NotSame(asset_0, asset_1); + Assert.Equal(newSlug, asset_1.Slug); + Assert.Equal(newSlug, asset_2.Slug); + Assert.Equal(newFile, asset_1.FileName); + Assert.Equal(newFile, asset_2.FileName); + Assert.Same(asset_1, asset_2); + } + [Fact] public void Should_deserialize_state() { diff --git a/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/ConvertContent/FieldConvertersTests.cs b/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/ConvertContent/FieldConvertersTests.cs index 3fd39f2b7..68a03e3cc 100644 --- a/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/ConvertContent/FieldConvertersTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/ConvertContent/FieldConvertersTests.cs @@ -13,6 +13,8 @@ using Squidex.Domain.Apps.Core.TestHelpers; using Squidex.Infrastructure; using Squidex.Infrastructure.Json.Objects; +#pragma warning disable xUnit1044 // Avoid using TheoryData type arguments that are not serializable + namespace Squidex.Domain.Apps.Core.Operations.ConvertContent; public class FieldConvertersTests @@ -625,7 +627,7 @@ public class FieldConvertersTests var actual = new AddSchemaNames(components) - .ConvertItemAfter(field, source, Enumerable.Empty()); + .ConvertItemAfter(field, source, []); Assert.Equal(expected, actual); } diff --git a/backend/tests/Squidex.Domain.Apps.Core.Tests/Squidex.Domain.Apps.Core.Tests.csproj b/backend/tests/Squidex.Domain.Apps.Core.Tests/Squidex.Domain.Apps.Core.Tests.csproj index cec096fd0..c34bde1cc 100644 --- a/backend/tests/Squidex.Domain.Apps.Core.Tests/Squidex.Domain.Apps.Core.Tests.csproj +++ b/backend/tests/Squidex.Domain.Apps.Core.Tests/Squidex.Domain.Apps.Core.Tests.csproj @@ -16,19 +16,19 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + - - + + all runtime; build; native; contentfiles; analyzers diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Apps/DomainObject/Guards/GuardAppTests.cs b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Apps/DomainObject/Guards/GuardAppTests.cs index 7d41416e7..b1fb26a91 100644 --- a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Apps/DomainObject/Guards/GuardAppTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Apps/DomainObject/Guards/GuardAppTests.cs @@ -163,7 +163,7 @@ public class GuardAppTests : GivenContext, IClassFixture [Fact] public async Task CanTransfer_should_not_throw_exception_if_user_has_transfer_permission() { - var admin = Mocks.ApiUser(permission: PermissionIds.Transfer); + var admin = Mocks.ApiUser(permissions: [PermissionIds.Transfer]); var command = new TransferToTeam { TeamId = TeamId, Actor = User, User = admin }; diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Assets/Queries/EnrichForCachingTests.cs b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Assets/Queries/EnrichForCachingTests.cs index be809e6e0..7162ec246 100644 --- a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Assets/Queries/EnrichForCachingTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Assets/Queries/EnrichForCachingTests.cs @@ -38,6 +38,7 @@ public class EnrichForCachingTests : GivenContext "X-Languages", "X-NoCleanup", "X-NoEnrichment", + "X-NoDefaults", "X-NoResolveLanguages", "X-ResolveFlow", "X-ResolveUrls", diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Assets/SvgAssetMetadataSourceTests.cs b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Assets/SvgAssetMetadataSourceTests.cs index bd0ab7074..a4c24b55c 100644 --- a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Assets/SvgAssetMetadataSourceTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Assets/SvgAssetMetadataSourceTests.cs @@ -66,8 +66,24 @@ public class SvgAssetMetadataSourceTests : GivenContext Assert.Equal(20, command.Metadata[KnownMetadataKeys.PixelWidth].AsNumber); Assert.Equal(30, command.Metadata[KnownMetadataKeys.PixelHeight].AsNumber); - Assert.Equal("20", command.Metadata[KnownMetadataKeys.SvgWidth].AsString); - Assert.Equal("30", command.Metadata[KnownMetadataKeys.SvgHeight].AsString); + Assert.Equal(20, command.Metadata[KnownMetadataKeys.SvgWidth].AsNumber); + Assert.Equal(30, command.Metadata[KnownMetadataKeys.SvgHeight].AsNumber); + + Assert.Equal("0 0 100 100", command.Metadata[KnownMetadataKeys.SvgViewBox].AsString); + } + + [Fact] + public async Task Should_annote_with_non_numeric_dimensions() + { + var command = Command("SvgValidNonNumberSizes.svg"); + + await sut.EnhanceAsync(command, default); + + Assert.DoesNotContain(KnownMetadataKeys.PixelWidth, command.Metadata); + Assert.DoesNotContain(KnownMetadataKeys.PixelHeight, command.Metadata); + + Assert.Equal("20%", command.Metadata[KnownMetadataKeys.SvgWidth].AsString); + Assert.Equal("30%", command.Metadata[KnownMetadataKeys.SvgHeight].AsString); Assert.Equal("0 0 100 100", command.Metadata[KnownMetadataKeys.SvgViewBox].AsString); } @@ -103,7 +119,25 @@ public class SvgAssetMetadataSourceTests : GivenContext var formatted = sut.Format(source); - Assert.Equal(new[] { "128x55" }, formatted); + Assert.Equal(["128x55"], formatted); + } + + [Fact] + public void Should_describe_metadata_with_number() + { + var source = CreateAsset() with + { + Metadata = new AssetMetadata + { + [KnownMetadataKeys.SvgWidth] = 128, + [KnownMetadataKeys.SvgHeight] = 55 + }, + MimeType = "image/svg+xml" + }; + + var formatted = sut.Format(source); + + Assert.Equal(["128x55"], formatted); } private static UploadAssetCommand Command(string path) diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Assets/TestFiles/SvgValidNonNumberSizes.svg b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Assets/TestFiles/SvgValidNonNumberSizes.svg new file mode 100644 index 000000000..37568290f --- /dev/null +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Assets/TestFiles/SvgValidNonNumberSizes.svg @@ -0,0 +1,6 @@ + + + + 410 + + \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/DomainObject/Guards/GuardContentTests.cs b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/DomainObject/Guards/GuardContentTests.cs index a694473c9..57dc71332 100644 --- a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/DomainObject/Guards/GuardContentTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/DomainObject/Guards/GuardContentTests.cs @@ -311,10 +311,10 @@ public class GuardContentTests : GivenContext, IClassFixture userResolver.FindByIdAsync(A._, A._)) .MustNotHaveHappened(); } + + [Fact] + public async Task Should_expose_user_information_if_user_has_permission() + { + var assetId = DomainId.NewGuid(); + var asset = TestAsset.Create(assetId); + + A.CallTo(() => assetQuery.QueryAsync(MatchsAssetContext(), null, + A.That.HasIdsWithoutTotal(assetId), + A._)) + .Returns(ResultList.CreateFrom(1, asset)); + + var actual = await ExecuteAsync(new TestQuery + { + Query = @" + query { + findAsset(id: '{assetId}') { + createdByUser { + id, + email, + displayName + }, + lastModifiedByUser { + id, + email, + displayName + } + } + }", + Args = new + { + assetId + }, + Permissions = [PermissionIds.AppPii] + }); + + var expected = new + { + data = new + { + findAsset = new + { + createdByUser = new + { + id = asset.CreatedBy.Identifier, + email = $"{asset.CreatedBy.Identifier}@email.com", + displayName = $"{asset.CreatedBy.Identifier}name" + }, + lastModifiedByUser = new + { + id = asset.LastModifiedBy.Identifier, + email = $"{asset.LastModifiedBy}", + displayName = asset.LastModifiedBy.Identifier + } + } + } + }; + + AssertResult(expected, actual); + } } diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/GraphQL/GraphQLSubscriptionTests.cs b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/GraphQL/GraphQLSubscriptionTests.cs index ba9086c4d..7906d25ea 100644 --- a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/GraphQL/GraphQLSubscriptionTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/GraphQL/GraphQLSubscriptionTests.cs @@ -43,7 +43,7 @@ public class GraphQLSubscriptionTests : GraphQLTestBase fileSize } }", - Permission = PermissionIds.AppAssetsRead + Permissions = [PermissionIds.AppAssetsRead] }); var expected = new @@ -140,7 +140,7 @@ public class GraphQLSubscriptionTests : GraphQLTestBase data } }", - Permission = PermissionIds.AppContentsRead + Permissions = [PermissionIds.AppContentsRead] }); var expected = new diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/GraphQL/TestAsset.cs b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/GraphQL/TestAsset.cs index 79c1b6cca..f11308f78 100644 --- a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/GraphQL/TestAsset.cs +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/GraphQL/TestAsset.cs @@ -102,8 +102,8 @@ public static class TestAsset createdByUser = new { id = asset.CreatedBy.Identifier, - email = $"{asset.CreatedBy.Identifier}@email.com", - displayName = $"{asset.CreatedBy.Identifier}name" + email = "Hidden", + displayName = "Hidden" }, editToken = $"token_{asset.Id}", lastModified = asset.LastModified, @@ -111,8 +111,8 @@ public static class TestAsset lastModifiedByUser = new { id = asset.LastModifiedBy.Identifier, - email = $"{asset.LastModifiedBy}", - displayName = asset.LastModifiedBy.Identifier + email = "Hidden", + displayName = "Hidden" }, url = $"assets/{asset.AppId.Name}/{asset.Id}", thumbnailUrl = $"assets/{asset.AppId.Name}/{asset.Id}?width=100", diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/GraphQL/TestContent.cs b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/GraphQL/TestContent.cs index ea116a863..1433202de 100644 --- a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/GraphQL/TestContent.cs +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/GraphQL/TestContent.cs @@ -405,8 +405,8 @@ public static class TestContent createdByUser = new { id = content.CreatedBy.Identifier, - email = $"{content.CreatedBy.Identifier}@email.com", - displayName = $"{content.CreatedBy.Identifier}name" + email = "Hidden", + displayName = "Hidden" }, editToken = $"token_{content.Id}", lastModified = content.LastModified, @@ -414,8 +414,8 @@ public static class TestContent lastModifiedByUser = new { id = content.LastModifiedBy.Identifier, - email = $"{content.LastModifiedBy}", - displayName = content.LastModifiedBy.Identifier + email = "Hidden", + displayName = "Hidden" }, status = "DRAFT", statusColor = "red", @@ -437,8 +437,8 @@ public static class TestContent createdByUser = new { id = content.CreatedBy.Identifier, - email = $"{content.CreatedBy.Identifier}@email.com", - displayName = $"{content.CreatedBy.Identifier}name" + email = "Hidden", + displayName = "Hidden", }, editToken = $"token_{content.Id}", lastModified = content.LastModified, @@ -446,8 +446,8 @@ public static class TestContent lastModifiedByUser = new { id = content.LastModifiedBy.Identifier, - email = $"{content.LastModifiedBy}", - displayName = content.LastModifiedBy.Identifier + email = "Hidden", + displayName = "Hidden", }, status = "DRAFT", statusColor = "red", diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/GraphQL/TestQuery.cs b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/GraphQL/TestQuery.cs index 6867837d0..98dbebc3a 100644 --- a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/GraphQL/TestQuery.cs +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/GraphQL/TestQuery.cs @@ -26,7 +26,7 @@ public sealed class TestQuery public object? Args { get; set; } - public string? Permission { get; set; } + public string[] Permissions { get; set; } = []; public string? OperationName { get; set; } @@ -42,16 +42,21 @@ public sealed class TestQuery } } + query = query.Replace('\'', '\"'); + + var userPermissions = Permissions.Select(p => PermissionIds.ForApp(p, TestApp.Default.Name, TestSchemas.Default.Name).Id); + var userPrincipal = Mocks.FrontendUser(null, userPermissions.ToArray()); + + var context = new Context(userPrincipal, TestApp.Default); + var options = new ExecutionOptions { - Query = query.Replace('\'', '\"') + Query = query, + User = userPrincipal, + UserContext = ActivatorUtilities.CreateInstance(services, context), + OperationName = OperationName, }; - if (OperationName != null) - { - options.OperationName = OperationName; - } - if (Variables != null) { options.Variables = Serializer.ReadNode(Serialize(Variables))!; @@ -62,25 +67,11 @@ public sealed class TestQuery options.Listeners.Add(listener); } - options.UserContext = ActivatorUtilities.CreateInstance(services, BuildContext(Permission)); - return options; + } - static Context BuildContext(string? permissionId) - { - if (permissionId == null) - { - return new Context(Mocks.FrontendUser(), TestApp.Default); - } - - var permission = PermissionIds.ForApp(permissionId, TestApp.Default.Name, TestSchemas.Default.Name).Id; - - return new Context(Mocks.FrontendUser(permission: permission), TestApp.Default); - } - - static JsonElement Serialize(object value) - { - return JsonSerializer.SerializeToElement(value, TestUtils.DefaultOptions()); - } + private static JsonElement Serialize(object value) + { + return JsonSerializer.SerializeToElement(value, TestUtils.DefaultOptions()); } } diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/MongoDb/ExtensionsTests.cs b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/MongoDb/ExtensionsTests.cs index 682390102..48206b17e 100644 --- a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/MongoDb/ExtensionsTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/MongoDb/ExtensionsTests.cs @@ -22,7 +22,7 @@ public class ExtensionsTests [Fact] public void Should_build_projection_without_fields() { - var projection = ExtensionSut.BuildProjection2(null); + var projection = ExtensionSut.BuildProjection(null); AssertProjection(projection, "{ 'dd' : 0 }"); } @@ -30,7 +30,7 @@ public class ExtensionsTests [Fact] public void Should_build_projection_with_data_prefix() { - var projection = ExtensionSut.BuildProjection2(["data.myField"]); + var projection = ExtensionSut.BuildProjection(["data.myField"]); AssertProjection(projection, "{ '_ai' : 1, '_id' : 1, '_si' : 1, 'ai' : 1, 'cb' : 1, 'ct' : 1, 'dl' : 1, 'do.myField' : 1, 'id' : 1, 'is' : 1, 'mb' : 1, 'mt' : 1, 'ns' : 1, 'rf' : 1, 'sa' : 1, 'si' : 1, 'sj' : 1, 'ss' : 1, 'ts' : 1, 'vs' : 1 }"); } @@ -38,7 +38,7 @@ public class ExtensionsTests [Fact] public void Should_build_projection_without_data_prefix() { - var projection = ExtensionSut.BuildProjection2(["myField"]); + var projection = ExtensionSut.BuildProjection(["myField"]); AssertProjection(projection, "{ '_ai' : 1, '_id' : 1, '_si' : 1, 'ai' : 1, 'cb' : 1, 'ct' : 1, 'dl' : 1, 'do.myField' : 1, 'id' : 1, 'is' : 1, 'mb' : 1, 'mt' : 1, 'ns' : 1, 'rf' : 1, 'sa' : 1, 'si' : 1, 'sj' : 1, 'ss' : 1, 'ts' : 1, 'vs' : 1 }"); } @@ -46,11 +46,35 @@ public class ExtensionsTests [Fact] public void Should_build_projection_without_included_field() { - var projection = ExtensionSut.BuildProjection2(["myField.special", "myField"]); + var projection = ExtensionSut.BuildProjection(["myField.special", "myField"]); AssertProjection(projection, "{ '_ai' : 1, '_id' : 1, '_si' : 1, 'ai' : 1, 'cb' : 1, 'ct' : 1, 'dl' : 1, 'do.myField' : 1, 'id' : 1, 'is' : 1, 'mb' : 1, 'mt' : 1, 'ns' : 1, 'rf' : 1, 'sa' : 1, 'si' : 1, 'sj' : 1, 'ss' : 1, 'ts' : 1, 'vs' : 1 }"); } + [Fact] + public void Should_build_projection_with_prefix_field() + { + var projection = ExtensionSut.BuildProjection(["myField", "myField2"]); + + AssertProjection(projection, "{ '_ai' : 1, '_id' : 1, '_si' : 1, 'ai' : 1, 'cb' : 1, 'ct' : 1, 'dl' : 1, 'do.myField' : 1, 'do.myField2' : 1, 'id' : 1, 'is' : 1, 'mb' : 1, 'mt' : 1, 'ns' : 1, 'rf' : 1, 'sa' : 1, 'si' : 1, 'sj' : 1, 'ss' : 1, 'ts' : 1, 'vs' : 1 }"); + } + + [Fact] + public void Should_build_projection_with_status_data_field() + { + var projection = ExtensionSut.BuildProjection(["data.Status"]); + + AssertProjection(projection, "{ '_ai' : 1, '_id' : 1, '_si' : 1, 'ai' : 1, 'cb' : 1, 'ct' : 1, 'dl' : 1, 'do.Status' : 1, 'id' : 1, 'is' : 1, 'mb' : 1, 'mt' : 1, 'ns' : 1, 'rf' : 1, 'sa' : 1, 'si' : 1, 'sj' : 1, 'ss' : 1, 'ts' : 1, 'vs' : 1 }"); + } + + [Fact] + public void Should_build_projection_with_meta_status_field() + { + var projection = ExtensionSut.BuildProjection(["status"]); + + AssertProjection(projection, "{ '_ai' : 1, '_id' : 1, '_si' : 1, 'ai' : 1, 'cb' : 1, 'ct' : 1, 'dl' : 1, 'do.status' : 1, 'id' : 1, 'is' : 1, 'mb' : 1, 'mt' : 1, 'ns' : 1, 'rf' : 1, 'sa' : 1, 'si' : 1, 'sj' : 1, 'ss' : 1, 'ts' : 1, 'vs' : 1 }"); + } + private static void AssertProjection(ProjectionDefinition projection, string expected) { var rendered = diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/Queries/CalculatePreviewTextTests.cs b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/Queries/CalculatePreviewTextTests.cs index 655677449..a4ff7cc18 100644 --- a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/Queries/CalculatePreviewTextTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/Queries/CalculatePreviewTextTests.cs @@ -30,7 +30,7 @@ public class CalculatePreviewTextTests : GivenContext { var content = CreateContentWithData(); - await sut.EnrichAsync(ApiContext, new[] { content }, SchemaProvider(), CancellationToken); + await sut.EnrichAsync(ApiContext, [content], SchemaProvider(), CancellationToken); Assert.Equal("Text1Text2", content.ReferenceData!["richText"]!["en"]); Assert.Equal("Text3Text4", content.ReferenceData!["richText"]!["de"]); @@ -41,7 +41,7 @@ public class CalculatePreviewTextTests : GivenContext { var content = CreateContent(); - await sut.EnrichAsync(ApiContext, new[] { content }, SchemaProvider(), CancellationToken); + await sut.EnrichAsync(ApiContext, [content], SchemaProvider(), CancellationToken); Assert.Null(content.ReferenceData); } diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/Queries/EnrichForCachingTests.cs b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/Queries/EnrichForCachingTests.cs index fda5c4105..5387119f9 100644 --- a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/Queries/EnrichForCachingTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/Queries/EnrichForCachingTests.cs @@ -39,6 +39,7 @@ public class EnrichForCachingTests : GivenContext "X-Languages", "X-NoCleanup", "X-NoEnrichment", + "X-NoDefaults", "X-NoResolveLanguages", "X-ResolveFlow", "X-ResolveUrls", diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Schemas/SchemasChatToolTests.cs b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Schemas/SchemasChatToolTests.cs index 061d17086..34750d050 100644 --- a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Schemas/SchemasChatToolTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Schemas/SchemasChatToolTests.cs @@ -31,13 +31,13 @@ public class SchemasChatToolTests : GivenContext BaseContext = CreateContext(PermissionIds.ForApp(PermissionIds.AppSchemasRead, App.Name).Id) }; - var tool = await sut.GetToolsAsync(chatContext, default).FirstOrDefaultAsync(); + var tool = await sut.GetToolsAsync(chatContext, CancellationToken).FirstOrDefaultAsync(CancellationToken); Assert.NotNull(tool); Assert.Equal("schemas", tool.Spec.Name); Assert.Equal("Schemas", tool.Spec.DisplayName); - var result = await tool.ExecuteAsync(Activator.CreateInstance(), default); + var result = await tool.ExecuteAsync(Activator.CreateInstance(), CancellationToken); Assert.Contains(Schema.Name, result, StringComparison.Ordinal); @@ -56,7 +56,7 @@ public class SchemasChatToolTests : GivenContext BaseContext = FrontendContext }; - var tool = await sut.GetToolsAsync(chatContext, default).FirstOrDefaultAsync(); + var tool = await sut.GetToolsAsync(chatContext, CancellationToken).FirstOrDefaultAsync(CancellationToken); Assert.Null(tool); } diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Squidex.Domain.Apps.Entities.Tests.csproj b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Squidex.Domain.Apps.Entities.Tests.csproj index 716e85dcb..b5212d3d9 100644 --- a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Squidex.Domain.Apps.Entities.Tests.csproj +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Squidex.Domain.Apps.Entities.Tests.csproj @@ -24,24 +24,24 @@ - - + + - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + - - - + + + all runtime; build; native; contentfiles; analyzers @@ -70,6 +70,9 @@ PreserveNewest + + PreserveNewest + PreserveNewest diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/TestHelpers/Mocks.cs b/backend/tests/Squidex.Domain.Apps.Entities.Tests/TestHelpers/Mocks.cs index 6bdaf996b..5b0f96318 100644 --- a/backend/tests/Squidex.Domain.Apps.Entities.Tests/TestHelpers/Mocks.cs +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/TestHelpers/Mocks.cs @@ -19,21 +19,11 @@ public static class Mocks return CreateUser(false, role, permissions); } - public static ClaimsPrincipal ApiUser(string? role = null, string? permission = null) - { - return CreateUser(false, role, permission); - } - public static ClaimsPrincipal FrontendUser(string? role = null, params string[] permissions) { return CreateUser(true, role, permissions); } - public static ClaimsPrincipal FrontendUser(string? role = null, string? permission = null) - { - return CreateUser(true, role, permission); - } - public static ClaimsPrincipal CreateUser(bool isFrontend, string? role, params string?[] permissions) { var claimsIdentity = new ClaimsIdentity(); diff --git a/backend/tests/Squidex.Domain.Users.Tests/Squidex.Domain.Users.Tests.csproj b/backend/tests/Squidex.Domain.Users.Tests/Squidex.Domain.Users.Tests.csproj index 09237c653..24fb96432 100644 --- a/backend/tests/Squidex.Domain.Users.Tests/Squidex.Domain.Users.Tests.csproj +++ b/backend/tests/Squidex.Domain.Users.Tests/Squidex.Domain.Users.Tests.csproj @@ -16,15 +16,15 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + - - + + all runtime; build; native; contentfiles; analyzers diff --git a/backend/tests/Squidex.Infrastructure.Tests/Net/IPAddressComparerTests.cs b/backend/tests/Squidex.Infrastructure.Tests/Net/IPAddressComparerTests.cs index d125f5519..51dba7062 100644 --- a/backend/tests/Squidex.Infrastructure.Tests/Net/IPAddressComparerTests.cs +++ b/backend/tests/Squidex.Infrastructure.Tests/Net/IPAddressComparerTests.cs @@ -24,7 +24,7 @@ public class IPAddressComparerTests IPAddress.Parse("127.0.0.200") }; - var sorted = source.OrderBy(x => x, IPAddressComparer.Instance); + var sorted = source.Order(IPAddressComparer.Instance); var expected = new[] { diff --git a/backend/tests/Squidex.Infrastructure.Tests/Reflection/ReflectionExtensionTests.cs b/backend/tests/Squidex.Infrastructure.Tests/Reflection/ReflectionExtensionTests.cs index ffc39e4f1..1cb772265 100644 --- a/backend/tests/Squidex.Infrastructure.Tests/Reflection/ReflectionExtensionTests.cs +++ b/backend/tests/Squidex.Infrastructure.Tests/Reflection/ReflectionExtensionTests.cs @@ -34,7 +34,7 @@ public class ReflectionExtensionTests [Fact] public void Should_find_all_public_properties_of_interfaces() { - var properties = typeof(IMyMain).GetPublicProperties().Select(x => x.Name).OrderBy(x => x).ToArray(); + var properties = typeof(IMyMain).GetPublicProperties().Select(x => x.Name).Order().ToArray(); Assert.Equal(new[] { "MainProp", "Sub1Prop", "Sub2Prop" }, properties); } @@ -42,7 +42,7 @@ public class ReflectionExtensionTests [Fact] public void Should_find_all_public_properties_of_classes() { - var properties = typeof(MyMain).GetPublicProperties().Select(x => x.Name).OrderBy(x => x).ToArray(); + var properties = typeof(MyMain).GetPublicProperties().Select(x => x.Name).Order().ToArray(); Assert.Equal(new[] { "MainProp" }, properties); } diff --git a/backend/tests/Squidex.Infrastructure.Tests/Security/PermissionTests.cs b/backend/tests/Squidex.Infrastructure.Tests/Security/PermissionTests.cs index 267b151dc..088c71666 100644 --- a/backend/tests/Squidex.Infrastructure.Tests/Security/PermissionTests.cs +++ b/backend/tests/Squidex.Infrastructure.Tests/Security/PermissionTests.cs @@ -158,7 +158,7 @@ public class PermissionTests new Permission("a") }; - var sorted = source.OrderBy(x => x).ToList(); + var sorted = source.Order().ToList(); Assert.Equal([source[2], source[1], source[0]], sorted); } diff --git a/backend/tests/Squidex.Infrastructure.Tests/Squidex.Infrastructure.Tests.csproj b/backend/tests/Squidex.Infrastructure.Tests/Squidex.Infrastructure.Tests.csproj index a5f8f54cc..398450e13 100644 --- a/backend/tests/Squidex.Infrastructure.Tests/Squidex.Infrastructure.Tests.csproj +++ b/backend/tests/Squidex.Infrastructure.Tests/Squidex.Infrastructure.Tests.csproj @@ -16,7 +16,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive @@ -24,12 +24,12 @@ - + - - + + all runtime; build; native; contentfiles; analyzers diff --git a/backend/tests/Squidex.Infrastructure.Tests/Tasks/SchedulerTests.cs b/backend/tests/Squidex.Infrastructure.Tests/Tasks/SchedulerTests.cs index a93b2f4ec..5657b3413 100644 --- a/backend/tests/Squidex.Infrastructure.Tests/Tasks/SchedulerTests.cs +++ b/backend/tests/Squidex.Infrastructure.Tests/Tasks/SchedulerTests.cs @@ -38,7 +38,7 @@ public class SchedulerTests await limited.CompleteAsync(); - Assert.Equal(Enumerable.Range(1, 10).ToArray(), actuals.OrderBy(x => x).ToArray()); + Assert.Equal(Enumerable.Range(1, 10).ToArray(), actuals.Order().ToArray()); } [Fact] @@ -49,7 +49,7 @@ public class SchedulerTests await sut.CompleteAsync(); - Assert.Equal(new[] { 1, 2 }, actuals.OrderBy(x => x).ToArray()); + Assert.Equal(new[] { 1, 2 }, actuals.Order().ToArray()); } [Fact] @@ -60,7 +60,7 @@ public class SchedulerTests await sut.CompleteAsync(); - Assert.Equal(new[] { 1, 2 }, actuals.OrderBy(x => x).ToArray()); + Assert.Equal(new[] { 1, 2 }, actuals.Order().ToArray()); } [Fact] @@ -84,7 +84,7 @@ public class SchedulerTests await sut.CompleteAsync(); - Assert.Equal(new[] { 1, 2, 3 }, actuals.OrderBy(x => x).ToArray()); + Assert.Equal(new[] { 1, 2, 3 }, actuals.Order().ToArray()); } [Fact] @@ -96,7 +96,7 @@ public class SchedulerTests ScheduleAsync(3, sut); - Assert.Equal(new[] { 1 }, actuals.OrderBy(x => x).ToArray()); + Assert.Equal(new[] { 1 }, actuals.Order().ToArray()); } private void ScheduleAsync(int value, Scheduler target) diff --git a/backend/tests/Squidex.Web.Tests/Squidex.Web.Tests.csproj b/backend/tests/Squidex.Web.Tests/Squidex.Web.Tests.csproj index ee1e78341..00f4f34df 100644 --- a/backend/tests/Squidex.Web.Tests/Squidex.Web.Tests.csproj +++ b/backend/tests/Squidex.Web.Tests/Squidex.Web.Tests.csproj @@ -16,14 +16,14 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + - - + + all runtime; build; native; contentfiles; analyzers diff --git a/frontend/.storybook/main.js b/frontend/.storybook/main.js index 479553f12..adf217b4e 100644 --- a/frontend/.storybook/main.js +++ b/frontend/.storybook/main.js @@ -24,9 +24,11 @@ module.exports = { */ config.plugins.push(new CopyPlugin({ patterns: [ - { from: './node_modules/ace-builds/src-min/', to: 'dependencies/ace/' }, + { from: './node_modules/ace-builds/src-min/', to: './dependencies/ace/' }, ] })); + + config.resolve?.extensions?.push('.d.ts'); return config; }, docs: { diff --git a/frontend/.storybook/tsconfig.json b/frontend/.storybook/tsconfig.json index b17c798fe..737aed524 100644 --- a/frontend/.storybook/tsconfig.json +++ b/frontend/.storybook/tsconfig.json @@ -1,9 +1,6 @@ { "extends": "../tsconfig.app.json", "compilerOptions": { - "types": [ - "node" - ], "allowSyntheticDefaultImports": true }, "exclude": [ diff --git a/frontend/angular.json b/frontend/angular.json index 45ff39f66..78335cae9 100644 --- a/frontend/angular.json +++ b/frontend/angular.json @@ -127,7 +127,7 @@ "inlineCritical": false }, "fonts": true - }, + } }, "development": { "extractLicenses": false, diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 6cf5c03fd..3d833a428 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -23,8 +23,8 @@ "@floating-ui/dom": "^1.6.5", "@graphiql/toolkit": "^0.9.1", "@iharbeck/ngx-virtual-scroller": "^17.0.2", - "@lithiumjs/angular": "^7.3.1", - "@lithiumjs/ngx-virtual-scroll": "^0.3.1", + "@lithiumjs/angular": "^8.0.0", + "@lithiumjs/ngx-virtual-scroll": "^0.3.2", "@marker.io/browser": "^0.19.0", "@types/ace": "^0.0.52", "ace-builds": "^1.34.2", @@ -49,7 +49,7 @@ "ng2-charts": "^6.0.1", "ngx-color-picker": "16.0.0", "ngx-doc-viewer": "15.0.1", - "ngx-ui-tour-core": "^12.0.2", + "ngx-ui-tour-core": "13.0.0", "oidc-client-ts": "^3.0.1", "pikaday": "1.8.2", "progressbar.js": "1.1.1", @@ -5040,28 +5040,28 @@ } }, "node_modules/@lithiumjs/angular": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/@lithiumjs/angular/-/angular-7.3.1.tgz", - "integrity": "sha512-CyQgejaAFovPL821tPpNSTbOhHo9wpwWyyq4s51S4ILS8bHeJ9IGhbNksjWFClD11CHj23pxjFuChSBo7eFt2A==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/@lithiumjs/angular/-/angular-8.0.0.tgz", + "integrity": "sha512-wSnXjLuek1Ng1XqhmOaE4Pl6YwP1CJDL1iL9CI0Bb1Eo6ZPM1nvb9yRwC2W6CYdpk8FhDs0Wtm3ZfBnSp3g9AA==", "dependencies": { "tslib": "^2.3.0" }, "peerDependencies": { - "@angular/core": ">=11.0.0 <18.0.0", + "@angular/core": ">=15.0.0 <19.0.0", "rxjs": ">=7.x.x", - "typescript": ">=4.1.0" + "typescript": ">=4.8.0" } }, "node_modules/@lithiumjs/ngx-virtual-scroll": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/@lithiumjs/ngx-virtual-scroll/-/ngx-virtual-scroll-0.3.1.tgz", - "integrity": "sha512-HYZ9yl+U8dcK9W97epj5bxT1vgh51NF01DtY1eY+OYYWVysCGqNusvSpmpiSVO0OH99ghsu7i7/nlY7cbQbtjg==", + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/@lithiumjs/ngx-virtual-scroll/-/ngx-virtual-scroll-0.3.2.tgz", + "integrity": "sha512-4cGuG8n5rdsgziaorKrKQ5Rew/+BNyBfmMEffgxi+2NLRvIZusuDgEEJBIk9WK09gPTg+sEwpiWW1SmKL2iWnw==", "dependencies": { "tslib": "^2.3.0" }, "peerDependencies": { - "@angular/common": "8.x.x - 17.x.x", - "@angular/core": "8.x.x - 17.x.x", + "@angular/common": "8.x.x - 18.x.x", + "@angular/core": "8.x.x - 18.x.x", "@lithiumjs/angular": ">=7.0.0", "rxjs": "6.x.x - 7.x.x" } @@ -20655,16 +20655,16 @@ } }, "node_modules/ngx-ui-tour-core": { - "version": "12.0.2", - "resolved": "https://registry.npmjs.org/ngx-ui-tour-core/-/ngx-ui-tour-core-12.0.2.tgz", - "integrity": "sha512-x5TOu4mtjojga+ht5LraQU+vOc4by4gof6TKGXDXsyW3kgWXqf7iJm5GUR+aLk7cr9FWdQYVUU+yTUmlI7XhOQ==", + "version": "13.0.0", + "resolved": "https://registry.npmjs.org/ngx-ui-tour-core/-/ngx-ui-tour-core-13.0.0.tgz", + "integrity": "sha512-svtp3zMoOnkGPL6eBKtJX3gsIir8aJzVg5KfSKNVO4ZMHGgh+MK55WfvmX8juv3gSJMBCMZta5b/7gjEn2g/Iw==", "dependencies": { "tslib": "^2.0.0" }, "peerDependencies": { - "@angular/common": "^17.0.0", - "@angular/core": "^17.0.0", - "@angular/router": "^17.0.0", + "@angular/common": "^18.0.0", + "@angular/core": "^18.0.0", + "@angular/router": "^18.0.0", "rxjs": "^7.4.0" } }, diff --git a/frontend/package.json b/frontend/package.json index ad1c8a8c4..8481e96ce 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -30,10 +30,9 @@ "@floating-ui/dom": "^1.6.5", "@graphiql/toolkit": "^0.9.1", "@iharbeck/ngx-virtual-scroller": "^17.0.2", - "@lithiumjs/angular": "^7.3.1", - "@lithiumjs/ngx-virtual-scroll": "^0.3.1", + "@lithiumjs/angular": "^8.0.0", + "@lithiumjs/ngx-virtual-scroll": "^0.3.2", "@marker.io/browser": "^0.19.0", - "@types/ace": "^0.0.52", "ace-builds": "^1.34.2", "angular-gridster2": "18.0.1", "angular-mentions": "1.5.0", @@ -56,7 +55,7 @@ "ng2-charts": "^6.0.1", "ngx-color-picker": "16.0.0", "ngx-doc-viewer": "15.0.1", - "ngx-ui-tour-core": "^12.0.2", + "ngx-ui-tour-core": "13.0.0", "oidc-client-ts": "^3.0.1", "pikaday": "1.8.2", "progressbar.js": "1.1.1", @@ -95,6 +94,7 @@ "@storybook/addon-links": "^8.1.5", "@storybook/angular": "^8.1.5", "@storybook/testing-library": "^0.2.2", + "@types/ace": "^0.0.52", "@types/codemirror": "5.60.15", "@types/core-js": "2.5.8", "@types/jasmine": "5.1.4", diff --git a/frontend/src/app/features/administration/pages/event-consumers/event-consumers-page.component.html b/frontend/src/app/features/administration/pages/event-consumers/event-consumers-page.component.html index 271236a57..9013592b5 100644 --- a/frontend/src/app/features/administration/pages/event-consumers/event-consumers-page.component.html +++ b/frontend/src/app/features/administration/pages/event-consumers/event-consumers-page.component.html @@ -50,6 +50,7 @@ } + @if (info) {
- diff --git a/frontend/src/app/features/assets/pages/assets-page.component.html b/frontend/src/app/features/assets/pages/assets-page.component.html index a23290457..b99050650 100644 --- a/frontend/src/app/features/assets/pages/assets-page.component.html +++ b/frontend/src/app/features/assets/pages/assets-page.component.html @@ -62,6 +62,7 @@
@@ -115,14 +119,60 @@ [percents]="contentForm.translationStatus | async"> } @@ -188,6 +238,7 @@ ; private autoSaveKey!: AutoSaveKey; + private autoSaveIgnore = false; public schema!: SchemaDto; public formContext: any; public contentTab = this.route.queryParams.pipe(map(x => x['tab'] || 'editor')); - public content?: ContentDto | null; public contentId = ''; + public content?: ContentDto | null; public contentVersion: Version | null = null; public contentForm!: EditContentForm; public contentFormCompare: EditContentForm | null = null; + public saveOnlyDropdown = new ModalModel(); + public savePublishDropdown = new ModalModel(); public dropdown = new ModalModel(); @@ -103,7 +109,7 @@ export class ContentPageComponent implements CanComponentDeactivate, OnInit { ) { const role = appsState.snapshot.selectedApp?.roleName; - this.formContext = { + this.mutableContext = { apiUrl: apiUrl.buildUrl('api'), appId: contentsState.appId, appName: contentsState.appName, @@ -158,10 +164,10 @@ export class ContentPageComponent implements CanComponentDeactivate, OnInit { this.schema = schema; const languageKey = this.localStore.get(this.languageKey()); - const language = this.languages.find(x => x.iso2Code === languageKey); + const languageItem = this.languages.find(x => x.iso2Code === languageKey); - if (language) { - this.language = language; + if (languageItem) { + this.language = languageItem; } this.contentForm = new EditContentForm(this.languages, this.schema, this.schemasState.schemaMap, this.formContext); @@ -172,12 +178,9 @@ export class ContentPageComponent implements CanComponentDeactivate, OnInit { .subscribe(content => { const isNewContent = isOtherContent(content, this.content); - this.formContext['languages'] = this.languages; - this.formContext['schema'] = this.schema; - this.formContext['initialContent'] = content; - this.contentForm.setContext(this.formContext); - this.content = content; + this.updateContext(); + this.contentForm.setContext(this.formContext); this.autoSaveKey = { schemaId: this.schema.id, @@ -221,6 +224,14 @@ export class ContentPageComponent implements CanComponentDeactivate, OnInit { })); } + private updateContext() { + this.mutableContext['initialContent'] = this.content; + this.mutableContext['language'] = this.language; + this.mutableContext['languages'] = this.languages; + this.mutableContext['schema'] = this.schema; + this.formContext = { ...this.mutableContext }; + } + public canDeactivate(): Observable { return this.checkPendingChangesBeforeClose().pipe( tap(confirmed => { @@ -231,52 +242,67 @@ export class ContentPageComponent implements CanComponentDeactivate, OnInit { ); } - public saveAndPublish() { - this.saveContent(true); + public saveAndPublish(navigationMode: SaveNavigationMode) { + this.saveContent(true, navigationMode); } - public save() { - this.saveContent(false); + public saveAsDraft(navigationMode: SaveNavigationMode) { + this.saveContent(false, navigationMode); } - private saveContent(publish: boolean) { + private saveContent(publish: boolean, navigationMode: SaveNavigationMode) { const value = this.contentForm.submit(); - if (value) { - if (this.content) { - if (!this.content.canUpdate) { - return; - } - - this.contentsState.update(this.content, value) - .subscribe({ - next: () => { - this.contentForm.submitCompleted({ noReset: true }); - }, - error: error => { - this.contentForm.submitFailed(error); - }, - }); - } else { - if (!this.canCreate(publish)) { - return; - } + if (!value) { + this.contentForm.submitFailed('i18n:contents.contentNotValid', false); + return; + } - this.contentsState.create(value, publish, this.contentId) - .subscribe({ - next: content => { - this.contentForm.submitCompleted({ noReset: true }); - this.contentForm.load(content.data, true); - - this.router.navigate([content.id, 'history'], { relativeTo: this.route.parent! }); - }, - error: error => { - this.contentForm.submitFailed(error); - }, - }); + if (this.content) { + if (!this.content.canUpdate) { + return; } + + this.contentsState.update(this.content, value) + .subscribe({ + next: () => { + this.contentForm.submitCompleted({ noReset: true }); + }, + error: error => { + this.contentForm.submitFailed(error); + }, + }); } else { - this.contentForm.submitFailed('i18n:contents.contentNotValid', false); + if (!this.canCreate(publish)) { + return; + } + + this.contentsState.create(value, publish, this.contentId) + .subscribe({ + next: content => { + switch (navigationMode) { + case 'Add': + this.contentForm = new EditContentForm(this.languages, this.schema, this.schemasState.schemaMap, this.formContext); + break; + + case 'Edit': + this.contentForm.submitCompleted({ noReset: true }); + this.contentForm.load(content.data, true); + + this.router.navigate([content.id, 'history'], { relativeTo: this.route.parent! }); + break; + + case 'Close': + this.autoSaveIgnore = true; + + this.router.navigate(['./'], { relativeTo: this.route.parent! }); + break; + } + }, + error: error => { + this.contentForm.submitFailed(error); + }, + }); } } @@ -289,7 +315,7 @@ export class ContentPageComponent implements CanComponentDeactivate, OnInit { } public back() { - if (this.previousUrl.pathStartsWith(`/app/${this.contentsState.appName}/content/${this.schema.name}`)) { + if (this.previousUrl.isPath(`/app/${this.contentsState.appName}/content/${this.schema.name}`)) { this.location.back(); } else { this.router.navigate([this.schema.name], { relativeTo: this.route.parent!.parent, replaceUrl: true }); @@ -308,8 +334,9 @@ export class ContentPageComponent implements CanComponentDeactivate, OnInit { public changeLanguage(language: AppLanguageDto) { this.language = language; - this.localStore.set(this.languageKey(), language.iso2Code); + + this.updateContext(); } public checkPendingChangesBeforePreview() { @@ -325,7 +352,7 @@ export class ContentPageComponent implements CanComponentDeactivate, OnInit { } private checkPendingChanges(text: string) { - if (this.content && !this.content.canUpdate) { + if ((this.content && !this.content.canUpdate) || this.autoSaveIgnore) { return of(true); } diff --git a/frontend/src/app/features/content/pages/contents/contents-page.component.html b/frontend/src/app/features/content/pages/contents/contents-page.component.html index 55e64774c..29c604dea 100644 --- a/frontend/src/app/features/content/pages/contents/contents-page.component.html +++ b/frontend/src/app/features/content/pages/contents/contents-page.component.html @@ -178,6 +178,7 @@
- @for (category of categories | async; track category.name) { + @for (category of categories | async; track category.displayName) { } diff --git a/frontend/src/app/features/content/shared/forms/field-editor.component.html b/frontend/src/app/features/content/shared/forms/field-editor.component.html index fee1a08ed..37d6378cb 100644 --- a/frontend/src/app/features/content/shared/forms/field-editor.component.html +++ b/frontend/src/app/features/content/shared/forms/field-editor.component.html @@ -203,6 +203,12 @@ [language]="language" [schemaId]="field.rawProperties.singleId"> } + @case ("Radio") { + + } } } @case ("String") { diff --git a/frontend/src/app/features/content/shared/forms/field-editor.component.scss b/frontend/src/app/features/content/shared/forms/field-editor.component.scss index 8b232c78f..6e2f3fc59 100644 --- a/frontend/src/app/features/content/shared/forms/field-editor.component.scss +++ b/frontend/src/app/features/content/shared/forms/field-editor.component.scss @@ -7,7 +7,7 @@ } &-disabled { - color: $color-border-dark; + color: $color-text-decent; font-size: $font-smallest; font-weight: normal; } diff --git a/frontend/src/app/features/content/shared/forms/field-editor.component.ts b/frontend/src/app/features/content/shared/forms/field-editor.component.ts index 720aa2569..2476967e3 100644 --- a/frontend/src/app/features/content/shared/forms/field-editor.component.ts +++ b/frontend/src/app/features/content/shared/forms/field-editor.component.ts @@ -13,6 +13,7 @@ import { AbstractContentForm, AnnotationCreate, AnnotationsSelect, AppLanguageDt import { ReferenceDropdownComponent } from '../references/reference-dropdown.component'; import { ReferencesCheckboxesComponent } from '../references/references-checkboxes.component'; import { ReferencesEditorComponent } from '../references/references-editor.component'; +import { ReferencesRadioButtonsComponent } from '../references/references-radio-buttons.component'; import { ReferencesTagsComponent } from '../references/references-tags.component'; import { ArrayEditorComponent } from './array-editor.component'; import { AssetsEditorComponent } from './assets-editor.component'; @@ -50,6 +51,7 @@ import { StockPhotoEditorComponent } from './stock-photo-editor.component'; ReferenceInputComponent, ReferencesCheckboxesComponent, ReferencesEditorComponent, + ReferencesRadioButtonsComponent, ReferencesTagsComponent, RichEditorComponent, StarsComponent, diff --git a/frontend/src/app/features/content/shared/forms/iframe-editor.component.ts b/frontend/src/app/features/content/shared/forms/iframe-editor.component.ts index 996946967..349029889 100644 --- a/frontend/src/app/features/content/shared/forms/iframe-editor.component.ts +++ b/frontend/src/app/features/content/shared/forms/iframe-editor.component.ts @@ -126,6 +126,10 @@ export class IFrameEditorComponent extends StatefulComponent implements O this.sendLanguage(); } + if (changes.context) { + this.sendContext(); + } + if (changes.formControlBinding) { this.subscriptions.unsubscribeAll(); @@ -300,6 +304,10 @@ export class IFrameEditorComponent extends StatefulComponent implements O this.sendMessage('expandedChanged', { expanded: this.isExpanded }); } + private sendContext() { + this.sendMessage('contextChanged', { context: this.context }); + } + private sendDisabled() { this.sendMessage('disabled', { isDisabled: this.isDisabled }); } diff --git a/frontend/src/app/features/content/shared/references/reference-item.component.html b/frontend/src/app/features/content/shared/references/reference-item.component.html index f1d196e1c..e4553da50 100644 --- a/frontend/src/app/features/content/shared/references/reference-item.component.html +++ b/frontend/src/app/features/content/shared/references/reference-item.component.html @@ -48,8 +48,7 @@
- diff --git a/frontend/src/app/features/content/shared/references/references-checkboxes.component.ts b/frontend/src/app/features/content/shared/references/references-checkboxes.component.ts index c424f9bbd..62090a5cd 100644 --- a/frontend/src/app/features/content/shared/references/references-checkboxes.component.ts +++ b/frontend/src/app/features/content/shared/references/references-checkboxes.component.ts @@ -6,9 +6,8 @@ */ import { booleanAttribute, ChangeDetectionStrategy, Component, forwardRef, inject, Input } from '@angular/core'; -import { FormsModule, NG_VALUE_ACCESSOR, ReactiveFormsModule, UntypedFormControl } from '@angular/forms'; -import { CheckboxGroupComponent } from '@app/shared'; -import { AppsState, ContentDto, ContentsService, LanguageDto, LocalizerService, StatefulControlComponent, Subscriptions, TypedSimpleChanges, UIOptions } from '@app/shared/internal'; +import { FormControl, FormsModule, NG_VALUE_ACCESSOR, ReactiveFormsModule } from '@angular/forms'; +import { AppsState, CheckboxGroupComponent, ContentDto, ContentsService, LanguageDto, LocalizerService, StatefulControlComponent, Subscriptions, TypedSimpleChanges, UIOptions } from '@app/shared'; import { ReferencesTagsConverter } from './references-tag-converter'; export const SQX_REFERENCES_CHECKBOXES_CONTROL_VALUE_ACCESSOR: any = { @@ -37,7 +36,7 @@ const NO_EMIT = { emitEvent: false }; ReactiveFormsModule, ], }) -export class ReferencesCheckboxesComponent extends StatefulControlComponent> { +export class ReferencesCheckboxesComponent extends StatefulControlComponent | null | undefined> { private readonly subscriptions = new Subscriptions(); private readonly itemCount: number = inject(UIOptions).value.referencesDropdownItemCount; private contentItems: ReadonlyArray | null = null; @@ -53,7 +52,7 @@ export class ReferencesCheckboxesComponent extends StatefulControlComponent | null | undefined>([]); public get isValid() { return !!this.schemaId && !!this.language; @@ -68,7 +67,7 @@ export class ReferencesCheckboxesComponent extends StatefulControlComponent { + .subscribe(value => { if (value && value.length > 0) { this.callTouched(); this.callChange(value); @@ -125,7 +124,6 @@ export class ReferencesCheckboxesComponent extends StatefulControlComponent diff --git a/frontend/src/app/features/content/shared/references/references-radio-buttons.component.scss b/frontend/src/app/features/content/shared/references/references-radio-buttons.component.scss new file mode 100644 index 000000000..2742d895e --- /dev/null +++ b/frontend/src/app/features/content/shared/references/references-radio-buttons.component.scss @@ -0,0 +1,2 @@ +@import 'mixins'; +@import 'vars'; \ No newline at end of file diff --git a/frontend/src/app/features/content/shared/references/references-radio-buttons.component.ts b/frontend/src/app/features/content/shared/references/references-radio-buttons.component.ts new file mode 100644 index 000000000..23b269be6 --- /dev/null +++ b/frontend/src/app/features/content/shared/references/references-radio-buttons.component.ts @@ -0,0 +1,135 @@ +/* + * Squidex Headless CMS + * + * @license + * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. + */ + +import { booleanAttribute, ChangeDetectionStrategy, Component, forwardRef, inject, Input } from '@angular/core'; +import { FormControl, FormsModule, NG_VALUE_ACCESSOR, ReactiveFormsModule } from '@angular/forms'; +import { AppsState, ContentDto, ContentsService, LanguageDto, LocalizerService, RadioGroupComponent, StatefulControlComponent, Subscriptions, TypedSimpleChanges, UIOptions } from '@app/shared'; +import { ReferencesTagsConverter } from './references-tag-converter'; + +export const SQX_REFERENCES_RADIO_BUTTONS_CONTROL_VALUE_ACCESSOR: any = { + provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => ReferencesRadioButtonsComponent), multi: true, +}; + +interface State { + // The tags converter. + converter: ReferencesTagsConverter; +} + +const NO_EMIT = { emitEvent: false }; + +@Component({ + standalone: true, + selector: 'sqx-references-radio-buttons', + styleUrls: ['./references-radio-buttons.component.scss'], + templateUrl: './references-radio-buttons.component.html', + providers: [ + SQX_REFERENCES_RADIO_BUTTONS_CONTROL_VALUE_ACCESSOR, + ], + changeDetection: ChangeDetectionStrategy.OnPush, + imports: [ + FormsModule, + RadioGroupComponent, + ReactiveFormsModule, + ], +}) +export class ReferencesRadioButtonsComponent extends StatefulControlComponent | null | undefined> { + private readonly subscriptions = new Subscriptions(); + private readonly itemCount: number = inject(UIOptions).value.referencesDropdownItemCount; + private contentItems: ReadonlyArray | null = null; + + @Input({ required: true }) + public schemaId: string | undefined | null; + + @Input({ required: true }) + public language!: LanguageDto; + + @Input({ transform: booleanAttribute }) + public set disabled(value: boolean | undefined | null) { + this.setDisabledState(value === true); + } + + public control = new FormControl(undefined); + + public get isValid() { + return !!this.schemaId && !!this.language; + } + + constructor( + private readonly appsState: AppsState, + private readonly contentsService: ContentsService, + private readonly localizer: LocalizerService, + ) { + super({ converter: new ReferencesTagsConverter(null!, [], localizer) }); + + this.subscriptions.add( + this.control.valueChanges + .subscribe(value => { + if (value) { + this.callTouched(); + this.callChange([value]); + } else { + this.callTouched(); + this.callChange(null); + } + })); + } + + public ngOnChanges(changes: TypedSimpleChanges) { + if (changes.schemaId) { + this.resetState(); + + if (this.isValid) { + this.contentsService.getContents(this.appsState.appName, this.schemaId!, { take: this.itemCount }) + .subscribe({ + next: contents => { + this.contentItems = contents.items; + + this.resetConverterState(); + }, + error: () => { + this.contentItems = null; + + this.resetConverterState(); + }, + }); + } else { + this.contentItems = null; + + this.resetConverterState(); + } + } else { + this.resetConverterState(); + } + } + + public onDisabled(isDisabled: boolean) { + if (isDisabled) { + this.control.disable(NO_EMIT); + } else if (this.isValid) { + this.control.enable(NO_EMIT); + } + } + + public writeValue(obj: ReadonlyArray | null | undefined) { + this.control.setValue(obj?.[0], NO_EMIT); + } + + private resetConverterState() { + const success = this.isValid && this.contentItems && this.contentItems.length > 0; + + this.onDisabled(!success || this.snapshot.isDisabled); + + let converter: ReferencesTagsConverter; + if (success) { + converter = new ReferencesTagsConverter(this.language, this.contentItems!, this.localizer); + } else { + converter = new ReferencesTagsConverter(null!, [], this.localizer); + } + + this.next({ converter }); + } +} diff --git a/frontend/src/app/features/rules/pages/rule/rule-page.component.html b/frontend/src/app/features/rules/pages/rule/rule-page.component.html index 7d1829ce9..314e47a40 100644 --- a/frontend/src/app/features/rules/pages/rule/rule-page.component.html +++ b/frontend/src/app/features/rules/pages/rule/rule-page.component.html @@ -189,6 +189,7 @@ @if (rule && (rulesState.canReadEvents | async)) { diff --git a/frontend/src/app/features/rules/pages/rules/rules-page.component.html b/frontend/src/app/features/rules/pages/rules/rules-page.component.html index c5a501383..565019e7a 100644 --- a/frontend/src/app/features/rules/pages/rules/rules-page.component.html +++ b/frontend/src/app/features/rules/pages/rules/rules-page.component.html @@ -52,6 +52,7 @@ @if (rulesState.canReadEvents | async) { @if (editForm) { - + } @else { -
+
@@ -88,26 +88,60 @@ @if (!editForm) { } @if (editForm) {
- - +
+ + + + + + {{ "schemas.saveFieldAndNew" | sqxTranslate }} + + +
} diff --git a/frontend/src/app/features/schemas/pages/schema/fields/field-wizard.component.ts b/frontend/src/app/features/schemas/pages/schema/fields/field-wizard.component.ts index ad4a095af..bc97bcfd4 100644 --- a/frontend/src/app/features/schemas/pages/schema/fields/field-wizard.component.ts +++ b/frontend/src/app/features/schemas/pages/schema/fields/field-wizard.component.ts @@ -8,10 +8,11 @@ import { AsyncPipe } from '@angular/common'; import { Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { AddFieldForm, AppSettingsDto, ControlErrorsComponent, createProperties, EditFieldForm, FieldDto, fieldTypes, FocusOnInitDirective, FormAlertComponent, FormErrorComponent, FormHintComponent, LanguagesState, ModalDialogComponent, RootFieldDto, SchemaDto, SchemasState, TooltipDirective, TranslatePipe, Types } from '@app/shared'; +import { AddFieldForm, AppSettingsDto, ControlErrorsComponent, createProperties, DropdownMenuComponent, EditFieldForm, FieldDto, fieldTypes, FocusOnInitDirective, FormAlertComponent, FormErrorComponent, FormHintComponent, LanguagesState, ModalDialogComponent, ModalDirective, ModalModel, ModalPlacementDirective, RootFieldDto, SchemaDto, SchemasState, TooltipDirective, TranslatePipe, Types } from '@app/shared'; import { FieldFormComponent } from './forms/field-form.component'; -const DEFAULT_FIELD = { name: '', partitioning: 'invariant', properties: createProperties('String') }; + +type SaveNavigationMode = 'Close' | 'Add' | 'Edit'; @Component({ standalone: true, @@ -21,6 +22,7 @@ const DEFAULT_FIELD = { name: '', partitioning: 'invariant', properties: createP imports: [ AsyncPipe, ControlErrorsComponent, + DropdownMenuComponent, FieldFormComponent, FocusOnInitDirective, FormAlertComponent, @@ -28,6 +30,8 @@ const DEFAULT_FIELD = { name: '', partitioning: 'invariant', properties: createP FormHintComponent, FormsModule, ModalDialogComponent, + ModalDirective, + ModalPlacementDirective, ReactiveFormsModule, TooltipDirective, TranslatePipe, @@ -53,6 +57,7 @@ export class FieldWizardComponent implements OnInit { public field!: FieldDto; public addFieldForm = new AddFieldForm(); + public addFieldModal = new ModalModel(); public editForm?: EditFieldForm; @@ -76,60 +81,73 @@ export class FieldWizardComponent implements OnInit { this.dialogClose.emit(); } - public addField(addNew: boolean, edit = false) { + public addField(navigationMode: SaveNavigationMode) { const value = this.addFieldForm.submit(); - if (value) { - this.schemasState.addField(this.schema, value, this.parent) - .subscribe({ - next: dto => { - this.field = dto; + if (!value) { + return; + } - this.addFieldForm.submitCompleted({ newValue: { ...DEFAULT_FIELD } }); + this.schemasState.addField(this.schema, value, this.parent) + .subscribe({ + next: dto => { + switch (navigationMode) { + case 'Add': + this.addFieldForm.submitCompleted({ newValue: { ...DEFAULT_FIELD } }); - if (addNew) { if (Types.isFunction(this.nameInput.nativeElement.focus)) { this.nameInput.nativeElement.focus(); } - } else if (edit) { + + break; + + case 'Edit': + this.field = dto; + this.editForm = new EditFieldForm(this.field.properties); this.editForm.load(this.field.properties); - } else { + break; + + case 'Close': this.emitClose(); - } - }, - error: error => { - this.addFieldForm.submitFailed(error); - }, - }); - } + } + }, + error: error => { + this.addFieldForm.submitFailed(error); + }, + }); } - public save(addNew = false) { + public save(navigationMode: SaveNavigationMode) { if (!this.editForm) { return; } const value = this.editForm.submit(); - if (value) { - const properties = createProperties(this.field.properties.fieldType, value); + if (!value) { + return; + } - this.schemasState.updateField(this.schema, this.field as RootFieldDto, { properties }) - .subscribe({ - next: () => { - this.editForm!.submitCompleted(); + const properties = createProperties(this.field.properties.fieldType, value); - if (addNew) { + this.schemasState.updateField(this.schema, this.field as RootFieldDto, { properties }) + .subscribe({ + next: () => { + switch (navigationMode) { + case 'Add': this.editForm = undefined; - } else { + break; + case 'Close': { this.emitClose(); } - }, - error: error => { - this.editForm!.submitFailed(error); - }, - }); - } + } + }, + error: error => { + this.editForm!.submitFailed(error); + }, + }); } } + +const DEFAULT_FIELD = { name: '', partitioning: 'invariant', properties: createProperties('String') }; \ No newline at end of file diff --git a/frontend/src/app/features/schemas/pages/schema/fields/field.component.scss b/frontend/src/app/features/schemas/pages/schema/fields/field.component.scss index 5ee756d0e..9eb0ee841 100644 --- a/frontend/src/app/features/schemas/pages/schema/fields/field.component.scss +++ b/frontend/src/app/features/schemas/pages/schema/fields/field.component.scss @@ -90,7 +90,7 @@ $padding: 1rem; } &-hidden { - color: $color-text-decent; + color: lighten($color-text-decent, 40%); } &-partitioning { diff --git a/frontend/src/app/features/schemas/pages/schema/fields/sortable-field-list.component.html b/frontend/src/app/features/schemas/pages/schema/fields/sortable-field-list.component.html index cc195a29b..9eff5a55e 100644 --- a/frontend/src/app/features/schemas/pages/schema/fields/sortable-field-list.component.html +++ b/frontend/src/app/features/schemas/pages/schema/fields/sortable-field-list.component.html @@ -4,7 +4,7 @@ [cdkDropListDisabled]="!sortable" (cdkDropListDropped)="sortGroups($event)" cdkDropListGroup> - @for (group of fieldGroups; track group) { + @for (group of fieldGroups; track group.id) {
- @for (category of categories | async; track category.name) { + @for (category of categories | async; track category.displayName) { }
diff --git a/frontend/src/app/features/settings/pages/asset-scripts/asset-scripts-page.component.html b/frontend/src/app/features/settings/pages/asset-scripts/asset-scripts-page.component.html index 0305c3522..7a3cea01c 100644 --- a/frontend/src/app/features/settings/pages/asset-scripts/asset-scripts-page.component.html +++ b/frontend/src/app/features/settings/pages/asset-scripts/asset-scripts-page.component.html @@ -43,6 +43,7 @@
-
-
- + -
diff --git a/frontend/src/app/features/settings/pages/clients/client.component.ts b/frontend/src/app/features/settings/pages/clients/client.component.ts index 5b68663a6..60a72b962 100644 --- a/frontend/src/app/features/settings/pages/clients/client.component.ts +++ b/frontend/src/app/features/settings/pages/clients/client.component.ts @@ -8,7 +8,7 @@ import { ChangeDetectionStrategy, Component, Input } from '@angular/core'; import { FormsModule } from '@angular/forms'; -import { AppsState, ClientDto, ClientsState, ConfirmClickDirective, CopyDirective, DialogModel, EditableTitleComponent, FormHintComponent, ModalDirective, RoleDto, TourStepDirective, TranslatePipe, TypedSimpleChanges } from '@app/shared'; +import { AppsState, ClientDto, ClientsState, ConfirmClickDirective, CopyDirective, DialogModel, EditableTitleComponent, FormHintComponent, ModalDirective, RoleDto, TooltipDirective, TourStepDirective, TranslatePipe, TypedSimpleChanges } from '@app/shared'; import { ClientConnectFormComponent } from './client-connect-form.component'; @Component({ @@ -25,6 +25,7 @@ import { ClientConnectFormComponent } from './client-connect-form.component'; FormHintComponent, FormsModule, ModalDirective, + TooltipDirective, TourStepDirective, TranslatePipe, ], diff --git a/frontend/src/app/features/settings/pages/clients/clients-page.component.html b/frontend/src/app/features/settings/pages/clients/clients-page.component.html index 92f8451c2..8d651826c 100644 --- a/frontend/src/app/features/settings/pages/clients/clients-page.component.html +++ b/frontend/src/app/features/settings/pages/clients/clients-page.component.html @@ -31,6 +31,7 @@
{{ language.iso2Code }} ({{ language.englishName }}) diff --git a/frontend/src/app/features/settings/pages/languages/language.component.html b/frontend/src/app/features/settings/pages/languages/language.component.html index e6198cd80..a1a1c6451 100644 --- a/frontend/src/app/features/settings/pages/languages/language.component.html +++ b/frontend/src/app/features/settings/pages/languages/language.component.html @@ -1,16 +1,17 @@
- {{ language.iso2Code }} + {{ language.iso2Code }}
- {{ language.englishName }} + {{ language.englishName }}
@if (!language.isMaster) {
-
@@ -102,7 +107,7 @@
-
+
@if (!isEditable && editForm.editorsControls.length === 0) {
{{ "appSettings.editors.empty" | sqxTranslate }} @@ -130,6 +135,7 @@
-
@@ -180,6 +190,7 @@
+ @if (!disabled) {
-
diff --git a/frontend/src/app/framework/angular/forms/editable-title.stories.ts b/frontend/src/app/framework/angular/forms/editable-title.stories.ts index acf04a4cc..3543e8f63 100644 --- a/frontend/src/app/framework/angular/forms/editable-title.stories.ts +++ b/frontend/src/app/framework/angular/forms/editable-title.stories.ts @@ -14,7 +14,7 @@ export default { component: EditableTitleComponent, argTypes: { inputTitle: { - control: 'inputTitle', + control: 'text', }, closeButton: { control: 'boolean', diff --git a/frontend/src/app/framework/angular/forms/editors/autocomplete.component.html b/frontend/src/app/framework/angular/forms/editors/autocomplete.component.html index e33a08680..4857b6073 100644 --- a/frontend/src/app/framework/angular/forms/editors/autocomplete.component.html +++ b/frontend/src/app/framework/angular/forms/editors/autocomplete.component.html @@ -1,6 +1,7 @@
diff --git a/frontend/src/app/framework/angular/forms/editors/autocomplete.component.ts b/frontend/src/app/framework/angular/forms/editors/autocomplete.component.ts index 8a1cbb7c2..316c0171e 100644 --- a/frontend/src/app/framework/angular/forms/editors/autocomplete.component.ts +++ b/frontend/src/app/framework/angular/forms/editors/autocomplete.component.ts @@ -80,6 +80,12 @@ export class AutocompleteComponent extends StatefulControlComponent ({ props: args, @@ -26,7 +30,7 @@ export default { @@ -37,6 +41,7 @@ export default { decorators: [ moduleMetadata({ imports: [ + FormsModule, ], }), ], diff --git a/frontend/src/app/framework/angular/forms/editors/code-editor.component.ts b/frontend/src/app/framework/angular/forms/editors/code-editor.component.ts index d7be93f7a..775f4d1af 100644 --- a/frontend/src/app/framework/angular/forms/editors/code-editor.component.ts +++ b/frontend/src/app/framework/angular/forms/editors/code-editor.component.ts @@ -143,7 +143,7 @@ export class CodeEditorComponent extends StatefulControlComponent<{}, any> imple } public async ngAfterViewInit() { - this.valueChanged.pipe(debounceTime(500)) + this.valueChanged.pipe(debounceTime(100)) .subscribe(() => { this.changeValue(); }); @@ -156,8 +156,8 @@ export class CodeEditorComponent extends StatefulControlComponent<{}, any> imple this.aceEditor = ace.edit(this.editor.nativeElement); this.aceEditor.setFontSize('14px'); - this.aceModes = ace.require('ace/ext-modelist'); - this.aceTools = !!ace.require('ace/ext-language_tools'); + this.aceModes = ace.require('ace/ext/modelist'); + this.aceTools = !!ace.require('ace/ext/language_tools'); this.setValue(this.value); this.setMode(); diff --git a/frontend/src/app/framework/angular/forms/editors/code-editor.stories.ts b/frontend/src/app/framework/angular/forms/editors/code-editor.stories.ts index 7815986fa..d54fdc3f4 100644 --- a/frontend/src/app/framework/angular/forms/editors/code-editor.stories.ts +++ b/frontend/src/app/framework/angular/forms/editors/code-editor.stories.ts @@ -5,6 +5,8 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ +import { FormsModule } from '@angular/forms'; +import { action } from '@storybook/addon-actions'; import { Meta, moduleMetadata, StoryObj } from '@storybook/angular'; import { CodeEditorComponent, ScriptCompletions } from '@app/framework'; @@ -18,6 +20,12 @@ export default { dropdownFullWidth: { control: 'boolean', }, + singleLine: { + control: false, + }, + change: { + action: 'ngModelChange', + }, }, render: args => ({ props: args, @@ -28,6 +36,8 @@ export default { [disabled]="disabled" [height]="height" [maxLines]="maxLines" + (ngModelChange)="change($event)" + [ngModel]="ngModel" [singleLine]="singleLine" [valueFile]="valueFile" [valueMode]="valueMode" @@ -39,6 +49,7 @@ export default { decorators: [ moduleMetadata({ imports: [ + FormsModule, ], }), ], @@ -63,11 +74,13 @@ type Story = StoryObj; export const Default: Story = { args: { height: 'auto', - }, + ngModel: 'Value', + } as any, }; export const Completions: Story = { args: { + height: 200, completion: COMPLETIONS, }, }; @@ -84,6 +97,8 @@ export const SingleLine: Story = { [disabled]="disabled" [height]="height" [maxLines]="maxLines" + (ngModelChange)="ngModelChange" + [ngModel]="ngModel" [singleLine]="singleLine" [valueFile]="valueFile" [valueMode]="valueMode" @@ -98,5 +113,6 @@ export const SingleLine: Story = { }), args: { singleLine: true, - }, + ngModelChange: action('ngModelChange'), + } as any, }; \ No newline at end of file diff --git a/frontend/src/app/framework/angular/forms/editors/dropdown.component.html b/frontend/src/app/framework/angular/forms/editors/dropdown.component.html index 0bbfa0cc8..2da697d1c 100644 --- a/frontend/src/app/framework/angular/forms/editors/dropdown.component.html +++ b/frontend/src/app/framework/angular/forms/editors/dropdown.component.html @@ -1,6 +1,7 @@
@if (snapshot.selectedItem; as selectedItem) { @@ -29,9 +31,8 @@ adjustHeight="false" [adjustWidth]="dropdownFullWidth" [position]="dropdownPosition" - r scrollX="false" - scrollY="true" + scrollY="hidden" [sqxAnchoredTo]="input" *sqxModal="dropdown" [style]="dropdownStyles"> diff --git a/frontend/src/app/framework/angular/forms/editors/dropdown.component.scss b/frontend/src/app/framework/angular/forms/editors/dropdown.component.scss index a536de888..5e0638c7a 100644 --- a/frontend/src/app/framework/angular/forms/editors/dropdown.component.scss +++ b/frontend/src/app/framework/angular/forms/editors/dropdown.component.scss @@ -27,6 +27,11 @@ $color-input-disabled: #eef1f4; padding: .5rem; } +.items-container { + display: flex; + flex-direction: column; +} + .control-dropdown { max-height: none; max-width: 40rem; @@ -37,6 +42,7 @@ $color-input-disabled: #eef1f4; max-height: 15rem; overflow-x: hidden; overflow-y: auto; + padding-bottom: .5rem; } .selection { @@ -65,4 +71,11 @@ $color-input-disabled: #eef1f4; sqx-loader { margin-top: .25rem; +} + +sqx-dropdown-menu { + display: flex !important; + flex-direction: column; + flex-grow: 0; + padding-bottom: 0; } \ No newline at end of file diff --git a/frontend/src/app/framework/angular/forms/editors/dropdown.component.ts b/frontend/src/app/framework/angular/forms/editors/dropdown.component.ts index 3d7b6750a..99a49eb18 100644 --- a/frontend/src/app/framework/angular/forms/editors/dropdown.component.ts +++ b/frontend/src/app/framework/angular/forms/editors/dropdown.component.ts @@ -81,6 +81,12 @@ export class DropdownComponent extends StatefulControlComponent ({ props: args, @@ -59,10 +74,11 @@ export default { @@ -74,6 +90,8 @@ export default { TestComponent, ], imports: [ + BrowserAnimationsModule, + FormsModule, RootViewComponent, ], providers: [ @@ -95,6 +113,13 @@ export const Default: Story = { }, }; +export const Long: Story = { + args: { + items: ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K'], + model: 'B', + }, +}; + export const WrongModel: Story = { args: { items: ['A', 'B', 'C'], @@ -146,7 +171,7 @@ export const ComplexValues: Story = { ({ props: args, @@ -26,7 +30,7 @@ export default { @@ -37,6 +41,7 @@ export default { decorators: [ moduleMetadata({ imports: [ + FormsModule, ], }), ], diff --git a/frontend/src/app/framework/angular/forms/editors/tag-editor.stories.ts b/frontend/src/app/framework/angular/forms/editors/tag-editor.stories.ts index fea72a6c6..17ef63f45 100644 --- a/frontend/src/app/framework/angular/forms/editors/tag-editor.stories.ts +++ b/frontend/src/app/framework/angular/forms/editors/tag-editor.stories.ts @@ -6,6 +6,7 @@ */ import { Component } from '@angular/core'; +import { FormsModule } from '@angular/forms'; import { Meta, moduleMetadata, StoryObj } from '@storybook/angular'; import { LocalizerService, RootViewComponent, TagEditorComponent } from '@app/framework'; @@ -52,6 +53,9 @@ export default { disabled: { control: 'boolean', }, + change: { + action:'ngModelChange', + }, }, render: args => ({ props: args, @@ -62,6 +66,7 @@ export default { [disabled]="disabled" [itemsSource]="itemsSource" [itemsSourceLoading]="itemsSourceLoading" + (ngModelChange)="change($event)" [ngModel]="model" [styleScrollable]="styleScrollable" [styleBlank]="styleBlank" @@ -76,6 +81,7 @@ export default { TestComponent, ], imports: [ + FormsModule, RootViewComponent, ], providers: [ diff --git a/frontend/src/app/framework/angular/modals/dialog-renderer.component.html b/frontend/src/app/framework/angular/modals/dialog-renderer.component.html index fd5fabf77..af6da645b 100644 --- a/frontend/src/app/framework/angular/modals/dialog-renderer.component.html +++ b/frontend/src/app/framework/angular/modals/dialog-renderer.component.html @@ -31,7 +31,7 @@
@for (notification of snapshot.notifications; track notification) { -
+ } diff --git a/frontend/src/app/framework/angular/modals/modal-dialog.component.ts b/frontend/src/app/framework/angular/modals/modal-dialog.component.ts index 5203053fd..8c8a28c87 100644 --- a/frontend/src/app/framework/angular/modals/modal-dialog.component.ts +++ b/frontend/src/app/framework/angular/modals/modal-dialog.component.ts @@ -8,6 +8,7 @@ import { AfterViewInit, booleanAttribute, ChangeDetectionStrategy, Component, ElementRef, EventEmitter, Input, Output, Renderer2, ViewChild } from '@angular/core'; import { fadeAnimation } from '@app/framework/internal'; +import { TranslatePipe } from '../pipes/translate.pipe'; import { ShortcutComponent } from '../shortcut.component'; import { TourStepDirective } from './tour-step.directive'; @@ -22,6 +23,7 @@ import { TourStepDirective } from './tour-step.directive'; changeDetection: ChangeDetectionStrategy.Default, imports: [ ShortcutComponent, + TranslatePipe, TourStepDirective, ], }) diff --git a/frontend/src/app/framework/angular/modals/modal-placement.directive.ts b/frontend/src/app/framework/angular/modals/modal-placement.directive.ts index 3e052afeb..84c9aa427 100644 --- a/frontend/src/app/framework/angular/modals/modal-placement.directive.ts +++ b/frontend/src/app/framework/angular/modals/modal-placement.directive.ts @@ -20,11 +20,11 @@ export class ModalPlacementDirective implements AfterViewInit, OnDestroy { @Input('sqxAnchoredTo') public target?: Element; - @Input({ transform: booleanAttribute }) - public scrollX = false; + @Input() + public scrollX?: Scroll; - @Input({ transform: booleanAttribute }) - public scrollY = false; + @Input() + public scrollY?: Scroll; @Input({ transform: numberAttribute }) public scrollMargin = 10; @@ -131,21 +131,24 @@ export class ModalPlacementDirective implements AfterViewInit, OnDestroy { middleware.push(size({ apply: ({ availableWidth, availableHeight, rects }) => { - if (this.scrollX) { - const maxWidth = availableWidth > 0 ? `${availableWidth - this.scrollMargin}px` : 'none'; + const overflowX = parseScroll(this.scrollX); + const overflowY = parseScroll(this.scrollY); - this.renderer.setStyle(modalRef, 'overflow-x', 'auto'); - this.renderer.setStyle(modalRef, 'overflow-y', 'none'); - this.renderer.setStyle(modalRef, 'max-width', maxWidth); - } + const maxWidth = + overflowX !== 'none' + ? availableWidth > 0 ? `${availableWidth - this.scrollMargin}px` : 'none' + : undefined; - if (this.scrollY) { - const maxHeight = availableHeight > 0 ? `${availableHeight - this.scrollMargin}px` : 'none'; + const maxHeight = + overflowY !== 'none' + ? availableHeight > 0 ? `${availableHeight - this.scrollMargin}px` : 'none' + : undefined; - this.renderer.setStyle(modalRef, 'overflow-x', 'none'); - this.renderer.setStyle(modalRef, 'overflow-y', 'auto'); - this.renderer.setStyle(modalRef, 'max-height', maxHeight); - } + this.renderer.setStyle(modalRef, 'overflow-x', overflowX); + this.renderer.setStyle(modalRef, 'overflow-y', overflowY); + + this.renderer.setStyle(modalRef, 'max-width', maxWidth); + this.renderer.setStyle(modalRef, 'max-height', maxHeight); if (this.adjustWidth) { const width = rects.reference.width + 2 * this.spaceX; @@ -169,3 +172,17 @@ export class ModalPlacementDirective implements AfterViewInit, OnDestroy { this.renderer.setStyle(modalRef, 'visibility', 'visible'); } } + +type Scroll = 'hidden' | 'scroll' | 'auto' | 'true' | 'false' | true | undefined; + +function parseScroll(source: Scroll): string { + if (source === 'true' || source === 'auto' || source === true) { + return 'auto'; + } + + if (!source || source === 'false') { + return 'none'; + } + + return source; +} diff --git a/frontend/src/app/framework/angular/pager.component.html b/frontend/src/app/framework/angular/pager.component.html index 1d228b355..130bcd10d 100644 --- a/frontend/src/app/framework/angular/pager.component.html +++ b/frontend/src/app/framework/angular/pager.component.html @@ -2,7 +2,11 @@
@if (paging) {
@if ((canDelete || canUpdate) && !isDisabled) { - diff --git a/frontend/src/app/shared/components/assets/asset.component.html b/frontend/src/app/shared/components/assets/asset.component.html index a6d221fbb..497306de2 100644 --- a/frontend/src/app/shared/components/assets/asset.component.html +++ b/frontend/src/app/shared/components/assets/asset.component.html @@ -31,13 +31,14 @@
@if (!isDisabled) { - + } @@ -53,6 +54,7 @@ @if (!isDisabled && !removeMode && asset.canDelete) {
- @for (category of schemaCategory.categories; track category.name) { + @for (category of schemaCategory.categories; track category.displayName) { i !== index) }; + change = { and: filter.and.filter((_, i) => i !== index) }; } else { - this.filter = { or: filter.or.filter((_, i) => i !== index) }; + change = { or: filter.or.filter((_, i) => i !== index) }; } + + this.emitChange(change); } public replaceNode(index: number, node: FilterNode) { const filter = this.filter; + let change: FilterLogical; if (isLogicalAnd(filter)) { - this.emitChange({ and: filter.and.map((x, i) => i === index ? node : x) }); + change = { and: filter.and.map((x, i) => i === index ? node : x) }; } else { - this.emitChange({ or: filter.or.map((x, i) => i === index ? node : x) }); + change = { or: filter.or.map((x, i) => i === index ? node : x) }; } + + this.emitChange(change); } public toggleType() { const filter = this.filter; + let change: FilterLogical; if (isLogicalAnd(filter)) { - this.emitChange({ or: filter.and }); + change = { or: filter.and }; } else { - this.emitChange({ and: filter.or }); + change = { and: filter.or }; } + + this.emitChange(change); } private emitChange(filter: FilterLogical) { diff --git a/frontend/src/app/shared/components/search/search-form.component.html b/frontend/src/app/shared/components/search/search-form.component.html index 09bd8f9ec..96af729a8 100644 --- a/frontend/src/app/shared/components/search/search-form.component.html +++ b/frontend/src/app/shared/components/search/search-form.component.html @@ -82,29 +82,29 @@
+ } - @if (showQueries) { - @if (queryModel) { -
- - - -
- } - } @else if (queries && queriesTypes) { -
- + @if (showQueries) { + @if (queryModel) { +
+ + +
} + } @else if (queries && queriesTypes) { +
+ +
} diff --git a/frontend/src/app/shared/services/schemas.types.ts b/frontend/src/app/shared/services/schemas.types.ts index e84e2fa4d..926c48236 100644 --- a/frontend/src/app/shared/services/schemas.types.ts +++ b/frontend/src/app/shared/services/schemas.types.ts @@ -379,7 +379,7 @@ export class NumberFieldPropertiesDto extends FieldPropertiesDto { } } -export type ReferencesFieldEditor = 'List' | 'Dropdown' | 'Checkboxes' | 'Tags' | 'Input'; +export type ReferencesFieldEditor = 'List' | 'Dropdown' | 'Checkboxes' | 'Tags' | 'Input' | 'Radio'; export const REFERENCES_FIELD_EDITORS: ReadonlyArray = [ 'List', @@ -387,6 +387,7 @@ export const REFERENCES_FIELD_EDITORS: ReadonlyArray = [ 'Checkboxes', 'Tags', 'Input', + 'Radio', ]; export class ReferencesFieldPropertiesDto extends FieldPropertiesDto { diff --git a/frontend/src/app/shared/state/contents.forms-helpers.ts b/frontend/src/app/shared/state/contents.forms-helpers.ts index af10a5ea7..ee0f66ffc 100644 --- a/frontend/src/app/shared/state/contents.forms-helpers.ts +++ b/frontend/src/app/shared/state/contents.forms-helpers.ts @@ -99,7 +99,7 @@ export abstract class Hidden { } } -export type FieldGroup = { separator?: T; fields: T[] }; +export type FieldGroup = { separator?: T; fields: T[]; id: string }; export function groupFields(fields: ReadonlyArray, keepEmpty = false): FieldGroup[] { const result: FieldGroup[] = []; @@ -107,23 +107,25 @@ export function groupFields(fields: ReadonlyArray, keepEm let currentSeparator: T | undefined; let currentFields: T[] = []; + const addGroup = () => { + if (currentFields.length > 0 || keepEmpty) { + const id = currentSeparator?.fieldId.toString() || 'DEFAULT'; + + result.push({ separator: currentSeparator, fields: currentFields, id }); + } + }; + for (const field of fields) { if (field.properties.isContentField) { currentFields.push(field); } else { - if (currentFields.length > 0 || keepEmpty) { - result.push({ separator: currentSeparator, fields: currentFields }); - } - + addGroup(); currentFields = []; currentSeparator = field; } } - if (currentFields.length > 0 || keepEmpty) { - result.push({ separator: currentSeparator, fields: currentFields }); - } - + addGroup(); return result; } diff --git a/frontend/src/app/shared/state/schemas.state.ts b/frontend/src/app/shared/state/schemas.state.ts index a5f6f9ff6..b11d9aeca 100644 --- a/frontend/src/app/shared/state/schemas.state.ts +++ b/frontend/src/app/shared/state/schemas.state.ts @@ -447,7 +447,7 @@ export function getCategoryTree(allSchemas: ReadonlyArray, categories schemasFiltered: [], countSchemasInSubtree: 0, countSchemasInSubtreeFiltered: 0, - categories: [], + categories: [] }; const components: SchemaCategory = { @@ -456,7 +456,7 @@ export function getCategoryTree(allSchemas: ReadonlyArray, categories schemasFiltered: [], countSchemasInSubtree: 0, countSchemasInSubtreeFiltered: 0, - categories: [], + categories: [] }; const categoryCache: { [name: string]: SchemaCategory } = {}; diff --git a/frontend/src/app/shared/state/table-settings.ts b/frontend/src/app/shared/state/table-settings.ts index 74c0025ec..c1689329d 100644 --- a/frontend/src/app/shared/state/table-settings.ts +++ b/frontend/src/app/shared/state/table-settings.ts @@ -149,7 +149,7 @@ export function getTableConfig(source: TableSettings) { const result: string[] = []; for (const field of fields) { - if (field.name && field.name.indexOf('meta') < 0) { + if (field.name && field.name.indexOf('meta.') < 0) { result.push(field.name); } } diff --git a/frontend/src/app/shell/pages/internal/apps-menu.component.html b/frontend/src/app/shell/pages/internal/apps-menu.component.html index f8afbcc90..38df03dca 100644 --- a/frontend/src/app/shell/pages/internal/apps-menu.component.html +++ b/frontend/src/app/shell/pages/internal/apps-menu.component.html @@ -13,6 +13,7 @@