@salesforce/ui-bundle-template-feature-angular-language-switcher 12.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.txt +82 -0
- package/README.md +193 -0
- package/dist/.forceignore +15 -0
- package/dist/.husky/pre-commit +4 -0
- package/dist/.prettierignore +11 -0
- package/dist/.prettierrc +17 -0
- package/dist/CHANGELOG.md +5238 -0
- package/dist/README.md +77 -0
- package/dist/config/project-scratch-def.json +13 -0
- package/dist/eslint.config.js +7 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/.forceignore +15 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/.graphqlrc.yml +2 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/.postcssrc.json +5 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/.prettierignore +8 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/.prettierrc +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/CHANGELOG.md +4 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/README.md +85 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/angular.json +98 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/codegen.yml +95 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/components.json +6 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/e2e/app.spec.ts +15 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/esbuild/api-version.mjs +17 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/esbuild/graphql-codegen.mjs +13 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/eslint-plugin-angular-graphql.js +148 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/eslint.config.js +76 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/feature-angular-language-switcher.uibundle-meta.xml +7 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/middleware/html.mjs +3 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/middleware/proxy.mjs +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/package.json +69 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/playwright.config.ts +25 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/public/favicon.ico +0 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/scripts/get-graphql-schema.mjs +69 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/scripts/rewrite-e2e-assets.mjs +30 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/api/data-client.service.spec.ts +184 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/api/data-client.service.ts +74 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/app.config.ts +20 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/app.html +1 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/app.routes.ts +26 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/app.spec.ts +18 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/app.ts +15 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/components/layout/app-layout/app-layout.html +51 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/components/layout/app-layout/app-layout.spec.ts +63 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/components/layout/app-layout/app-layout.ts +27 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/components/ui/alert/alert.html +27 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/components/ui/alert/alert.ts +41 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/components/ui/button/button.html +27 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/components/ui/button/button.ts +66 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/components/ui/card/card.ts +100 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/components/ui/collapsible/collapsible.html +38 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/components/ui/collapsible/collapsible.ts +21 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/components/ui/date-picker/date-picker.html +20 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/components/ui/date-picker/date-picker.ts +49 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/components/ui/date-range-picker/date-range-picker.html +20 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/components/ui/date-range-picker/date-range-picker.ts +69 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/components/ui/dialog/dialog.html +20 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/components/ui/dialog/dialog.ts +40 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/components/ui/dropdown-menu/dropdown-menu.html +20 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/components/ui/dropdown-menu/dropdown-menu.ts +100 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/components/ui/field/field.html +15 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/components/ui/field/field.ts +28 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/components/ui/field-appearance.ts +8 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/components/ui/field-size.ts +8 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/components/ui/icon/icon.ts +68 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/components/ui/input/input.html +34 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/components/ui/input/input.ts +79 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/components/ui/label/label.ts +21 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/components/ui/paginator/paginator.html +74 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/components/ui/paginator/paginator.ts +93 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/components/ui/paginator/types.ts +13 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/components/ui/popover/popover.html +13 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/components/ui/popover/popover.ts +37 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/components/ui/select/select.html +36 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/components/ui/select/select.ts +63 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/components/ui/separator/separator.ts +31 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/components/ui/skeleton/skeleton.ts +20 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/components/ui/spinner/spinner.ts +28 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/features/language-switcher/__examples__/html-middleware-site-example.ts +41 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/features/language-switcher/__examples__/language-switcher-example.ts +41 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/features/language-switcher/build-language-url.ts +158 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/features/language-switcher/index.ts +28 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/features/language-switcher/language-switcher.html +22 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/features/language-switcher/language-switcher.ts +110 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/features/language-switcher/languages.ts +46 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/pages/home/home.html +6 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/pages/home/home.spec.ts +23 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/pages/home/home.ts +13 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/pages/not-found/not-found.html +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/pages/not-found/not-found.spec.ts +33 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/pages/not-found/not-found.ts +15 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/alert/hlm-alert-action.ts +14 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/alert/hlm-alert-description.ts +17 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/alert/hlm-alert-title.ts +17 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/alert/hlm-alert.ts +35 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/alert/index.ts +16 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/button/hlm-button.token.ts +22 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/button/hlm-button.ts +72 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/button/index.ts +6 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/calendar/hlm-calendar-multi.ts +195 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/calendar/hlm-calendar-range.ts +194 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/calendar/hlm-calendar.ts +189 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/calendar/hlm-month-year-calendar.ts +119 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/calendar/index.ts +16 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/card/hlm-card-action.ts +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/card/hlm-card-avatar.ts +14 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/card/hlm-card-content.ts +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/card/hlm-card-description.ts +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/card/hlm-card-footer.ts +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/card/hlm-card-header.ts +15 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/card/hlm-card-title.ts +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/card/hlm-card.token.ts +19 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/card/hlm-card.ts +22 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/card/index.ts +28 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/collapsible/hlm-collapsible-content.ts +14 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/collapsible/hlm-collapsible-trigger.ts +9 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/collapsible/hlm-collapsible.ts +15 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/collapsible/index.ts +13 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/date-picker/hlm-date-multi-input.ts +104 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/date-picker/hlm-date-picker-anchor.ts +23 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/date-picker/hlm-date-picker-input.ts +118 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/date-picker/hlm-date-picker-multi.token.ts +109 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/date-picker/hlm-date-picker-multi.ts +220 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/date-picker/hlm-date-picker-trigger.ts +104 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/date-picker/hlm-date-picker.token.ts +69 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/date-picker/hlm-date-picker.ts +203 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/date-picker/hlm-date-range-input.ts +120 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/date-picker/hlm-date-range-picker.token.ts +86 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/date-picker/hlm-date-range-picker.ts +252 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/date-picker/hlm-month-year-input.ts +105 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/date-picker/hlm-month-year-picker.token.ts +89 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/date-picker/hlm-month-year-picker.ts +196 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/date-picker/index.ts +38 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/dialog/hlm-dialog-close.ts +9 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/dialog/hlm-dialog-content.ts +74 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/dialog/hlm-dialog-description.ts +17 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/dialog/hlm-dialog-footer.ts +15 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/dialog/hlm-dialog-header.ts +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/dialog/hlm-dialog-overlay.ts +27 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/dialog/hlm-dialog-portal.ts +8 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/dialog/hlm-dialog-title.ts +14 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/dialog/hlm-dialog-trigger.ts +14 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/dialog/hlm-dialog.service.ts +46 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/dialog/hlm-dialog.ts +24 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/dialog/index.ts +35 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/dropdown-menu/hlm-dropdown-menu-checkbox-indicator.ts +21 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/dropdown-menu/hlm-dropdown-menu-checkbox.ts +54 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/dropdown-menu/hlm-dropdown-menu-focus-on-hover.ts +35 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/dropdown-menu/hlm-dropdown-menu-group.ts +14 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/dropdown-menu/hlm-dropdown-menu-item-sub-indicator.ts +19 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/dropdown-menu/hlm-dropdown-menu-item.ts +42 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/dropdown-menu/hlm-dropdown-menu-label.ts +20 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/dropdown-menu/hlm-dropdown-menu-radio-indicator.ts +21 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/dropdown-menu/hlm-dropdown-menu-radio.ts +49 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/dropdown-menu/hlm-dropdown-menu-separator.ts +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/dropdown-menu/hlm-dropdown-menu-shortcut.ts +15 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/dropdown-menu/hlm-dropdown-menu-sub-trigger.ts +52 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/dropdown-menu/hlm-dropdown-menu-sub.ts +53 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/dropdown-menu/hlm-dropdown-menu-token.ts +26 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/dropdown-menu/hlm-dropdown-menu-trigger.ts +46 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/dropdown-menu/hlm-dropdown-menu.ts +57 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/dropdown-menu/index.ts +49 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/field/hlm-field-content.ts +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/field/hlm-field-description.ts +53 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/field/hlm-field-error.ts +100 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/field/hlm-field-group.ts +15 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/field/hlm-field-label.ts +17 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/field/hlm-field-legend.ts +19 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/field/hlm-field-separator.ts +24 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/field/hlm-field-set.ts +15 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/field/hlm-field-title.ts +15 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/field/hlm-field.ts +47 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/field/index.ts +34 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/input/hlm-input.ts +21 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/input/index.ts +5 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/input-group/hlm-input-group-addon.ts +40 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/input-group/hlm-input-group-button.ts +47 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/input-group/hlm-input-group-input.ts +17 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/input-group/hlm-input-group-text.ts +14 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/input-group/hlm-input-group.ts +18 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/input-group/index.ts +19 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/label/hlm-label.ts +17 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/label/index.ts +5 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/label/label.html +11 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/pagination/hlm-numbered-pagination-query-params.ts +191 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/pagination/hlm-numbered-pagination.ts +290 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/pagination/hlm-pagination-content.ts +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/pagination/hlm-pagination-ellipsis.ts +27 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/pagination/hlm-pagination-item.ts +7 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/pagination/hlm-pagination-link.ts +51 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/pagination/hlm-pagination-next.ts +65 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/pagination/hlm-pagination-previous.ts +65 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/pagination/hlm-pagination.ts +19 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/pagination/index.ts +31 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/popover/hlm-popover-content.ts +25 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/popover/hlm-popover-description.ts +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/popover/hlm-popover-header.ts +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/popover/hlm-popover-portal.ts +8 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/popover/hlm-popover-title.ts +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/popover/hlm-popover-trigger.ts +14 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/popover/hlm-popover.ts +23 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/popover/index.ts +25 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/select/hlm-select-content.ts +44 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/select/hlm-select-group.ts +14 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/select/hlm-select-item.ts +36 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/select/hlm-select-label.ts +14 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/select/hlm-select-multiple.ts +37 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/select/hlm-select-placeholder.ts +17 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/select/hlm-select-portal.ts +8 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/select/hlm-select-scroll-down.ts +22 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/select/hlm-select-scroll-up.ts +22 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/select/hlm-select-separator.ts +14 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/select/hlm-select-trigger.ts +59 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/select/hlm-select-value-template.ts +5 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/select/hlm-select-value.ts +18 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/select/hlm-select-values-content.ts +9 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/select/hlm-select-values.ts +5 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/select/hlm-select.ts +37 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/select/index.ts +52 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/separator/hlm-separator.ts +19 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/separator/index.ts +5 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/skeleton/hlm-skeleton.ts +14 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/skeleton/index.ts +5 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/spinner/hlm-spinner.ts +26 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/spinner/index.ts +5 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/utils/hlm.ts +313 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/utils/index.ts +2 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/utils/provide-spartan-hlm.ts +34 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/utils/async-data.ts +99 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/index.html +13 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/main.ts +5 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/styles.css +139 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/types/sf-globals.d.ts +23 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/tsconfig.app.json +11 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/tsconfig.json +36 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/tsconfig.spec.json +10 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/ui-bundle.json +7 -0
- package/dist/jest.config.js +6 -0
- package/dist/package-lock.json +12554 -0
- package/dist/package.json +46 -0
- package/dist/scripts/apex/hello.apex +10 -0
- package/dist/scripts/gitignore-templates.json +4 -0
- package/dist/scripts/graphql-search.sh +191 -0
- package/dist/scripts/org-setup-config-schema.mjs +132 -0
- package/dist/scripts/org-setup-dev.mjs +114 -0
- package/dist/scripts/org-setup-url.mjs +108 -0
- package/dist/scripts/org-setup-utils.mjs +569 -0
- package/dist/scripts/org-setup-xml.mjs +278 -0
- package/dist/scripts/org-setup.config.json +5 -0
- package/dist/scripts/org-setup.mjs +2537 -0
- package/dist/scripts/sf-project-setup.mjs +103 -0
- package/dist/scripts/soql/account.soql +6 -0
- package/dist/scripts/validate-org-setup-config.mjs +38 -0
- package/dist/sfdx-project.json +12 -0
- package/package.json +46 -0
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure, importable XML helpers for org-setup.mjs network-metadata mutation
|
|
3
|
+
* (W-23043734 — Infrastructure Hygiene).
|
|
4
|
+
*
|
|
5
|
+
* These functions replace the script's former blind-regex editing of
|
|
6
|
+
* `*.network-meta.xml`. The contract is:
|
|
7
|
+
*
|
|
8
|
+
* 1. Parse the XML with `fast-xml-parser` ONLY to assert the expected nodes
|
|
9
|
+
* exist — this kills the old silent no-op (the regex matched nothing on a
|
|
10
|
+
* reformatted file yet the file was still rewritten + success logged).
|
|
11
|
+
* 2. Decide idempotency on the parsed model (profile already a member, self-reg
|
|
12
|
+
* already enabled) so callers keep their existing skip semantics + messages.
|
|
13
|
+
* 3. Mutate via a TARGETED string edit on the original text — NOT a full
|
|
14
|
+
* re-serialize. The XML declaration, the `xmlns` on <Network>,
|
|
15
|
+
* self-closing tags, and the file's existing indentation are preserved
|
|
16
|
+
* byte-for-byte, so a configured file re-run is a true no-op and there is
|
|
17
|
+
* zero deploy-diff hazard on this org-deployed file. (XMLBuilder/prettier
|
|
18
|
+
* are intentionally NOT used — a full re-serialize would churn formatting.)
|
|
19
|
+
* Profile names are asserted free of XML-special characters and interpolated
|
|
20
|
+
* raw — we reject such names rather than entity-escape them (a special
|
|
21
|
+
* character in a config-authored profile name signals a mistake).
|
|
22
|
+
*
|
|
23
|
+
* Pure (no fs / no process): org-setup.mjs reads/writes the file and owns the
|
|
24
|
+
* per-call-site fail mode (throw StepError vs. loud console.error); these
|
|
25
|
+
* helpers only parse, assert, and return the edited text. Kept in a dedicated
|
|
26
|
+
* module so they carry automated coverage: the shipped SFDX package has no test
|
|
27
|
+
* runner, so the specs live in the consuming ui-bundle-template-cli package
|
|
28
|
+
* (patches-cli/test/unit/org-setup-xml.spec.ts) rather than bundling into every
|
|
29
|
+
* generated app's dist/scripts.
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
import { XMLParser } from 'fast-xml-parser';
|
|
33
|
+
|
|
34
|
+
const NETWORK_ROOT = 'Network';
|
|
35
|
+
|
|
36
|
+
/** Parser tuned to read the document faithfully: keep attributes, never coerce
|
|
37
|
+
* values (so `<selfRegistration>false</...>` stays the string "false"). */
|
|
38
|
+
const parser = new XMLParser({
|
|
39
|
+
ignoreAttributes: false,
|
|
40
|
+
parseTagValue: false,
|
|
41
|
+
parseAttributeValue: false,
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Thrown when a required node is absent from the network metadata. Callers map
|
|
46
|
+
* this to the fail mode appropriate to their orchestration position: the
|
|
47
|
+
* post-deploy selfReg step rethrows it as a recorded StepError; the best-effort
|
|
48
|
+
* pre-deploy prep logs it loudly without aborting.
|
|
49
|
+
*/
|
|
50
|
+
export class NetworkXmlError extends Error {}
|
|
51
|
+
|
|
52
|
+
/** Characters that would need XML entity-escaping if interpolated into markup. */
|
|
53
|
+
const XML_SPECIAL_CHARS = /[&<>"']/;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Assert a profile name is safe to interpolate into the network metadata as-is.
|
|
57
|
+
*
|
|
58
|
+
* We deliberately do NOT entity-escape: a self-reg profile name is authored in
|
|
59
|
+
* `org-setup.config.json`, and one containing `&`, `<`, `>`, or quotes almost
|
|
60
|
+
* certainly signals a config mistake rather than a genuine name. Rather than
|
|
61
|
+
* silently rewrite it into `&`-style entities, fail loudly so the author
|
|
62
|
+
* fixes the config. Throws NetworkXmlError (mapped by callers to their fail
|
|
63
|
+
* mode) when the name contains an XML-special character.
|
|
64
|
+
*/
|
|
65
|
+
export function assertSafeProfileName(name) {
|
|
66
|
+
if (XML_SPECIAL_CHARS.test(String(name))) {
|
|
67
|
+
throw new NetworkXmlError(
|
|
68
|
+
`profile name "${name}" contains an XML-special character (& < > " '); ` +
|
|
69
|
+
`use a name without these characters in org-setup.config.json`,
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
return String(name);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Parse + assert this is a Network metadata document. Returns the parsed
|
|
77
|
+
* `Network` object. Throws NetworkXmlError if the root is missing (e.g. a file
|
|
78
|
+
* that is not actually network metadata).
|
|
79
|
+
*/
|
|
80
|
+
export function parseNetwork(xml) {
|
|
81
|
+
let parsed;
|
|
82
|
+
try {
|
|
83
|
+
parsed = parser.parse(xml);
|
|
84
|
+
} catch (e) {
|
|
85
|
+
throw new NetworkXmlError(`network metadata is not well-formed XML: ${e.message}`);
|
|
86
|
+
}
|
|
87
|
+
const network = parsed?.[NETWORK_ROOT];
|
|
88
|
+
if (network == null || typeof network !== 'object') {
|
|
89
|
+
throw new NetworkXmlError(`expected a <${NETWORK_ROOT}> root node, but none was found`);
|
|
90
|
+
}
|
|
91
|
+
return network;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/** Normalize a fast-xml-parser child (absent | scalar | array) to an array. */
|
|
95
|
+
function asArray(node) {
|
|
96
|
+
if (node == null) return [];
|
|
97
|
+
return Array.isArray(node) ? node : [node];
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Indentation for a new <networkMemberGroups> child, derived from the file's
|
|
102
|
+
* own formatting rather than a fixed width — so the targeted edit stays
|
|
103
|
+
* byte-faithful on reformatted (e.g. 2-space) files, not just the shipped
|
|
104
|
+
* 4-space template. Prefer an existing
|
|
105
|
+
* sibling <profile>'s exact indent; otherwise fall back to the
|
|
106
|
+
* <networkMemberGroups> indent doubled (it is always a direct child of the
|
|
107
|
+
* <Network> root, i.e. one level deep).
|
|
108
|
+
*/
|
|
109
|
+
function memberGroupChildIndent(xml) {
|
|
110
|
+
const sibling = xml.match(/\n([ \t]+)<profile>/);
|
|
111
|
+
if (sibling) return sibling[1];
|
|
112
|
+
const parent = xml.match(/\n([ \t]*)<networkMemberGroups>/);
|
|
113
|
+
const parentIndent = parent ? parent[1] : ' ';
|
|
114
|
+
return parentIndent + (parentIndent || ' ');
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Ensure `selfRegProfile` is listed under <networkMemberGroups>.
|
|
119
|
+
*
|
|
120
|
+
* Asserts <networkMemberGroups> exists (throws NetworkXmlError if not). Returns
|
|
121
|
+
* `{ xml, changed }`: `changed: false` (input returned unchanged) when the
|
|
122
|
+
* profile is already a member; otherwise the profile is inserted via a targeted
|
|
123
|
+
* edit right after the opening <networkMemberGroups> tag and `changed: true`.
|
|
124
|
+
*/
|
|
125
|
+
export function addProfileToMemberGroups(xml, selfRegProfile) {
|
|
126
|
+
const network = parseNetwork(xml);
|
|
127
|
+
if (!('networkMemberGroups' in network) || network.networkMemberGroups == null) {
|
|
128
|
+
throw new NetworkXmlError(
|
|
129
|
+
'network metadata has no <networkMemberGroups> node to add the self-reg profile to',
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
const existing = asArray(network.networkMemberGroups.profile).map((p) => String(p));
|
|
133
|
+
if (existing.includes(String(selfRegProfile))) {
|
|
134
|
+
return { xml, changed: false };
|
|
135
|
+
}
|
|
136
|
+
// Reject names with XML-special characters rather than escaping them (see
|
|
137
|
+
// assertSafeProfileName) before interpolating raw.
|
|
138
|
+
const safeName = assertSafeProfileName(selfRegProfile);
|
|
139
|
+
// Targeted edit: insert after the open tag, matching the file's own member
|
|
140
|
+
// indent (preserves formatting on reformatted files).
|
|
141
|
+
const indent = memberGroupChildIndent(xml);
|
|
142
|
+
const updated = xml.replace(
|
|
143
|
+
/(<networkMemberGroups>)/,
|
|
144
|
+
`$1\n${indent}<profile>${safeName}</profile>`,
|
|
145
|
+
);
|
|
146
|
+
return { xml: updated, changed: true };
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Enable self-registration: set <selfRegistration>true</selfRegistration> and
|
|
151
|
+
* add <selfRegProfile>.
|
|
152
|
+
*
|
|
153
|
+
* Asserts <selfRegistration> exists (throws NetworkXmlError if not). Returns
|
|
154
|
+
* `{ xml, changed }`: `changed: false` (input returned unchanged) when self-reg
|
|
155
|
+
* is already enabled or a selfRegProfile is already present — same skip
|
|
156
|
+
* semantics as before; otherwise applies a targeted edit and `changed: true`.
|
|
157
|
+
*/
|
|
158
|
+
export function enableSelfRegInXml(xml, selfRegProfile) {
|
|
159
|
+
const network = parseNetwork(xml);
|
|
160
|
+
if (!('selfRegistration' in network)) {
|
|
161
|
+
throw new NetworkXmlError(
|
|
162
|
+
'network metadata has no <selfRegistration> node to enable self-registration on',
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
const alreadyEnabled = String(network.selfRegistration) === 'true';
|
|
166
|
+
const alreadyHasProfile = 'selfRegProfile' in network;
|
|
167
|
+
if (alreadyEnabled || alreadyHasProfile) {
|
|
168
|
+
return { xml, changed: false };
|
|
169
|
+
}
|
|
170
|
+
// Reject names with XML-special characters rather than escaping them (see
|
|
171
|
+
// assertSafeProfileName) before interpolating raw.
|
|
172
|
+
const safeName = assertSafeProfileName(selfRegProfile);
|
|
173
|
+
let updated = xml.replace(
|
|
174
|
+
/<selfRegistration>false<\/selfRegistration>/,
|
|
175
|
+
'<selfRegistration>true</selfRegistration>',
|
|
176
|
+
);
|
|
177
|
+
updated = updated.replace(
|
|
178
|
+
/(\s*)(<selfRegistration>)/,
|
|
179
|
+
`$1<selfRegProfile>${safeName}</selfRegProfile>\n$1$2`,
|
|
180
|
+
);
|
|
181
|
+
return { xml: updated, changed: true };
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Indentation of the first indented child element, so an inserted node matches
|
|
186
|
+
* the file's own formatting — byte-faithful on 2-space and 4-space files alike.
|
|
187
|
+
* Falls back to 4 spaces when the document has no indented child to sample.
|
|
188
|
+
*/
|
|
189
|
+
function firstChildIndent(xml) {
|
|
190
|
+
const m = xml.match(/\n([ \t]+)</);
|
|
191
|
+
return m ? m[1] : ' ';
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* Assert a logout URL is safe to interpolate into the network metadata as-is.
|
|
196
|
+
*
|
|
197
|
+
* Mirrors assertSafeProfileName: the value is developer-authored config, so a
|
|
198
|
+
* character that would need XML entity-escaping (& < > " ') signals a mistake to
|
|
199
|
+
* surface loudly rather than silently rewrite. A logout landing URL is a site
|
|
200
|
+
* home path/URL and legitimately needs none of these. Throws NetworkXmlError
|
|
201
|
+
* (mapped by callers to their fail mode) otherwise.
|
|
202
|
+
*/
|
|
203
|
+
export function assertSafeLogoutUrl(url) {
|
|
204
|
+
const s = String(url);
|
|
205
|
+
if (XML_SPECIAL_CHARS.test(s)) {
|
|
206
|
+
throw new NetworkXmlError(
|
|
207
|
+
`logoutUrl "${url}" contains an XML-special character (& < > " '); ` +
|
|
208
|
+
`use a URL without these characters in org-setup.config.json`,
|
|
209
|
+
);
|
|
210
|
+
}
|
|
211
|
+
return s;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Set <logoutUrl> so members land on THIS site after logging out, instead of the
|
|
216
|
+
* org's default-site logout — which, in an org hosting multiple Experience Cloud
|
|
217
|
+
* sites, can drop a member on a different community's login page.
|
|
218
|
+
*
|
|
219
|
+
* `url` MUST already be an absolute URL: the platform rejects a relative value at
|
|
220
|
+
* deploy time ("The logout page URL must be an absolute URL."). A shipped
|
|
221
|
+
* site-relative config path is resolved to an absolute URL before this is called
|
|
222
|
+
* (see org-setup-url.mjs, driven by ensureLogoutUrl in org-setup.mjs).
|
|
223
|
+
*
|
|
224
|
+
* Asserts this is a Network document (throws NetworkXmlError otherwise). Returns
|
|
225
|
+
* `{ xml, changed }`:
|
|
226
|
+
* - `changed: false` (input returned unchanged) when <logoutUrl> already equals
|
|
227
|
+
* `url` — a configured re-run is a true byte-for-byte no-op.
|
|
228
|
+
* - present-but-different: the value is replaced in place (position preserved).
|
|
229
|
+
* - absent: a <logoutUrl> node is inserted in the CANONICAL position the Metadata
|
|
230
|
+
* API emits. Network's top-level elements serialize in alphabetical order, so
|
|
231
|
+
* the node is placed immediately before the first existing sibling that sorts
|
|
232
|
+
* after "logoutUrl" (or as the last child, before </Network>, when none does).
|
|
233
|
+
* Inserting where a later retrieve would place it keeps this org-deployed file
|
|
234
|
+
* free of reorder churn. The node adopts the file's own indentation and every
|
|
235
|
+
* untouched region is preserved byte-for-byte.
|
|
236
|
+
*
|
|
237
|
+
* Assumes an existing <logoutUrl> is a paired, non-empty node (the shipped sparse
|
|
238
|
+
* network omits it entirely; a deployed org carries a paired value) — the case
|
|
239
|
+
* this productizes.
|
|
240
|
+
*/
|
|
241
|
+
export function setLogoutUrl(xml, url) {
|
|
242
|
+
const network = parseNetwork(xml);
|
|
243
|
+
// Reject XML-special characters rather than escaping them (see
|
|
244
|
+
// assertSafeLogoutUrl) before interpolating raw.
|
|
245
|
+
const safeUrl = assertSafeLogoutUrl(url);
|
|
246
|
+
const current = 'logoutUrl' in network ? String(network.logoutUrl) : null;
|
|
247
|
+
if (current === safeUrl) {
|
|
248
|
+
return { xml, changed: false };
|
|
249
|
+
}
|
|
250
|
+
const node = `<logoutUrl>${safeUrl}</logoutUrl>`;
|
|
251
|
+
// Present-but-different — replace the value in place (preserves position).
|
|
252
|
+
if (/<logoutUrl>[^<]*<\/logoutUrl>/.test(xml)) {
|
|
253
|
+
return { xml: xml.replace(/<logoutUrl>[^<]*<\/logoutUrl>/, node), changed: true };
|
|
254
|
+
}
|
|
255
|
+
// Absent — insert in alphabetical order among the Network's top-level children to
|
|
256
|
+
// match the canonical Metadata API serialization. parseNetwork's keys are the
|
|
257
|
+
// direct child element names; drop fast-xml-parser's attribute (@_*) and text
|
|
258
|
+
// (#*) pseudo-keys.
|
|
259
|
+
const siblings = Object.keys(network).filter((k) => !k.startsWith('@_') && !k.startsWith('#'));
|
|
260
|
+
// The first sibling that sorts AFTER "logoutUrl" — the node goes just before it.
|
|
261
|
+
const successor = siblings.filter((name) => name > 'logoutUrl').sort()[0];
|
|
262
|
+
if (successor) {
|
|
263
|
+
const beforeSuccessor = new RegExp(`(\\n[ \\t]*)(<${successor}\\b)`);
|
|
264
|
+
if (beforeSuccessor.test(xml)) {
|
|
265
|
+
// Reuse the successor's own leading whitespace so the node adopts its indent.
|
|
266
|
+
return { xml: xml.replace(beforeSuccessor, `$1${node}$1$2`), changed: true };
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
// No later-sorting sibling (or its tag wasn't found) — insert as the last child,
|
|
270
|
+
// right before </Network>, at the file's own indent.
|
|
271
|
+
const indent = firstChildIndent(xml);
|
|
272
|
+
const beforeClose = /(\n)([ \t]*<\/Network>)/;
|
|
273
|
+
if (beforeClose.test(xml)) {
|
|
274
|
+
return { xml: xml.replace(beforeClose, `\n${indent}${node}$1$2`), changed: true };
|
|
275
|
+
}
|
|
276
|
+
// Degenerate single-line / rootless form — fall back to just after the open tag.
|
|
277
|
+
return { xml: xml.replace(/(<Network\b[^>]*>)/, `$1\n${indent}${node}`), changed: true };
|
|
278
|
+
}
|