@salesforce/ui-bundle-template-feature-vue-language-switcher 0.0.0-stage → 13.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.txt +82 -0
- package/README.md +141 -2
- 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 +5431 -0
- package/dist/README.md +83 -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-vue-language-switcher/.forceignore +15 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/.graphqlrc.yml +2 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/.prettierignore +9 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/.prettierrc +11 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/README.md +43 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/codegen.yml +95 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/components.json +19 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/e2e/app.spec.ts +17 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/eslint.config.js +124 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/feature-vue-language-switcher.uibundle-meta.xml +7 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/index.html +12 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/package.json +72 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/playwright.config.ts +24 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/scripts/get-graphql-schema.mjs +71 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/scripts/rewrite-e2e-assets.mjs +23 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/App.vue +5 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/api/graphqlClient.ts +44 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/appLayout.vue +80 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/alerts/status-alert.vue +59 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/layouts/card-layout.vue +30 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/alert/Alert.vue +21 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/alert/AlertAction.vue +17 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/alert/AlertDescription.vue +22 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/alert/AlertTitle.vue +22 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/alert/index.ts +25 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/avatar/Avatar.vue +23 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/avatar/AvatarFallback.vue +31 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/avatar/AvatarImage.vue +16 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/avatar/index.ts +3 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/button/Button.vue +33 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/button/index.ts +43 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/card/Card.vue +29 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/card/CardAction.vue +22 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/card/CardContent.vue +17 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/card/CardDescription.vue +17 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/card/CardFooter.vue +22 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/card/CardHeader.vue +22 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/card/CardTitle.vue +22 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/card/index.ts +7 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/checkbox/Checkbox.vue +43 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/checkbox/index.ts +1 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/collapsible/Collapsible.vue +19 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/collapsible/CollapsibleContent.vue +12 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/collapsible/CollapsibleTrigger.vue +12 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/collapsible/index.ts +3 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/dialog/Dialog.vue +15 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/dialog/DialogClose.vue +12 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/dialog/DialogContent.vue +59 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/dialog/DialogDescription.vue +31 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/dialog/DialogFooter.vue +33 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/dialog/DialogHeader.vue +17 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/dialog/DialogOverlay.vue +31 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/dialog/DialogPortal.vue +12 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/dialog/DialogTitle.vue +26 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/dialog/DialogTrigger.vue +12 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/dialog/index.ts +10 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/dropdown-menu/DropdownMenu.vue +19 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/dropdown-menu/DropdownMenuCheckboxItem.vue +51 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/dropdown-menu/DropdownMenuContent.vue +47 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/dropdown-menu/DropdownMenuGroup.vue +12 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/dropdown-menu/DropdownMenuItem.vue +44 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/dropdown-menu/DropdownMenuLabel.vue +30 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/dropdown-menu/DropdownMenuPortal.vue +12 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/dropdown-menu/DropdownMenuRadioGroup.vue +21 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/dropdown-menu/DropdownMenuRadioItem.vue +52 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/dropdown-menu/DropdownMenuSeparator.vue +26 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/dropdown-menu/DropdownMenuShortcut.vue +19 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/dropdown-menu/DropdownMenuSub.vue +19 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/dropdown-menu/DropdownMenuSubContent.vue +37 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/dropdown-menu/DropdownMenuSubTrigger.vue +38 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/dropdown-menu/DropdownMenuTrigger.vue +17 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/dropdown-menu/index.ts +15 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/field/Field.vue +27 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/field/FieldContent.vue +22 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/field/FieldDescription.vue +24 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/field/FieldError.vue +48 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/field/FieldGroup.vue +22 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/field/FieldLabel.vue +24 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/field/FieldLegend.vue +29 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/field/FieldSeparator.vue +31 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/field/FieldSet.vue +22 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/field/FieldTitle.vue +22 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/field/index.ts +33 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/index.ts +115 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/input/Input.vue +30 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/input/index.ts +1 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/label/Label.vue +29 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/label/index.ts +1 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/pagination/Pagination.vue +17 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/pagination/PaginationContent.vue +15 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/pagination/PaginationEllipsis.vue +23 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/pagination/PaginationItem.vue +7 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/pagination/PaginationLink.vue +31 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/pagination/PaginationNext.vue +29 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/pagination/PaginationPrevious.vue +29 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/pagination/index.ts +7 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/popover/Popover.vue +15 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/popover/PopoverAnchor.vue +12 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/popover/PopoverContent.vue +44 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/popover/PopoverDescription.vue +17 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/popover/PopoverHeader.vue +17 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/popover/PopoverTitle.vue +14 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/popover/PopoverTrigger.vue +12 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/popover/index.ts +7 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/select/Select.vue +15 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/select/SelectContent.vue +65 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/select/SelectGroup.vue +26 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/select/SelectItem.vue +41 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/select/SelectLabel.vue +26 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/select/SelectScrollDownButton.vue +32 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/select/SelectScrollUpButton.vue +32 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/select/SelectSeparator.vue +24 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/select/SelectTrigger.vue +45 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/select/SelectValue.vue +12 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/select/index.ts +10 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/separator/Separator.vue +33 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/separator/index.ts +1 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/skeleton/Skeleton.vue +15 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/skeleton/index.ts +1 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/sonner/Sonner.vue +29 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/sonner/index.ts +3 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/spinner/Spinner.vue +17 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/components/ui/spinner/index.ts +1 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/composables/useAsyncData.ts +69 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/features/language-switcher/LanguageSwitcher.vue +75 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/features/language-switcher/__examples__/language-switcher-example.vue +34 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/features/language-switcher/__examples__/vite-config-site-example.ts +44 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/features/language-switcher/buildLanguageUrl.ts +158 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/features/language-switcher/getCurrentLanguage.ts +59 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/features/language-switcher/index.ts +31 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/features/language-switcher/languages.ts +46 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/index.ts +8 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/lib/utils.ts +6 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/main.ts +6 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/pages/Home.vue +10 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/pages/NotFound.vue +18 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/router-utils.ts +32 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/router.ts +40 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/styles/global.css +134 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/test/setup.ts +1 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/types/globals.d.ts +23 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/tsconfig.json +45 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/tsconfig.node.json +13 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/tsconfig.tsbuildinfo +1 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/ui-bundle.json +7 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/vite-env.d.ts +14 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/vite.config.ts +106 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/vitest-env.d.ts +2 -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/network-senders.mjs +84 -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 +283 -0
- package/dist/scripts/org-setup.config.json +5 -0
- package/dist/scripts/org-setup.mjs +2545 -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 +51 -4
- package/src/force-app/main/default/uiBundles/feature-vue-language-switcher/src/features/language-switcher/LanguageSwitcher.vue +75 -0
- package/src/force-app/main/default/uiBundles/feature-vue-language-switcher/src/features/language-switcher/__examples__/language-switcher-example.vue +34 -0
- package/src/force-app/main/default/uiBundles/feature-vue-language-switcher/src/features/language-switcher/__examples__/vite-config-site-example.ts +44 -0
- package/src/force-app/main/default/uiBundles/feature-vue-language-switcher/src/features/language-switcher/buildLanguageUrl.ts +158 -0
- package/src/force-app/main/default/uiBundles/feature-vue-language-switcher/src/features/language-switcher/getCurrentLanguage.ts +59 -0
- package/src/force-app/main/default/uiBundles/feature-vue-language-switcher/src/features/language-switcher/index.ts +31 -0
- package/src/force-app/main/default/uiBundles/feature-vue-language-switcher/src/features/language-switcher/languages.ts +46 -0
- package/src/force-app/main/default/uiBundles/feature-vue-language-switcher/src/index.ts +8 -0
- package/src/force-app/main/default/uiBundles/feature-vue-language-switcher/src/types/globals.d.ts +23 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, Salesforce, Inc.,
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* For full license text, see the LICENSE.txt file
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/** A single language option offered by the switcher. */
|
|
8
|
+
export interface LanguageOption {
|
|
9
|
+
/** Salesforce locale code, e.g. "en_US". Used as the URL path segment. */
|
|
10
|
+
code: string;
|
|
11
|
+
/** Human-readable label shown in the dropdown, e.g. "English". */
|
|
12
|
+
label: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* The languages this app offers in the switcher.
|
|
17
|
+
*
|
|
18
|
+
* IMPORTANT — keep this list in sync BY HAND with the site's language settings:
|
|
19
|
+
* digitalExperiences/site/<siteName>/sfdc_cms__languageSettings/content.json
|
|
20
|
+
*
|
|
21
|
+
* There is no runtime API to read `sfdc_cms__languageSettings` on a published
|
|
22
|
+
* site, so the supported languages are baked into the bundle at authoring time.
|
|
23
|
+
* When the site's content.json changes, update this array (and
|
|
24
|
+
* {@link DEFAULT_LANGUAGE}) to match.
|
|
25
|
+
*
|
|
26
|
+
* `code` values are Salesforce locale codes (underscores). They are converted to
|
|
27
|
+
* hyphenated form for use as the first URL path segment after `basePath` (e.g.
|
|
28
|
+
* `en_US` → `/en-US/...`, `fr` → `/fr/...`). Display order here is the order shown
|
|
29
|
+
* in the dropdown.
|
|
30
|
+
*/
|
|
31
|
+
export const LANGUAGES: readonly LanguageOption[] = [
|
|
32
|
+
{ code: "en_US", label: "English" },
|
|
33
|
+
{ code: "fr", label: "Français" },
|
|
34
|
+
{ code: "es", label: "Español" },
|
|
35
|
+
{ code: "de", label: "Deutsch" },
|
|
36
|
+
{ code: "ja", label: "日本語" },
|
|
37
|
+
];
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Language used when `SFDC_ENV.language` is missing or is not one of
|
|
41
|
+
* {@link LANGUAGES}. Should match the site's default language in content.json.
|
|
42
|
+
*/
|
|
43
|
+
export const DEFAULT_LANGUAGE = "en_US";
|
|
44
|
+
|
|
45
|
+
/** Set of known language codes, for fast membership checks. */
|
|
46
|
+
export const LANGUAGE_CODES: ReadonlySet<string> = new Set(LANGUAGES.map((l) => l.code));
|
package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/pages/Home.vue
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<script setup lang="ts"></script>
|
|
2
|
+
|
|
3
|
+
<template>
|
|
4
|
+
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12">
|
|
5
|
+
<div class="text-center">
|
|
6
|
+
<h1 class="text-4xl font-bold text-gray-900 mb-4">Home</h1>
|
|
7
|
+
<p class="text-lg text-gray-600 mb-8">Welcome to your Vue application.</p>
|
|
8
|
+
</div>
|
|
9
|
+
</div>
|
|
10
|
+
</template>
|
package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/pages/NotFound.vue
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { RouterLink } from 'vue-router';
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<template>
|
|
6
|
+
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12">
|
|
7
|
+
<div class="text-center">
|
|
8
|
+
<h1 class="text-4xl font-bold text-gray-900 mb-4">404</h1>
|
|
9
|
+
<p class="text-lg text-gray-600 mb-8">Page not found</p>
|
|
10
|
+
<RouterLink
|
|
11
|
+
to="/"
|
|
12
|
+
class="inline-block px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 transition-colors"
|
|
13
|
+
>
|
|
14
|
+
Go to Home
|
|
15
|
+
</RouterLink>
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
</template>
|
package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/router-utils.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { RouteRecordRaw } from 'vue-router';
|
|
2
|
+
import { routes } from './router';
|
|
3
|
+
|
|
4
|
+
export type RouteWithFullPath = RouteRecordRaw & { fullPath: string };
|
|
5
|
+
|
|
6
|
+
const joinPath = (parentPath: string, childPath: string): string => {
|
|
7
|
+
if (childPath.startsWith('/')) {
|
|
8
|
+
return childPath;
|
|
9
|
+
}
|
|
10
|
+
if (childPath === '') {
|
|
11
|
+
return parentPath || '/';
|
|
12
|
+
}
|
|
13
|
+
return parentPath === '/' ? `/${childPath}` : `${parentPath}/${childPath}`;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const flatMapRoutes = (
|
|
17
|
+
route: RouteRecordRaw,
|
|
18
|
+
parentPath: string = ''
|
|
19
|
+
): RouteWithFullPath[] => {
|
|
20
|
+
const fullPath = joinPath(parentPath, route.path ?? '');
|
|
21
|
+
|
|
22
|
+
const routeWithPath = { ...route, fullPath } as RouteWithFullPath;
|
|
23
|
+
|
|
24
|
+
const childRoutes =
|
|
25
|
+
route.children?.flatMap(child => flatMapRoutes(child, fullPath)) || [];
|
|
26
|
+
|
|
27
|
+
return [routeWithPath, ...childRoutes];
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export const getAllRoutes = (): RouteWithFullPath[] => {
|
|
31
|
+
return routes.flatMap(route => flatMapRoutes(route));
|
|
32
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createRouter,
|
|
3
|
+
createWebHistory,
|
|
4
|
+
type RouteRecordRaw,
|
|
5
|
+
} from 'vue-router';
|
|
6
|
+
import AppLayout from '@/appLayout.vue';
|
|
7
|
+
import HomePage from '@/pages/Home.vue';
|
|
8
|
+
import NotFound from '@/pages/NotFound.vue';
|
|
9
|
+
|
|
10
|
+
// The route-merger composes feature routes into this `routes` array by matching
|
|
11
|
+
// on `path`, so features ship a router.ts with the same top-level `path: ''`
|
|
12
|
+
// node and their child routes are appended as siblings of the base app's routes.
|
|
13
|
+
export const routes: RouteRecordRaw[] = [
|
|
14
|
+
{
|
|
15
|
+
path: '/',
|
|
16
|
+
component: AppLayout,
|
|
17
|
+
children: [
|
|
18
|
+
{
|
|
19
|
+
path: '',
|
|
20
|
+
component: HomePage,
|
|
21
|
+
meta: { showInNavigation: true, label: 'Home' },
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
path: ':pathMatch(.*)*',
|
|
25
|
+
component: NotFound,
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
},
|
|
29
|
+
];
|
|
30
|
+
|
|
31
|
+
// Normalize basename: strip trailing slash so it matches URLs like /lwr/application/ai/c-app
|
|
32
|
+
const rawBasePath = (globalThis as { SFDC_ENV?: { basePath?: string } })
|
|
33
|
+
.SFDC_ENV?.basePath;
|
|
34
|
+
const basename =
|
|
35
|
+
typeof rawBasePath === 'string' ? rawBasePath.replace(/\/+$/, '') : undefined;
|
|
36
|
+
|
|
37
|
+
export const router = createRouter({
|
|
38
|
+
history: createWebHistory(basename),
|
|
39
|
+
routes,
|
|
40
|
+
});
|
package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/styles/global.css
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
@import 'tailwindcss';
|
|
2
|
+
|
|
3
|
+
@layer base {
|
|
4
|
+
html,
|
|
5
|
+
body,
|
|
6
|
+
#app {
|
|
7
|
+
@apply min-h-screen;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
body {
|
|
11
|
+
@apply antialiased bg-white;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
@import 'tw-animate-css';
|
|
16
|
+
|
|
17
|
+
@custom-variant dark (&:is(.dark *));
|
|
18
|
+
|
|
19
|
+
@theme inline {
|
|
20
|
+
--color-background: var(--background);
|
|
21
|
+
--color-foreground: var(--foreground);
|
|
22
|
+
--color-card: var(--card);
|
|
23
|
+
--color-card-foreground: var(--card-foreground);
|
|
24
|
+
--color-popover: var(--popover);
|
|
25
|
+
--color-popover-foreground: var(--popover-foreground);
|
|
26
|
+
--color-primary: var(--primary);
|
|
27
|
+
--color-primary-foreground: var(--primary-foreground);
|
|
28
|
+
--color-secondary: var(--secondary);
|
|
29
|
+
--color-secondary-foreground: var(--secondary-foreground);
|
|
30
|
+
--color-muted: var(--muted);
|
|
31
|
+
--color-muted-foreground: var(--muted-foreground);
|
|
32
|
+
--color-accent: var(--accent);
|
|
33
|
+
--color-accent-foreground: var(--accent-foreground);
|
|
34
|
+
--color-destructive: var(--destructive);
|
|
35
|
+
--color-destructive-foreground: var(--destructive-foreground);
|
|
36
|
+
--color-border: var(--border);
|
|
37
|
+
--color-input: var(--input);
|
|
38
|
+
--color-ring: var(--ring);
|
|
39
|
+
--color-chart-1: var(--chart-1);
|
|
40
|
+
--color-chart-2: var(--chart-2);
|
|
41
|
+
--color-chart-3: var(--chart-3);
|
|
42
|
+
--color-chart-4: var(--chart-4);
|
|
43
|
+
--color-chart-5: var(--chart-5);
|
|
44
|
+
--radius-sm: calc(var(--radius) - 4px);
|
|
45
|
+
--radius-md: calc(var(--radius) - 2px);
|
|
46
|
+
--radius-lg: var(--radius);
|
|
47
|
+
--radius-xl: calc(var(--radius) + 4px);
|
|
48
|
+
--color-sidebar: var(--sidebar);
|
|
49
|
+
--color-sidebar-foreground: var(--sidebar-foreground);
|
|
50
|
+
--color-sidebar-primary: var(--sidebar-primary);
|
|
51
|
+
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
|
|
52
|
+
--color-sidebar-accent: var(--sidebar-accent);
|
|
53
|
+
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
|
|
54
|
+
--color-sidebar-border: var(--sidebar-border);
|
|
55
|
+
--color-sidebar-ring: var(--sidebar-ring);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
:root {
|
|
59
|
+
--radius: 0.625rem;
|
|
60
|
+
--background: oklch(1 0 0);
|
|
61
|
+
--foreground: oklch(0.145 0 0);
|
|
62
|
+
--card: oklch(1 0 0);
|
|
63
|
+
--card-foreground: oklch(0.145 0 0);
|
|
64
|
+
--popover: oklch(1 0 0);
|
|
65
|
+
--popover-foreground: oklch(0.145 0 0);
|
|
66
|
+
--primary: oklch(0.205 0 0);
|
|
67
|
+
--primary-foreground: oklch(0.985 0 0);
|
|
68
|
+
--secondary: oklch(0.97 0 0);
|
|
69
|
+
--secondary-foreground: oklch(0.205 0 0);
|
|
70
|
+
--muted: oklch(0.97 0 0);
|
|
71
|
+
--muted-foreground: oklch(0.556 0 0);
|
|
72
|
+
--accent: oklch(0.97 0 0);
|
|
73
|
+
--accent-foreground: oklch(0.205 0 0);
|
|
74
|
+
--destructive: oklch(0.577 0.245 27.325);
|
|
75
|
+
--border: oklch(0.922 0 0);
|
|
76
|
+
--input: oklch(0.922 0 0);
|
|
77
|
+
--ring: oklch(0.708 0 0);
|
|
78
|
+
--chart-1: oklch(0.646 0.222 41.116);
|
|
79
|
+
--chart-2: oklch(0.6 0.118 184.704);
|
|
80
|
+
--chart-3: oklch(0.398 0.07 227.392);
|
|
81
|
+
--chart-4: oklch(0.828 0.189 84.429);
|
|
82
|
+
--chart-5: oklch(0.769 0.188 70.08);
|
|
83
|
+
--sidebar: oklch(0.985 0 0);
|
|
84
|
+
--sidebar-foreground: oklch(0.145 0 0);
|
|
85
|
+
--sidebar-primary: oklch(0.205 0 0);
|
|
86
|
+
--sidebar-primary-foreground: oklch(0.985 0 0);
|
|
87
|
+
--sidebar-accent: oklch(0.97 0 0);
|
|
88
|
+
--sidebar-accent-foreground: oklch(0.205 0 0);
|
|
89
|
+
--sidebar-border: oklch(0.922 0 0);
|
|
90
|
+
--sidebar-ring: oklch(0.708 0 0);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.dark {
|
|
94
|
+
--background: oklch(0.145 0 0);
|
|
95
|
+
--foreground: oklch(0.985 0 0);
|
|
96
|
+
--card: oklch(0.205 0 0);
|
|
97
|
+
--card-foreground: oklch(0.985 0 0);
|
|
98
|
+
--popover: oklch(0.205 0 0);
|
|
99
|
+
--popover-foreground: oklch(0.985 0 0);
|
|
100
|
+
--primary: oklch(0.922 0 0);
|
|
101
|
+
--primary-foreground: oklch(0.205 0 0);
|
|
102
|
+
--secondary: oklch(0.269 0 0);
|
|
103
|
+
--secondary-foreground: oklch(0.985 0 0);
|
|
104
|
+
--muted: oklch(0.269 0 0);
|
|
105
|
+
--muted-foreground: oklch(0.708 0 0);
|
|
106
|
+
--accent: oklch(0.269 0 0);
|
|
107
|
+
--accent-foreground: oklch(0.985 0 0);
|
|
108
|
+
--destructive: oklch(0.704 0.191 22.216);
|
|
109
|
+
--border: oklch(1 0 0 / 10%);
|
|
110
|
+
--input: oklch(1 0 0 / 15%);
|
|
111
|
+
--ring: oklch(0.556 0 0);
|
|
112
|
+
--chart-1: oklch(0.488 0.243 264.376);
|
|
113
|
+
--chart-2: oklch(0.696 0.17 162.48);
|
|
114
|
+
--chart-3: oklch(0.769 0.188 70.08);
|
|
115
|
+
--chart-4: oklch(0.627 0.265 303.9);
|
|
116
|
+
--chart-5: oklch(0.645 0.246 16.439);
|
|
117
|
+
--sidebar: oklch(0.205 0 0);
|
|
118
|
+
--sidebar-foreground: oklch(0.985 0 0);
|
|
119
|
+
--sidebar-primary: oklch(0.488 0.243 264.376);
|
|
120
|
+
--sidebar-primary-foreground: oklch(0.985 0 0);
|
|
121
|
+
--sidebar-accent: oklch(0.269 0 0);
|
|
122
|
+
--sidebar-accent-foreground: oklch(0.985 0 0);
|
|
123
|
+
--sidebar-border: oklch(1 0 0 / 10%);
|
|
124
|
+
--sidebar-ring: oklch(0.556 0 0);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
@layer base {
|
|
128
|
+
* {
|
|
129
|
+
@apply border-border outline-ring/50;
|
|
130
|
+
}
|
|
131
|
+
body {
|
|
132
|
+
@apply bg-background text-foreground;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom/vitest';
|
package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/src/types/globals.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, Salesforce, Inc.,
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* For full license text, see the LICENSE.txt file
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Ambient augmentation of the runtime environment on {@link globalThis.SFDC_ENV}.
|
|
9
|
+
*
|
|
10
|
+
* The platform's `SfdcEnv` (see `@salesforce/platform-sdk`) does not yet declare
|
|
11
|
+
* a `language` field. The language switcher reads the active language from it, so
|
|
12
|
+
* we augment the interface with an optional `language` here. Because declared
|
|
13
|
+
* interfaces merge, this only ADDS `language` — it does not redeclare `basePath`
|
|
14
|
+
* or the other platform-owned fields.
|
|
15
|
+
*
|
|
16
|
+
* Expected value: the page locale in hyphenated form, e.g. `"en-US"` — the
|
|
17
|
+
* platform converts the underscore locale code (`en_US`) to dashes before
|
|
18
|
+
* injecting it into `SFDC_ENV`.
|
|
19
|
+
*/
|
|
20
|
+
interface SfdcEnv {
|
|
21
|
+
/** Current page language in hyphenated form, e.g. "en-US". */
|
|
22
|
+
language?: string;
|
|
23
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"useDefineForClassFields": true,
|
|
5
|
+
"lib": ["ES2022", "DOM", "DOM.Iterable"],
|
|
6
|
+
"module": "ESNext",
|
|
7
|
+
"skipLibCheck": true,
|
|
8
|
+
|
|
9
|
+
/* Bundler mode */
|
|
10
|
+
"moduleResolution": "bundler",
|
|
11
|
+
"allowImportingTsExtensions": true,
|
|
12
|
+
"resolveJsonModule": true,
|
|
13
|
+
"isolatedModules": true,
|
|
14
|
+
"noEmit": true,
|
|
15
|
+
"jsx": "preserve",
|
|
16
|
+
|
|
17
|
+
/* Linting */
|
|
18
|
+
"strict": true,
|
|
19
|
+
"noUnusedLocals": true,
|
|
20
|
+
"noUnusedParameters": true,
|
|
21
|
+
"noFallthroughCasesInSwitch": true,
|
|
22
|
+
|
|
23
|
+
/* Path mapping */
|
|
24
|
+
"paths": {
|
|
25
|
+
"@/*": ["./src/*"],
|
|
26
|
+
"@api/*": ["./src/api/*"],
|
|
27
|
+
"@components/*": ["./src/components/*"],
|
|
28
|
+
"@utils/*": ["./src/utils/*"],
|
|
29
|
+
"@styles/*": ["./src/styles/*"],
|
|
30
|
+
"@assets/*": ["./src/assets/*"],
|
|
31
|
+
"@salesforce/platform-sdk": [
|
|
32
|
+
"../../../../../../../../../../packages/sdk/platform-sdk/src/index.ts"
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"include": [
|
|
37
|
+
"src/**/*.ts",
|
|
38
|
+
"src/**/*.vue",
|
|
39
|
+
"e2e",
|
|
40
|
+
"vite-env.d.ts",
|
|
41
|
+
"vitest-env.d.ts",
|
|
42
|
+
"../../../../../../../../../../packages/sdk/platform-sdk/types"
|
|
43
|
+
],
|
|
44
|
+
"references": [{ "path": "./tsconfig.node.json" }]
|
|
45
|
+
}
|
package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/tsconfig.node.json
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"composite": true,
|
|
4
|
+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
|
|
5
|
+
"skipLibCheck": true,
|
|
6
|
+
"module": "ESNext",
|
|
7
|
+
"moduleResolution": "bundler",
|
|
8
|
+
"allowSyntheticDefaultImports": true,
|
|
9
|
+
"strict": true,
|
|
10
|
+
"outDir": "./build"
|
|
11
|
+
},
|
|
12
|
+
"include": ["vite.config.ts"]
|
|
13
|
+
}
|
package/dist/force-app/main/default/uiBundles/feature-vue-language-switcher/tsconfig.tsbuildinfo
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"root":["./src/index.ts","./src/main.ts","./src/router-utils.ts","./src/router.ts","./src/api/graphqlClient.ts","./src/components/ui/index.ts","./src/components/ui/alert/index.ts","./src/components/ui/avatar/index.ts","./src/components/ui/button/index.ts","./src/components/ui/card/index.ts","./src/components/ui/checkbox/index.ts","./src/components/ui/collapsible/index.ts","./src/components/ui/dialog/index.ts","./src/components/ui/dropdown-menu/index.ts","./src/components/ui/field/index.ts","./src/components/ui/input/index.ts","./src/components/ui/label/index.ts","./src/components/ui/pagination/index.ts","./src/components/ui/popover/index.ts","./src/components/ui/select/index.ts","./src/components/ui/separator/index.ts","./src/components/ui/skeleton/index.ts","./src/components/ui/sonner/index.ts","./src/components/ui/spinner/index.ts","./src/composables/useAsyncData.ts","./src/features/language-switcher/buildLanguageUrl.ts","./src/features/language-switcher/getCurrentLanguage.ts","./src/features/language-switcher/index.ts","./src/features/language-switcher/languages.ts","./src/features/language-switcher/__examples__/vite-config-site-example.ts","./src/lib/utils.ts","./src/test/setup.ts","./src/types/globals.d.ts","./src/App.vue","./src/appLayout.vue","./src/components/alerts/status-alert.vue","./src/components/layouts/card-layout.vue","./src/components/ui/alert/Alert.vue","./src/components/ui/alert/AlertAction.vue","./src/components/ui/alert/AlertDescription.vue","./src/components/ui/alert/AlertTitle.vue","./src/components/ui/avatar/Avatar.vue","./src/components/ui/avatar/AvatarFallback.vue","./src/components/ui/avatar/AvatarImage.vue","./src/components/ui/button/Button.vue","./src/components/ui/card/Card.vue","./src/components/ui/card/CardAction.vue","./src/components/ui/card/CardContent.vue","./src/components/ui/card/CardDescription.vue","./src/components/ui/card/CardFooter.vue","./src/components/ui/card/CardHeader.vue","./src/components/ui/card/CardTitle.vue","./src/components/ui/checkbox/Checkbox.vue","./src/components/ui/collapsible/Collapsible.vue","./src/components/ui/collapsible/CollapsibleContent.vue","./src/components/ui/collapsible/CollapsibleTrigger.vue","./src/components/ui/dialog/Dialog.vue","./src/components/ui/dialog/DialogClose.vue","./src/components/ui/dialog/DialogContent.vue","./src/components/ui/dialog/DialogDescription.vue","./src/components/ui/dialog/DialogFooter.vue","./src/components/ui/dialog/DialogHeader.vue","./src/components/ui/dialog/DialogOverlay.vue","./src/components/ui/dialog/DialogPortal.vue","./src/components/ui/dialog/DialogTitle.vue","./src/components/ui/dialog/DialogTrigger.vue","./src/components/ui/dropdown-menu/DropdownMenu.vue","./src/components/ui/dropdown-menu/DropdownMenuCheckboxItem.vue","./src/components/ui/dropdown-menu/DropdownMenuContent.vue","./src/components/ui/dropdown-menu/DropdownMenuGroup.vue","./src/components/ui/dropdown-menu/DropdownMenuItem.vue","./src/components/ui/dropdown-menu/DropdownMenuLabel.vue","./src/components/ui/dropdown-menu/DropdownMenuPortal.vue","./src/components/ui/dropdown-menu/DropdownMenuRadioGroup.vue","./src/components/ui/dropdown-menu/DropdownMenuRadioItem.vue","./src/components/ui/dropdown-menu/DropdownMenuSeparator.vue","./src/components/ui/dropdown-menu/DropdownMenuShortcut.vue","./src/components/ui/dropdown-menu/DropdownMenuSub.vue","./src/components/ui/dropdown-menu/DropdownMenuSubContent.vue","./src/components/ui/dropdown-menu/DropdownMenuSubTrigger.vue","./src/components/ui/dropdown-menu/DropdownMenuTrigger.vue","./src/components/ui/field/Field.vue","./src/components/ui/field/FieldContent.vue","./src/components/ui/field/FieldDescription.vue","./src/components/ui/field/FieldError.vue","./src/components/ui/field/FieldGroup.vue","./src/components/ui/field/FieldLabel.vue","./src/components/ui/field/FieldLegend.vue","./src/components/ui/field/FieldSeparator.vue","./src/components/ui/field/FieldSet.vue","./src/components/ui/field/FieldTitle.vue","./src/components/ui/input/Input.vue","./src/components/ui/label/Label.vue","./src/components/ui/pagination/Pagination.vue","./src/components/ui/pagination/PaginationContent.vue","./src/components/ui/pagination/PaginationEllipsis.vue","./src/components/ui/pagination/PaginationItem.vue","./src/components/ui/pagination/PaginationLink.vue","./src/components/ui/pagination/PaginationNext.vue","./src/components/ui/pagination/PaginationPrevious.vue","./src/components/ui/popover/Popover.vue","./src/components/ui/popover/PopoverAnchor.vue","./src/components/ui/popover/PopoverContent.vue","./src/components/ui/popover/PopoverDescription.vue","./src/components/ui/popover/PopoverHeader.vue","./src/components/ui/popover/PopoverTitle.vue","./src/components/ui/popover/PopoverTrigger.vue","./src/components/ui/select/Select.vue","./src/components/ui/select/SelectContent.vue","./src/components/ui/select/SelectGroup.vue","./src/components/ui/select/SelectItem.vue","./src/components/ui/select/SelectLabel.vue","./src/components/ui/select/SelectScrollDownButton.vue","./src/components/ui/select/SelectScrollUpButton.vue","./src/components/ui/select/SelectSeparator.vue","./src/components/ui/select/SelectTrigger.vue","./src/components/ui/select/SelectValue.vue","./src/components/ui/separator/Separator.vue","./src/components/ui/skeleton/Skeleton.vue","./src/components/ui/sonner/Sonner.vue","./src/components/ui/spinner/Spinner.vue","./src/features/language-switcher/LanguageSwitcher.vue","./src/features/language-switcher/__examples__/language-switcher-example.vue","./src/pages/Home.vue","./src/pages/NotFound.vue","./e2e/app.spec.ts","./vite-env.d.ts","./vitest-env.d.ts","../../../../../../../../../sdk/platform-sdk/types/env.d.ts"],"version":"5.9.3"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="vite/client" />
|
|
2
|
+
|
|
3
|
+
/** Salesforce API version injected at build time by the Vite define plugin. */
|
|
4
|
+
declare const __SF_API_VERSION__: string;
|
|
5
|
+
|
|
6
|
+
declare module '*.vue' {
|
|
7
|
+
import type { DefineComponent } from 'vue';
|
|
8
|
+
const component: DefineComponent<
|
|
9
|
+
Record<string, never>,
|
|
10
|
+
Record<string, never>,
|
|
11
|
+
unknown
|
|
12
|
+
>;
|
|
13
|
+
export default component;
|
|
14
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { existsSync } from 'node:fs';
|
|
2
|
+
import { defineConfig } from 'vite';
|
|
3
|
+
import vue from '@vitejs/plugin-vue';
|
|
4
|
+
import path from 'path';
|
|
5
|
+
import { resolve } from 'path';
|
|
6
|
+
import tailwindcss from '@tailwindcss/vite';
|
|
7
|
+
import salesforce from '@salesforce/vite-plugin-ui-bundle';
|
|
8
|
+
import codegen from 'vite-plugin-graphql-codegen';
|
|
9
|
+
|
|
10
|
+
const schemaPath = resolve(__dirname, '../../../../../schema.graphql');
|
|
11
|
+
const schemaExists = existsSync(schemaPath);
|
|
12
|
+
|
|
13
|
+
export default defineConfig(() => {
|
|
14
|
+
return {
|
|
15
|
+
base: './',
|
|
16
|
+
plugins: [
|
|
17
|
+
tailwindcss(),
|
|
18
|
+
vue(),
|
|
19
|
+
salesforce(),
|
|
20
|
+
// Only add codegen when schema exists (e.g. after `npm run graphql:schema`).
|
|
21
|
+
// In CI or when schema is not checked in, skip codegen so build succeeds.
|
|
22
|
+
...(schemaExists
|
|
23
|
+
? [
|
|
24
|
+
codegen({
|
|
25
|
+
configFilePathOverride: resolve(__dirname, 'codegen.yml'),
|
|
26
|
+
runOnStart: true,
|
|
27
|
+
runOnBuild: true,
|
|
28
|
+
enableWatcher: true,
|
|
29
|
+
throwOnBuild: true,
|
|
30
|
+
}),
|
|
31
|
+
]
|
|
32
|
+
: []),
|
|
33
|
+
] as import('vite').PluginOption[],
|
|
34
|
+
|
|
35
|
+
// Build configuration for MPA
|
|
36
|
+
build: {
|
|
37
|
+
outDir: resolve(__dirname, 'dist'),
|
|
38
|
+
assetsDir: 'assets',
|
|
39
|
+
sourcemap: false,
|
|
40
|
+
},
|
|
41
|
+
|
|
42
|
+
// Resolve aliases (shared between build and test)
|
|
43
|
+
resolve: {
|
|
44
|
+
dedupe: ['vue'],
|
|
45
|
+
alias: {
|
|
46
|
+
'@': path.resolve(__dirname, './src'),
|
|
47
|
+
'@api': path.resolve(__dirname, './src/api'),
|
|
48
|
+
'@components': path.resolve(__dirname, './src/components'),
|
|
49
|
+
'@utils': path.resolve(__dirname, './src/utils'),
|
|
50
|
+
'@styles': path.resolve(__dirname, './src/styles'),
|
|
51
|
+
'@assets': path.resolve(__dirname, './src/assets'),
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
|
|
55
|
+
// Vitest configuration
|
|
56
|
+
test: {
|
|
57
|
+
// Override root for tests (build uses src/pages as root)
|
|
58
|
+
root: resolve(__dirname),
|
|
59
|
+
|
|
60
|
+
// Use jsdom environment for Vue component testing
|
|
61
|
+
environment: 'jsdom',
|
|
62
|
+
|
|
63
|
+
// Setup files to run before each test
|
|
64
|
+
setupFiles: ['./src/test/setup.ts'],
|
|
65
|
+
|
|
66
|
+
// Global test patterns
|
|
67
|
+
include: [
|
|
68
|
+
'src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}',
|
|
69
|
+
'src/**/__tests__/**/*.{js,mjs,cjs,ts,mts,cts,jsx,tsx}',
|
|
70
|
+
],
|
|
71
|
+
|
|
72
|
+
// Coverage configuration
|
|
73
|
+
coverage: {
|
|
74
|
+
provider: 'v8',
|
|
75
|
+
reporter: ['text', 'html', 'clover', 'json'],
|
|
76
|
+
exclude: [
|
|
77
|
+
'node_modules/',
|
|
78
|
+
'src/test/',
|
|
79
|
+
'src/**/*.d.ts',
|
|
80
|
+
'src/main.ts',
|
|
81
|
+
'src/vite-env.d.ts',
|
|
82
|
+
'src/components/**/index.ts',
|
|
83
|
+
'**/*.config.ts',
|
|
84
|
+
'build/',
|
|
85
|
+
'dist/',
|
|
86
|
+
'coverage/',
|
|
87
|
+
'eslint.config.js',
|
|
88
|
+
],
|
|
89
|
+
thresholds: {
|
|
90
|
+
global: {
|
|
91
|
+
branches: 85,
|
|
92
|
+
functions: 85,
|
|
93
|
+
lines: 85,
|
|
94
|
+
statements: 85,
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
|
|
99
|
+
// Test timeout
|
|
100
|
+
testTimeout: 10000,
|
|
101
|
+
|
|
102
|
+
// Globals for easier testing
|
|
103
|
+
globals: true,
|
|
104
|
+
},
|
|
105
|
+
};
|
|
106
|
+
});
|