@procore/core-react 12.30.0 → 12.31.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/CHANGELOG.md +14 -0
- package/dist/AnchorNavigation/AnchorNavigation.styles.js +3 -3
- package/dist/Avatar/Avatar.styles.js +5 -5
- package/dist/AvatarStack/AvatarStack.styles.d.ts +76 -76
- package/dist/AvatarStack/AvatarStack.styles.js +7 -7
- package/dist/Badge/Badge.styles.js +2 -2
- package/dist/BadgePill/BadgePill.styles.js +4 -4
- package/dist/Banner/Banner.styles.js +10 -10
- package/dist/Box/Box.styles.js +1 -1
- package/dist/Breadcrumbs/Breadcrumbs.styles.js +4 -4
- package/dist/Button/Button.styles.js +5 -5
- package/dist/Calendar/Calendar.styles.js +8 -8
- package/dist/Card/Card.styles.js +1 -1
- package/dist/Checkbox/Checkbox.styles.js +6 -6
- package/dist/Checkbox/CheckboxTooltip.js +1 -1
- package/dist/ComponentLifecycle.stories.mdx +130 -0
- package/dist/ContactItem/ContactItem.styles.js +5 -5
- package/dist/Content/Content.styles.js +2 -2
- package/dist/DateInput/DateInput.js +28 -0
- package/dist/DateInput/DateInput.js.map +1 -1
- package/dist/DateInput/DateInput.styles.js +6 -6
- package/dist/DetailPage/DetailPage.js +1 -1
- package/dist/DetailPage/DetailPage.js.map +1 -1
- package/dist/DetailPage/DetailPage.styles.js +7 -7
- package/dist/Dropdown/Dropdown.styles.js +3 -3
- package/dist/DropdownFlyout/DropdownFlyout.js +7 -2
- package/dist/DropdownFlyout/DropdownFlyout.js.map +1 -1
- package/dist/DropdownFlyout/DropdownFlyout.styles.js +4 -4
- package/dist/Dropzone/Dropzone.js +1 -1
- package/dist/Dropzone/Dropzone.styles.js +9 -9
- package/dist/EmptyState/EmptyState.styles.js +6 -6
- package/dist/Field/Field.styles.js +3 -3
- package/dist/FileList/FileList.styles.js +4 -4
- package/dist/FileSelect/FileExplorer/FileExplorer.styles.js +9 -9
- package/dist/FileSelect/FileExplorer/FileExplorerSidebar.styles.js +3 -3
- package/dist/FileSelect/FileSelect.styles.js +2 -2
- package/dist/FileSelect/FileSelectDropzone/FileSelectDropzone.styles.js +3 -3
- package/dist/FileSelect/FileTokenList/FileTokenList.styles.js +2 -2
- package/dist/FileSelect/GridSource/GridSource.styles.js +6 -6
- package/dist/FileSelect/LocalSource/LocalSource.styles.js +4 -4
- package/dist/FileSelect/SourceItem/SourceItem.styles.js +3 -3
- package/dist/FileSelect/ThumbnailList/ThumbnailList.styles.d.ts +1 -1
- package/dist/FileSelect/ThumbnailList/ThumbnailList.styles.js +6 -6
- package/dist/FileSelect/TreeSource/TreeSource.styles.js +1 -1
- package/dist/FileToken/FileToken.styles.js +4 -4
- package/dist/FilterToken/FilterToken.styles.js +5 -5
- package/dist/FlexList/FlexList.styles.js +1 -1
- package/dist/Form/Form.styles.js +14 -14
- package/dist/Form/StyledFormikForm.styles.d.ts +2 -2
- package/dist/Form/StyledFormikForm.styles.js +2 -2
- package/dist/GhostPlaceholder/GhostPlaceholder.styles.js +2 -2
- package/dist/Grid/Grid.styles.js +2 -2
- package/dist/GroupSelect/GroupSelect.styles.js +1 -1
- package/dist/Input/Input.styles.js +1 -1
- package/dist/Link/Link.styles.js +1 -1
- package/dist/ListPage/ListPage.styles.js +8 -8
- package/dist/Loader/Loader.styles.js +2 -2
- package/dist/MenuImperative/MenuImperative.d.ts +1 -16
- package/dist/MenuImperative/MenuImperative.js +1 -0
- package/dist/MenuImperative/MenuImperative.js.map +1 -1
- package/dist/MenuImperative/MenuImperative.styles.js +10 -10
- package/dist/MenuImperative/MenuImperative.types.d.ts +14 -0
- package/dist/MenuImperative/MenuImperative.types.js.map +1 -1
- package/dist/MenuImperative/index.d.ts +46 -3
- package/dist/MenuImperative/index.js +31 -2
- package/dist/MenuImperative/index.js.map +1 -1
- package/dist/Modal/Modal.js +5 -2
- package/dist/Modal/Modal.js.map +1 -1
- package/dist/Modal/Modal.styles.js +13 -13
- package/dist/MultiSelect/MultiSelect.styles.d.ts +1 -1
- package/dist/MultiSelect/MultiSelect.styles.js +6 -6
- package/dist/NextMenu/NextMenu.styles.js +3 -3
- package/dist/Notation/Notation.js +1 -1
- package/dist/NumberInput/NumberInput.styles.js +7 -7
- package/dist/Overlay/OverlayArrow.styles.js +1 -1
- package/dist/OverlayTrigger/a11yPresets.d.ts +6 -6
- package/dist/PageLayout/PageLayout.styles.d.ts +1 -1
- package/dist/PageLayout/PageLayout.styles.js +16 -16
- package/dist/PageTemplate/PageFooterTemplate/PageFooterTemplate.styles.js +1 -1
- package/dist/PageTemplate/PageHeaderTemplate/PageHeaderTemplate.styles.js +3 -3
- package/dist/PageTemplate/PagePaneTemplate/PagePaneTemplate.styles.js +2 -2
- package/dist/PageTemplate/PageTemplate/PageTemplate.styles.js +3 -3
- package/dist/PageTemplate/PageTemplate/PageTemplateCard.d.ts +3 -5
- package/dist/PageTemplate/PageTemplate/PageTemplateCard.js.map +1 -1
- package/dist/Pagination/Pagination.styles.js +5 -5
- package/dist/Panel/Panel.styles.js +11 -11
- package/dist/Pill/Pill.styles.js +3 -3
- package/dist/PillSelect/PillSelect.styles.js +4 -4
- package/dist/Popover/Popover.styles.js +2 -2
- package/dist/Portal/Portal.styles.js +1 -1
- package/dist/ProgressBar/ProgressBar.styles.js +2 -2
- package/dist/RadioButton/RadioButton.styles.js +3 -3
- package/dist/Required/Required.styles.js +3 -3
- package/dist/Search/Search.styles.js +5 -5
- package/dist/Section/Section.styles.js +7 -7
- package/dist/SegmentedController/SegmentedController.styles.js +4 -4
- package/dist/Select/Select.js +6 -3
- package/dist/Select/Select.js.map +1 -1
- package/dist/Select/Select.styles.js +7 -7
- package/dist/Semantic/Semantic.styles.d.ts +78 -78
- package/dist/Semantic/Semantic.styles.js +9 -9
- package/dist/Slider/Slider.styles.js +5 -5
- package/dist/Spinner/Spinner.styles.js +7 -7
- package/dist/SplitViewCard/SplitViewCard.styles.js +8 -8
- package/dist/SuperSelect/SuperSelect.presets.styles.js +1 -1
- package/dist/SuperSelect/SuperSelect.styles.js +38 -38
- package/dist/Switch/Switch.styles.js +4 -4
- package/dist/Table/Table.styles.js +28 -28
- package/dist/TableShelf/TableShelf.styles.js +5 -5
- package/dist/Tabs/Tabs.styles.js +15 -15
- package/dist/Tearsheet/Tearsheet.styles.js +5 -5
- package/dist/TextArea/TextArea.styles.js +1 -1
- package/dist/TextEditorOutput/TextEditorOutput.styles.js +1 -1
- package/dist/Thumbnail/Thumbnail.hooks.d.ts +68 -68
- package/dist/Thumbnail/Thumbnail.styles.js +17 -17
- package/dist/ThumbnailGrid/ThumbnailGrid.styles.d.ts +1 -1
- package/dist/ThumbnailGrid/ThumbnailGrid.styles.js +7 -7
- package/dist/TieredSelect/TieredSelect.styles.d.ts +4 -4
- package/dist/TieredSelect/TieredSelect.styles.js +9 -9
- package/dist/Tile/Tile.styles.js +8 -8
- package/dist/Title/Title.styles.js +7 -7
- package/dist/Toast/Toast.styles.js +3 -3
- package/dist/ToggleButton/ToggleButton.styles.js +1 -1
- package/dist/Token/Token.styles.js +3 -3
- package/dist/ToolHeader/ToolHeader.styles.js +6 -6
- package/dist/ToolLandingPage/ToolLandingPage.styles.js +3 -3
- package/dist/Tooltip/Tooltip.styles.js +2 -2
- package/dist/Tree/Tree.styles.js +9 -9
- package/dist/Typeahead/Typeahead.styles.js +3 -3
- package/dist/Typography/Typography.styles.js +1 -1
- package/dist/Typography/Typography.table.story.js +2 -2
- package/dist/UNSAFE_TEMPLATES_index.d.ts +15 -0
- package/dist/UNSAFE_TEMPLATES_index.js +9 -0
- package/dist/UNSAFE_TEMPLATES_index.js.map +1 -0
- package/dist/_hooks/I18n.d.ts +1207 -20
- package/dist/_hooks/I18n.js +9 -1
- package/dist/_hooks/I18n.js.map +1 -1
- package/dist/_locales/de-DE.json +2 -1
- package/dist/_locales/en-AU.json +2 -1
- package/dist/_locales/en-CA.json +2 -1
- package/dist/_locales/en-GB.json +2 -1
- package/dist/_locales/en.json +2 -1
- package/dist/_locales/es-ES.json +2 -1
- package/dist/_locales/es.json +3 -2
- package/dist/_locales/fr-CA.json +2 -1
- package/dist/_locales/fr-FR.json +2 -1
- package/dist/_locales/is-IS.json +2 -1
- package/dist/_locales/it-IT.json +2 -1
- package/dist/_locales/ja-JP.json +2 -1
- package/dist/_locales/nb-NO.json +1 -0
- package/dist/_locales/pl-PL.json +2 -1
- package/dist/_locales/pseudo.json +2 -1
- package/dist/_locales/pt-BR.json +2 -1
- package/dist/_locales/pt-PT.json +2 -1
- package/dist/_locales/th-TH.json +2 -1
- package/dist/_locales/zh-SG.json +2 -1
- package/dist/_locales/zh-TW.json +4 -3
- package/dist/_storyHelpers_/components/Deprecation.styles.js +1 -1
- package/dist/_storyHelpers_/components/StoryGrid.js +3 -3
- package/dist/_storyHelpers_/constants.js +1 -1
- package/dist/_storyHelpers_/constants.js.map +1 -1
- package/dist/_typedoc/AnchorNavigation/AnchorNavigation.types.json +3 -3
- package/dist/_typedoc/Avatar/Avatar.types.json +20 -20
- package/dist/_typedoc/AvatarStack/AvatarStack.types.json +24 -24
- package/dist/_typedoc/Badge/Badge.types.json +6 -6
- package/dist/_typedoc/Banner/Banner.types.json +13 -13
- package/dist/_typedoc/Box/Box.types.json +72 -72
- package/dist/_typedoc/Breadcrumbs/Breadcrumbs.types.json +10 -10
- package/dist/_typedoc/Button/Button.types.json +15 -15
- package/dist/_typedoc/Calendar/Calendar.types.json +80 -80
- package/dist/_typedoc/Card/Card.types.json +6 -6
- package/dist/_typedoc/Checkbox/Checkbox.types.json +8 -8
- package/dist/_typedoc/ContactItem/ContactItem.types.json +9 -9
- package/dist/_typedoc/DateInput/DateInput.types.json +35 -35
- package/dist/_typedoc/DateSelect/DateSelect.types.json +13 -13
- package/dist/_typedoc/DetailPage/DetailPage.types.json +5 -5
- package/dist/_typedoc/Dropdown/Dropdown.types.json +39 -39
- package/dist/_typedoc/DropdownFlyout/DropdownFlyout.types.json +30 -30
- package/dist/_typedoc/Dropzone/Dropzone.types.json +44 -44
- package/dist/_typedoc/EmptyState/EmptyState.types.json +16 -16
- package/dist/_typedoc/FileList/FileList.types.json +9 -9
- package/dist/_typedoc/FileSelect/FileSelect.types.json +27 -27
- package/dist/_typedoc/FileSelect/GridSource/GridSource.types.json +20 -20
- package/dist/_typedoc/FileSelect/LocalSource/LocalSource.types.json +14 -14
- package/dist/_typedoc/FileSelect/TreeSource/TreeSource.types.json +9 -9
- package/dist/_typedoc/Flex/Flex.types.json +27 -27
- package/dist/_typedoc/FlexList/FlexList.types.json +30 -30
- package/dist/_typedoc/Form/Form.types.json +815 -815
- package/dist/_typedoc/GhostPlaceholder/GhostPlaceholder.types.json +12 -12
- package/dist/_typedoc/Grid/Grid.types.json +8 -8
- package/dist/_typedoc/GroupSelect/GroupSelect.types.json +52 -52
- package/dist/_typedoc/Input/Input.types.json +2 -2
- package/dist/_typedoc/Link/Link.types.json +1 -1
- package/dist/_typedoc/ListPage/ListPage.types.json +13 -13
- package/dist/_typedoc/Menu/Menu.types.json +62 -62
- package/dist/_typedoc/MenuImperative/MenuImperative.types.json +116 -74
- package/dist/_typedoc/Modal/Modal.types.json +46 -46
- package/dist/_typedoc/MultiSelect/MultiSelect.types.json +31 -31
- package/dist/_typedoc/NextTile/NextTile.types.json +32 -32
- package/dist/_typedoc/Notation/Notation.types.json +4 -4
- package/dist/_typedoc/NumberInput/NumberInput.types.json +54 -54
- package/dist/_typedoc/OverlayTrigger/OverlayTrigger.types.json +32 -32
- package/dist/_typedoc/PageLayout/PageLayout.types.json +26 -26
- package/dist/_typedoc/Pagination/Pagination.types.json +7 -7
- package/dist/_typedoc/Panel/Panel.types.json +30 -30
- package/dist/_typedoc/Pill/Pill.types.json +2 -2
- package/dist/_typedoc/PillSelect/PillSelect.types.json +49 -49
- package/dist/_typedoc/Popover/Popover.types.json +15 -15
- package/dist/_typedoc/ProgressBar/ProgressBar.types.json +7 -7
- package/dist/_typedoc/RadioButton/RadioButton.types.json +6 -6
- package/dist/_typedoc/Required/Required.types.json +5 -5
- package/dist/_typedoc/Search/Search.types.json +18 -18
- package/dist/_typedoc/Section/Section.types.json +15 -15
- package/dist/_typedoc/SegmentedController/SegmentedController.types.json +21 -21
- package/dist/_typedoc/Select/Select.types.json +62 -62
- package/dist/_typedoc/SettingsPage/SettingsPage.types.json +10 -10
- package/dist/_typedoc/Slider/Slider.types.json +6 -6
- package/dist/_typedoc/Spinner/Spinner.types.json +9 -9
- package/dist/_typedoc/SplitViewCard/SplitViewCard.types.json +14 -14
- package/dist/_typedoc/Table/Table.types.json +101 -101
- package/dist/_typedoc/Tabs/Tabs.types.json +20 -20
- package/dist/_typedoc/Tearsheet/Tearsheet.types.json +17 -17
- package/dist/_typedoc/TextArea/TextArea.types.json +3 -3
- package/dist/_typedoc/TextEditor/TextEditor.types.json +9 -9
- package/dist/_typedoc/TextEditorOutput/TextEditorOutput.types.json +4 -4
- package/dist/_typedoc/Thumbnail/Thumbnail.types.json +19 -19
- package/dist/_typedoc/TieredDropdown/TieredDropdown.types.json +42 -42
- package/dist/_typedoc/TieredSelect/TieredSelect.types.json +28 -28
- package/dist/_typedoc/Tile/Tile.types.json +8 -8
- package/dist/_typedoc/Title/Title.types.json +3 -3
- package/dist/_typedoc/Toast/Toast.types.json +4 -4
- package/dist/_typedoc/ToggleButton/ToggleButton.types.json +4 -4
- package/dist/_typedoc/Token/Token.types.json +7 -7
- package/dist/_typedoc/ToolHeader/ToolHeader.types.json +10 -10
- package/dist/_typedoc/ToolLandingPage/ToolLandingPage.types.json +7 -7
- package/dist/_typedoc/Tooltip/Tooltip.types.json +13 -13
- package/dist/_typedoc/Tree/Tree.types.json +88 -88
- package/dist/_typedoc/Typeahead/Typeahead.types.json +2 -2
- package/dist/_typedoc/Typography/Typography.types.json +9 -9
- package/dist/_typedoc/_utils/types.json +3 -3
- package/dist/_utils/CalendarHelpers.js +6 -2
- package/dist/_utils/CalendarHelpers.js.map +1 -1
- package/dist/_utils/TinyMCE.js +5 -1
- package/dist/_utils/TinyMCE.js.map +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
package/dist/_hooks/I18n.js
CHANGED
|
@@ -27,12 +27,16 @@ import es from '../_locales/es.json';
|
|
|
27
27
|
import frCA from '../_locales/fr-CA.json';
|
|
28
28
|
import frFR from '../_locales/fr-FR.json';
|
|
29
29
|
import isIS from '../_locales/is-IS.json';
|
|
30
|
+
import itIT from '../_locales/it-IT.json';
|
|
30
31
|
import jaJP from '../_locales/ja-JP.json';
|
|
32
|
+
import nbNO from '../_locales/nb-NO.json';
|
|
31
33
|
import plPL from '../_locales/pl-PL.json';
|
|
32
34
|
import pseudo from '../_locales/pseudo.json';
|
|
33
35
|
import ptBR from '../_locales/pt-BR.json';
|
|
36
|
+
import ptPT from '../_locales/pt-PT.json';
|
|
34
37
|
import thTH from '../_locales/th-TH.json';
|
|
35
38
|
import zhSG from '../_locales/zh-SG.json';
|
|
39
|
+
import zhTW from '../_locales/zh-TW.json';
|
|
36
40
|
import { OVERWRITE_LOCALE_MAP } from './getI18nProviderLocale';
|
|
37
41
|
|
|
38
42
|
/**
|
|
@@ -58,7 +62,11 @@ export var coreTranslations = {
|
|
|
58
62
|
'pt-BR': ptBR,
|
|
59
63
|
'th-TH': thTH,
|
|
60
64
|
'zh-SG': zhSG,
|
|
61
|
-
'pl-PL': plPL
|
|
65
|
+
'pl-PL': plPL,
|
|
66
|
+
'nb-NO': nbNO,
|
|
67
|
+
'zh-TW': zhTW,
|
|
68
|
+
'it-IT': itIT,
|
|
69
|
+
'pt-PT': ptPT
|
|
62
70
|
};
|
|
63
71
|
var FALLBACK_LOCALE_MAP = _objectSpread({
|
|
64
72
|
'es-ES': 'es',
|
package/dist/_hooks/I18n.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"I18n.js","names":["getFallbackList","isCDNFeatureFlagEnabled","useRequestTranslations","createI18njs","R","React","deDE","enAU","enCA","enGB","en","esES","es","frCA","frFR","isIS","jaJP","plPL","pseudo","ptBR","thTH","zhSG","OVERWRITE_LOCALE_MAP","coreTranslations","FALLBACK_LOCALE_MAP","_objectSpread","getTranslationFallbacks","locale","setTranslationFallbacks","I18n","isCDNEnabled","locales","fallbacks","filter","concat","_toConsumableArray","useI18n","_ref","_ref$translations","translations","_translations","enableCDN","i18nContext","useContext","I18nContext","coreCDNTranslations","type","absolute_file_path","oldTranslations","mergeDeepLeft","I18nWithFallbacks","createContext","I18nProvider","_ref2","children","props","_objectWithoutProperties","_excluded","createElement","Provider","value","useI18nContext","ctx"],"sources":["../../src/_hooks/I18n.tsx"],"sourcesContent":["import {\n getFallbackList,\n isCDNFeatureFlagEnabled,\n useRequestTranslations,\n} from '@procore/cdn-translations'\nimport type { I18njs, I18njsConfig } from '@procore/core-i18n-js'\nimport { createI18njs } from '@procore/core-i18n-js'\nimport * as R from 'ramda'\nimport React, { type PropsWithChildren } from 'react'\nimport deDE from '../_locales/de-DE.json'\nimport enAU from '../_locales/en-AU.json'\nimport enCA from '../_locales/en-CA.json'\nimport enGB from '../_locales/en-GB.json'\nimport en from '../_locales/en.json'\nimport esES from '../_locales/es-ES.json'\nimport es from '../_locales/es.json'\nimport frCA from '../_locales/fr-CA.json'\nimport frFR from '../_locales/fr-FR.json'\nimport isIS from '../_locales/is-IS.json'\nimport jaJP from '../_locales/ja-JP.json'\nimport plPL from '../_locales/pl-PL.json'\nimport pseudo from '../_locales/pseudo.json'\nimport ptBR from '../_locales/pt-BR.json'\nimport thTH from '../_locales/th-TH.json'\nimport zhSG from '../_locales/zh-SG.json'\nimport { OVERWRITE_LOCALE_MAP } from './getI18nProviderLocale'\n\ntype I18nConfig = Omit<I18njsConfig, 'I18n'>\n\ntype I18nWithCDNFlag = I18njs & {\n enableCDN?: boolean\n}\n\n/**\n * @deprecated this type will no longer be supported from core-i18n-js,\n * to have a type safe Locale use TmsSupportedLocale or AllLocales from [Globalization toolkit](https://github.com/procore/globalization-toolkit)\n * @deprecatedSince 12.10.0\n */\nexport type Locale =\n | 'de-DE'\n | 'en-AE'\n | 'en-AU'\n | 'en-CA'\n | 'en-GB'\n | 'en-SG'\n | 'en'\n | 'es-ES'\n | 'es'\n | 'fr-CA'\n | 'fr-FR'\n | 'is-IS'\n | 'ja-JP'\n | 'pt-BR'\n | 'th-TH'\n | 'zh-SG'\n | 'pseudo'\n | 'pl-PL'\n\n/* Set up core translations */\nexport const coreTranslations = {\n 'de-DE': deDE,\n en,\n 'en-AU': enAU,\n 'en-CA': enCA,\n 'en-GB': enGB,\n es,\n 'es-ES': esES,\n 'fr-CA': frCA,\n 'fr-FR': frFR,\n 'is-IS': isIS,\n 'ja-JP': jaJP,\n pseudo,\n 'pt-BR': ptBR,\n 'th-TH': thTH,\n 'zh-SG': zhSG,\n 'pl-PL': plPL,\n} as const\n\nconst FALLBACK_LOCALE_MAP: Record<string, Locale> = {\n 'es-ES': 'es',\n 'fr-FR': 'fr-CA',\n ...OVERWRITE_LOCALE_MAP,\n}\n\nfunction getTranslationFallbacks(locale: string): Locale[] {\n if (FALLBACK_LOCALE_MAP[locale]) {\n return [FALLBACK_LOCALE_MAP[locale], 'en']\n }\n\n return ['en']\n}\n\nfunction setTranslationFallbacks(\n I18n: I18nWithCDNFlag,\n isCDNEnabled: boolean | undefined\n) {\n if (isCDNEnabled === true) {\n I18n.locales[I18n.locale] = function () {\n return getFallbackList(I18n.locale)\n }\n } else {\n I18n.locales[I18n.locale] = function () {\n const fallbacks = getTranslationFallbacks(I18n.locale).filter(\n (locale) => locale !== I18n.locale\n )\n return [I18n.locale, ...fallbacks]\n }\n }\n\n return I18n\n}\n\ntype UseI18n = I18nConfig & {\n enableCDN?: boolean\n}\n\n/**\n * Hook to create I18n object.\n * @param {UseI18n} props - The I18n configuration.\n * @param {string} props.locale - The locale to use.\n * @param {Record<string, string>} props.translations - The translations to use.\n * @param {boolean} props.enableCDN - Whether to pull core-react translations from the CDN or not, by default it follows the value passed down through the parent I18nProvider.\n * @returns {I18nWithCDNFlag} The I18n object.\n */\nexport function useI18n({\n locale,\n translations: _translations = {},\n enableCDN,\n}: UseI18n): I18nWithCDNFlag {\n const i18nContext: I18nWithCDNFlag | undefined = React.useContext(I18nContext)\n\n const isCDNEnabled = isCDNFeatureFlagEnabled(i18nContext, enableCDN)\n\n const coreCDNTranslations = useRequestTranslations(\n {\n locale: locale ?? 'en',\n type: 'file',\n absolute_file_path: (locale) =>\n `core/packages/core-react/src/_locales/${locale}.json`,\n },\n { en, pseudo },\n {\n oldTranslations: coreTranslations,\n enableCDN: isCDNEnabled,\n }\n )\n\n const translations = R.mergeDeepLeft(\n _translations,\n coreCDNTranslations.translations\n )\n\n const I18n = createI18njs({\n locale,\n translations,\n })\n\n const I18nWithFallbacks = setTranslationFallbacks(I18n, isCDNEnabled)\n\n I18nWithFallbacks.enableCDN = isCDNEnabled\n\n return I18nWithFallbacks\n}\n\nexport const I18nContext: React.Context<I18nWithCDNFlag> = React.createContext(\n createI18njs({\n locale: 'en',\n translations: { en: coreTranslations.en },\n })\n)\n\n/**\n * Provider to wrap the application with the I18n context.\n * @param {PropsWithChildren<UseI18n>} props - The I18n configuration.\n * @param {React.ReactNode} props.children - The children to render.\n * @param {UseI18n} props.locale - The locale to use.\n * @param {Record<string, string>} props.translations - The translations to use.\n * @param {boolean} props.enableCDN - Whether to pull core-react translations from the CDN or not, by default it follows the value passed down through the parent I18nProvider.\n * @returns {React.ReactNode} The I18n context instance.\n */\nexport function I18nProvider({\n children,\n ...props\n}: PropsWithChildren<UseI18n>) {\n return (\n <I18nContext.Provider value={useI18n(props)}>\n {children}\n </I18nContext.Provider>\n )\n}\n\n// Base type of user provider translations type\ntype DeepStringRecord = {\n [key: string]: string | DeepStringRecord\n}\n\ntype PluralizationForm = {\n zero?: string\n one: string\n other: string\n}\n\n// Type to get nested key paths with dot notation\ntype DotPrefix<T extends string> = T extends '' ? '' : `.${T}`\ntype DotNestedKeys<T> = (\n T extends string\n ? ''\n : T extends DeepStringRecord\n ? {\n [K in keyof T]: K extends string\n ? T[K] extends PluralizationForm\n ? `${K}`\n : T[K] extends DeepStringRecord\n ? `${K}${DotPrefix<DotNestedKeys<T[K]>>}`\n : `${K}`\n : never\n }[keyof T]\n : ''\n) extends infer D\n ? Extract<D, string>\n : never\n\n// Type to get the literal string type from a path\ntype StringLiteralPathValue<\n T,\n P extends string\n> = P extends `${infer K}.${infer Rest}`\n ? K extends keyof T\n ? T[K] extends PluralizationForm\n ? T[K]\n : T[K] extends DeepStringRecord\n ? StringLiteralPathValue<T[K], Rest>\n : never\n : never\n : P extends keyof T\n ? T[P] extends PluralizationForm\n ? T[P]\n : T[P] extends string\n ? T[P]\n : never\n : never\n\n// Check if a string has any interpolation variables\ntype HasInterpolation<T extends string> =\n T extends `${string}%{${string}}${string}` ? true : false\n\n// Extract interpolation variables from a string\ntype ExtractInterpolationVars<T extends string> =\n T extends `${infer _Before}%{${infer Param}}${infer After}`\n ? Param | ExtractInterpolationVars<After>\n : never\n\n// always allowed values in the interpolation object (remove [key: string]: any in favor of our strong types)\ntype ExplicitTranslateOptions = {\n [K in keyof I18n.TranslateOptions as string extends K\n ? never\n : K]: I18n.TranslateOptions[K]\n}\n\ntype InterpolationParams<T extends string> = HasInterpolation<T> extends true\n ? {\n [K in ExtractInterpolationVars<T>]: string\n } & {\n [K in keyof ExplicitTranslateOptions]?: ExplicitTranslateOptions[K]\n }\n : never\n\ntype PluralizationParams<T extends PluralizationForm> = {\n count: number\n} & (\n | (T['zero'] extends string\n ? { count: 0 } & { [K in ExtractInterpolationVars<T['zero']>]: string }\n : {})\n | (T['one'] extends string\n ? { count: 1 } & { [K in ExtractInterpolationVars<T['one']>]: string }\n : {})\n | (T['other'] extends string\n ? { count: number } & {\n [K in ExtractInterpolationVars<T['other']>]: string\n }\n : {})\n) & {\n [K in keyof ExplicitTranslateOptions]?: ExplicitTranslateOptions[K]\n }\n\ntype InterpolationOrPluralizationParams<T> = T extends PluralizationForm\n ? [PluralizationParams<T>]\n : T extends string\n ? InterpolationParams<T> extends never\n ? [ExplicitTranslateOptions?]\n : [InterpolationParams<T>]\n : [ExplicitTranslateOptions?]\n\ntype TypedTranslate<Translations> = <P extends DotNestedKeys<Translations>>(\n path: P,\n ...args: InterpolationOrPluralizationParams<\n StringLiteralPathValue<Translations, P>\n >\n) => StringLiteralPathValue<Translations, P>\n\ntype I18njsWithTypedTranslate<Translations> = Omit<\n I18nWithCDNFlag,\n 't' | 'translate'\n> & {\n t: TypedTranslate<Translations>\n translate: TypedTranslate<Translations>\n}\n\nexport function useI18nContext<\n Translations extends DeepStringRecord | undefined = undefined\n>(): Translations extends undefined\n ? I18nWithCDNFlag\n : I18njsWithTypedTranslate<NonNullable<Translations>>\n// overload for when no generic is provided\nexport function useI18nContext(): I18nWithCDNFlag\n\n/**\n * Hook to access the I18n context.\n *\n * @template Translations - An optional generic to provide type safety for translations.\n * If specified, it enables typed access to the `t` and `translate` methods of the I18n instance.\n * These methods will have type safe access to both the tranlsation scope as well as the interpolation variables.\n * If not specified, the default I18nWithCDN instance is returned.\n *\n * @returns {I18nWithCDNFlag | I18njsWithTypedTranslate<Translations>} The I18n context instance,\n * either with or without typed translations based on the provided generic.\n */\nexport function useI18nContext<\n Translations extends DeepStringRecord | undefined = undefined\n>() {\n const ctx = React.useContext(I18nContext)\n\n if (!ctx) {\n // TODO investigate a way to do warnings that won't annoy people\n // we probably need to introduce a build system to have nice dev warnings\n // console.warn()\n }\n\n // Cast to typing if user has provided a type\n return ctx as Translations extends undefined\n ? I18nWithCDNFlag\n : I18njsWithTypedTranslate<NonNullable<Translations>>\n}\n"],"mappings":";;;;;;;;;;;;;;;AAAA,SACEA,eAAe,EACfC,uBAAuB,EACvBC,sBAAsB,QACjB,2BAA2B;AAElC,SAASC,YAAY,QAAQ,uBAAuB;AACpD,OAAO,KAAKC,CAAC,MAAM,OAAO;AAC1B,OAAOC,KAAK,MAAkC,OAAO;AACrD,OAAOC,IAAI,MAAM,wBAAwB;AACzC,OAAOC,IAAI,MAAM,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,IAAI,CAACkB,GAAG,EAAE;IACR;IACA;IACA;EAAA;;EAGF;EACA,OAAOA,GAAG;AAGZ"}
|
|
1
|
+
{"version":3,"file":"I18n.js","names":["getFallbackList","isCDNFeatureFlagEnabled","useRequestTranslations","createI18njs","R","React","deDE","enAU","enCA","enGB","en","esES","es","frCA","frFR","isIS","itIT","jaJP","nbNO","plPL","pseudo","ptBR","ptPT","thTH","zhSG","zhTW","OVERWRITE_LOCALE_MAP","coreTranslations","FALLBACK_LOCALE_MAP","_objectSpread","getTranslationFallbacks","locale","setTranslationFallbacks","I18n","isCDNEnabled","locales","fallbacks","filter","concat","_toConsumableArray","useI18n","_ref","_ref$translations","translations","_translations","enableCDN","i18nContext","useContext","I18nContext","coreCDNTranslations","type","absolute_file_path","oldTranslations","mergeDeepLeft","I18nWithFallbacks","createContext","I18nProvider","_ref2","children","props","_objectWithoutProperties","_excluded","createElement","Provider","value","useI18nContext","ctx"],"sources":["../../src/_hooks/I18n.tsx"],"sourcesContent":["import {\n getFallbackList,\n isCDNFeatureFlagEnabled,\n useRequestTranslations,\n} from '@procore/cdn-translations'\nimport type { I18njs, I18njsConfig } from '@procore/core-i18n-js'\nimport { createI18njs } from '@procore/core-i18n-js'\nimport * as R from 'ramda'\nimport React, { type PropsWithChildren } from 'react'\nimport deDE from '../_locales/de-DE.json'\nimport enAU from '../_locales/en-AU.json'\nimport enCA from '../_locales/en-CA.json'\nimport enGB from '../_locales/en-GB.json'\nimport en from '../_locales/en.json'\nimport esES from '../_locales/es-ES.json'\nimport es from '../_locales/es.json'\nimport frCA from '../_locales/fr-CA.json'\nimport frFR from '../_locales/fr-FR.json'\nimport isIS from '../_locales/is-IS.json'\nimport itIT from '../_locales/it-IT.json'\nimport jaJP from '../_locales/ja-JP.json'\nimport nbNO from '../_locales/nb-NO.json'\nimport plPL from '../_locales/pl-PL.json'\nimport pseudo from '../_locales/pseudo.json'\nimport ptBR from '../_locales/pt-BR.json'\nimport ptPT from '../_locales/pt-PT.json'\nimport thTH from '../_locales/th-TH.json'\nimport zhSG from '../_locales/zh-SG.json'\nimport zhTW from '../_locales/zh-TW.json'\nimport { OVERWRITE_LOCALE_MAP } from './getI18nProviderLocale'\n\ntype I18nConfig = Omit<I18njsConfig, 'I18n'>\n\ntype I18nWithCDNFlag = I18njs & {\n enableCDN?: boolean\n}\n\n/**\n * @deprecated this type will no longer be supported from core-i18n-js,\n * to have a type safe Locale use TmsSupportedLocale or AllLocales from [Globalization toolkit](https://github.com/procore/globalization-toolkit)\n * @deprecatedSince 12.10.0\n */\nexport type Locale =\n | 'de-DE'\n | 'en-AE'\n | 'en-AU'\n | 'en-CA'\n | 'en-GB'\n | 'en-SG'\n | 'en'\n | 'es-ES'\n | 'es'\n | 'fr-CA'\n | 'fr-FR'\n | 'is-IS'\n | 'ja-JP'\n | 'pt-BR'\n | 'th-TH'\n | 'zh-SG'\n | 'pseudo'\n | 'pl-PL'\n | 'nb-NO'\n | 'zh-TW'\n | 'it-IT'\n | 'pt-PT'\n\n/* Set up core translations */\nexport const coreTranslations = {\n 'de-DE': deDE,\n en,\n 'en-AU': enAU,\n 'en-CA': enCA,\n 'en-GB': enGB,\n es,\n 'es-ES': esES,\n 'fr-CA': frCA,\n 'fr-FR': frFR,\n 'is-IS': isIS,\n 'ja-JP': jaJP,\n pseudo,\n 'pt-BR': ptBR,\n 'th-TH': thTH,\n 'zh-SG': zhSG,\n 'pl-PL': plPL,\n 'nb-NO': nbNO,\n 'zh-TW': zhTW,\n 'it-IT': itIT,\n 'pt-PT': ptPT,\n} as const\n\nconst FALLBACK_LOCALE_MAP: Record<string, Locale> = {\n 'es-ES': 'es',\n 'fr-FR': 'fr-CA',\n ...OVERWRITE_LOCALE_MAP,\n}\n\nfunction getTranslationFallbacks(locale: string): Locale[] {\n if (FALLBACK_LOCALE_MAP[locale]) {\n return [FALLBACK_LOCALE_MAP[locale], 'en']\n }\n\n return ['en']\n}\n\nfunction setTranslationFallbacks(\n I18n: I18nWithCDNFlag,\n isCDNEnabled: boolean | undefined\n) {\n if (isCDNEnabled === true) {\n I18n.locales[I18n.locale] = function () {\n return getFallbackList(I18n.locale)\n }\n } else {\n I18n.locales[I18n.locale] = function () {\n const fallbacks = getTranslationFallbacks(I18n.locale).filter(\n (locale) => locale !== I18n.locale\n )\n return [I18n.locale, ...fallbacks]\n }\n }\n\n return I18n\n}\n\ntype UseI18n = I18nConfig & {\n enableCDN?: boolean\n}\n\n/**\n * Hook to create I18n object.\n * @param {UseI18n} props - The I18n configuration.\n * @param {string} props.locale - The locale to use.\n * @param {Record<string, string>} props.translations - The translations to use.\n * @param {boolean} props.enableCDN - Whether to pull core-react translations from the CDN or not, by default it follows the value passed down through the parent I18nProvider.\n * @returns {I18nWithCDNFlag} The I18n object.\n */\nexport function useI18n({\n locale,\n translations: _translations = {},\n enableCDN,\n}: UseI18n): I18nWithCDNFlag {\n const i18nContext: I18nWithCDNFlag | undefined = React.useContext(I18nContext)\n\n const isCDNEnabled = isCDNFeatureFlagEnabled(i18nContext, enableCDN)\n\n const coreCDNTranslations = useRequestTranslations(\n {\n locale: locale ?? 'en',\n type: 'file',\n absolute_file_path: (locale) =>\n `core/packages/core-react/src/_locales/${locale}.json`,\n },\n { en, pseudo },\n {\n oldTranslations: coreTranslations,\n enableCDN: isCDNEnabled,\n }\n )\n\n const translations = R.mergeDeepLeft(\n _translations,\n coreCDNTranslations.translations\n )\n\n const I18n = createI18njs({\n locale,\n translations,\n })\n\n const I18nWithFallbacks = setTranslationFallbacks(I18n, isCDNEnabled)\n\n I18nWithFallbacks.enableCDN = isCDNEnabled\n\n return I18nWithFallbacks\n}\n\nexport const I18nContext: React.Context<I18nWithCDNFlag> = React.createContext(\n createI18njs({\n locale: 'en',\n translations: { en: coreTranslations.en },\n })\n)\n\n/**\n * Provider to wrap the application with the I18n context.\n * @param {PropsWithChildren<UseI18n>} props - The I18n configuration.\n * @param {React.ReactNode} props.children - The children to render.\n * @param {UseI18n} props.locale - The locale to use.\n * @param {Record<string, string>} props.translations - The translations to use.\n * @param {boolean} props.enableCDN - Whether to pull core-react translations from the CDN or not, by default it follows the value passed down through the parent I18nProvider.\n * @returns {React.ReactNode} The I18n context instance.\n */\nexport function I18nProvider({\n children,\n ...props\n}: PropsWithChildren<UseI18n>) {\n return (\n <I18nContext.Provider value={useI18n(props)}>\n {children}\n </I18nContext.Provider>\n )\n}\n\n// Base type of user provider translations type\ntype DeepStringRecord = {\n [key: string]: string | DeepStringRecord\n}\n\ntype PluralizationForm = {\n zero?: string\n one: string\n other: string\n}\n\n// Type to get nested key paths with dot notation\ntype DotPrefix<T extends string> = T extends '' ? '' : `.${T}`\ntype DotNestedKeys<T> = (\n T extends string\n ? ''\n : T extends DeepStringRecord\n ? {\n [K in keyof T]: K extends string\n ? T[K] extends PluralizationForm\n ? `${K}`\n : T[K] extends DeepStringRecord\n ? `${K}${DotPrefix<DotNestedKeys<T[K]>>}`\n : `${K}`\n : never\n }[keyof T]\n : ''\n) extends infer D\n ? Extract<D, string>\n : never\n\n// Type to get the literal string type from a path\ntype StringLiteralPathValue<\n T,\n P extends string\n> = P extends `${infer K}.${infer Rest}`\n ? K extends keyof T\n ? T[K] extends PluralizationForm\n ? T[K]\n : T[K] extends DeepStringRecord\n ? StringLiteralPathValue<T[K], Rest>\n : never\n : never\n : P extends keyof T\n ? T[P] extends PluralizationForm\n ? T[P]\n : T[P] extends string\n ? T[P]\n : never\n : never\n\n// Check if a string has any interpolation variables\ntype HasInterpolation<T extends string> =\n T extends `${string}%{${string}}${string}` ? true : false\n\n// Extract interpolation variables from a string\ntype ExtractInterpolationVars<T extends string> =\n T extends `${infer _Before}%{${infer Param}}${infer After}`\n ? Param | ExtractInterpolationVars<After>\n : never\n\n// always allowed values in the interpolation object (remove [key: string]: any in favor of our strong types)\ntype ExplicitTranslateOptions = {\n [K in keyof I18n.TranslateOptions as string extends K\n ? never\n : K]: I18n.TranslateOptions[K]\n}\n\ntype InterpolationParams<T extends string> = HasInterpolation<T> extends true\n ? {\n [K in ExtractInterpolationVars<T>]: string\n } & {\n [K in keyof ExplicitTranslateOptions]?: ExplicitTranslateOptions[K]\n }\n : never\n\ntype PluralizationParams<T extends PluralizationForm> = {\n count: number\n} & (\n | (T['zero'] extends string\n ? { count: 0 } & { [K in ExtractInterpolationVars<T['zero']>]: string }\n : {})\n | (T['one'] extends string\n ? { count: 1 } & { [K in ExtractInterpolationVars<T['one']>]: string }\n : {})\n | (T['other'] extends string\n ? { count: number } & {\n [K in ExtractInterpolationVars<T['other']>]: string\n }\n : {})\n) & {\n [K in keyof ExplicitTranslateOptions]?: ExplicitTranslateOptions[K]\n }\n\ntype InterpolationOrPluralizationParams<T> = T extends PluralizationForm\n ? [PluralizationParams<T>]\n : T extends string\n ? InterpolationParams<T> extends never\n ? [ExplicitTranslateOptions?]\n : [InterpolationParams<T>]\n : [ExplicitTranslateOptions?]\n\ntype TypedTranslate<Translations> = <P extends DotNestedKeys<Translations>>(\n path: P,\n ...args: InterpolationOrPluralizationParams<\n StringLiteralPathValue<Translations, P>\n >\n) => StringLiteralPathValue<Translations, P>\n\ntype I18njsWithTypedTranslate<Translations> = Omit<\n I18nWithCDNFlag,\n 't' | 'translate'\n> & {\n t: TypedTranslate<Translations>\n translate: TypedTranslate<Translations>\n}\n\nexport function useI18nContext<\n Translations extends DeepStringRecord | undefined = undefined\n>(): Translations extends undefined\n ? I18nWithCDNFlag\n : I18njsWithTypedTranslate<NonNullable<Translations>>\n// overload for when no generic is provided\nexport function useI18nContext(): I18nWithCDNFlag\n\n/**\n * Hook to access the I18n context.\n *\n * @template Translations - An optional generic to provide type safety for translations.\n * If specified, it enables typed access to the `t` and `translate` methods of the I18n instance.\n * These methods will have type safe access to both the tranlsation scope as well as the interpolation variables.\n * If not specified, the default I18nWithCDN instance is returned.\n *\n * @returns {I18nWithCDNFlag | I18njsWithTypedTranslate<Translations>} The I18n context instance,\n * either with or without typed translations based on the provided generic.\n */\nexport function useI18nContext<\n Translations extends DeepStringRecord | undefined = undefined\n>() {\n const ctx = React.useContext(I18nContext)\n\n if (!ctx) {\n // TODO investigate a way to do warnings that won't annoy people\n // we probably need to introduce a build system to have nice dev warnings\n // console.warn()\n }\n\n // Cast to typing if user has provided a type\n return ctx as Translations extends undefined\n ? I18nWithCDNFlag\n : I18njsWithTypedTranslate<NonNullable<Translations>>\n}\n"],"mappings":";;;;;;;;;;;;;;;AAAA,SACEA,eAAe,EACfC,uBAAuB,EACvBC,sBAAsB,QACjB,2BAA2B;AAElC,SAASC,YAAY,QAAQ,uBAAuB;AACpD,OAAO,KAAKC,CAAC,MAAM,OAAO;AAC1B,OAAOC,KAAK,MAAkC,OAAO;AACrD,OAAOC,IAAI,MAAM,wBAAwB;AACzC,OAAOC,IAAI,MAAM,wBAAwB;AACzC,OAAOC,IAAI,MAAM,wBAAwB;AACzC,OAAOC,IAAI,MAAM,wBAAwB;AACzC,OAAOC,EAAE,MAAM,qBAAqB;AACpC,OAAOC,IAAI,MAAM,wBAAwB;AACzC,OAAOC,EAAE,MAAM,qBAAqB;AACpC,OAAOC,IAAI,MAAM,wBAAwB;AACzC,OAAOC,IAAI,MAAM,wBAAwB;AACzC,OAAOC,IAAI,MAAM,wBAAwB;AACzC,OAAOC,IAAI,MAAM,wBAAwB;AACzC,OAAOC,IAAI,MAAM,wBAAwB;AACzC,OAAOC,IAAI,MAAM,wBAAwB;AACzC,OAAOC,IAAI,MAAM,wBAAwB;AACzC,OAAOC,MAAM,MAAM,yBAAyB;AAC5C,OAAOC,IAAI,MAAM,wBAAwB;AACzC,OAAOC,IAAI,MAAM,wBAAwB;AACzC,OAAOC,IAAI,MAAM,wBAAwB;AACzC,OAAOC,IAAI,MAAM,wBAAwB;AACzC,OAAOC,IAAI,MAAM,wBAAwB;AACzC,SAASC,oBAAoB,QAAQ,yBAAyB;;AAQ9D;AACA;AACA;AACA;AACA;;AAyBA;AACA,OAAO,IAAMC,gBAAgB,GAAG;EAC9B,OAAO,EAAErB,IAAI;EACbI,EAAE,EAAFA,EAAE;EACF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D,aAAa,CAC5EpD,YAAY,CAAC;EACX4B,MAAM,EAAE,IAAI;EACZY,YAAY,EAAE;IAAEjC,EAAE,EAAEiB,gBAAgB,CAACjB;EAAG;AAC1C,CAAC,CACH,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAAS8C,YAAYA,CAAAC,KAAA,EAGG;EAAA,IAF7BC,QAAQ,GAAAD,KAAA,CAARC,QAAQ;IACLC,KAAK,GAAAC,wBAAA,CAAAH,KAAA,EAAAI,SAAA;EAER,oBACExD,KAAA,CAAAyD,aAAA,CAACd,WAAW,CAACe,QAAQ;IAACC,KAAK,EAAExB,OAAO,CAACmB,KAAK;EAAE,GACzCD,QACmB,CAAC;AAE3B;;AAEA;;AAWA;;AAoBA;;AAoBA;;AAIA;;AAMA;;AA6DA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASO,cAAcA,CAAA,EAE1B;EACF,IAAMC,GAAG,GAAG7D,KAAK,CAAC0C,UAAU,CAACC,WAAW,CAAC;EAEzC,IAAI,CAACkB,GAAG,EAAE;IACR;IACA;IACA;EAAA;;EAGF;EACA,OAAOA,GAAG;AAGZ"}
|
package/dist/_locales/de-DE.json
CHANGED
package/dist/_locales/en-AU.json
CHANGED
package/dist/_locales/en-CA.json
CHANGED
package/dist/_locales/en-GB.json
CHANGED
package/dist/_locales/en.json
CHANGED
package/dist/_locales/es-ES.json
CHANGED
package/dist/_locales/es.json
CHANGED
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"composeNewEmail" : "Escribir correo electrónico",
|
|
55
55
|
"startNewCommunication" : "Para iniciar una comunicación nueva asociada con este ítem, envíe un correo electrónico a",
|
|
56
56
|
"emptyStateTitle" : "Envíe un correo electrónico para comenzar",
|
|
57
|
-
"emptyStateDescription" : "Cuando usted y su equipo envíen correos electrónicos sobre este ítem, puede
|
|
57
|
+
"emptyStateDescription" : "Cuando usted y su equipo envíen correos electrónicos sobre este ítem, puede consultarlos aquí.",
|
|
58
58
|
"reply" : "Responder",
|
|
59
59
|
"cancel" : "Cancelar",
|
|
60
60
|
"subject" : "Asunto",
|
|
@@ -299,7 +299,8 @@
|
|
|
299
299
|
"select" : {
|
|
300
300
|
"clear" : "Eliminar campo",
|
|
301
301
|
"search" : "Buscar",
|
|
302
|
-
"selectAll" : "Seleccionar todo"
|
|
302
|
+
"selectAll" : "Seleccionar todo",
|
|
303
|
+
"noResult" : "No hay resultados"
|
|
303
304
|
},
|
|
304
305
|
"splitViewCard" : {
|
|
305
306
|
"a11y" : {
|
package/dist/_locales/fr-CA.json
CHANGED
package/dist/_locales/fr-FR.json
CHANGED
package/dist/_locales/is-IS.json
CHANGED
package/dist/_locales/it-IT.json
CHANGED
package/dist/_locales/ja-JP.json
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{}
|
package/dist/_locales/pl-PL.json
CHANGED
package/dist/_locales/pt-BR.json
CHANGED
package/dist/_locales/pt-PT.json
CHANGED
package/dist/_locales/th-TH.json
CHANGED
package/dist/_locales/zh-SG.json
CHANGED
package/dist/_locales/zh-TW.json
CHANGED
|
@@ -299,7 +299,8 @@
|
|
|
299
299
|
"select" : {
|
|
300
300
|
"clear" : "刪除欄位",
|
|
301
301
|
"search" : "搜尋",
|
|
302
|
-
"selectAll" : "全部選取"
|
|
302
|
+
"selectAll" : "全部選取",
|
|
303
|
+
"noResult" : "沒有結果"
|
|
303
304
|
},
|
|
304
305
|
"splitViewCard" : {
|
|
305
306
|
"a11y" : {
|
|
@@ -347,10 +348,10 @@
|
|
|
347
348
|
"spinnerLabel" : "正在載入"
|
|
348
349
|
},
|
|
349
350
|
"spinner" : {
|
|
350
|
-
"loading" : "
|
|
351
|
+
"loading" : "正在載入"
|
|
351
352
|
},
|
|
352
353
|
"token" : {
|
|
353
|
-
"remove" : "
|
|
354
|
+
"remove" : "移除"
|
|
354
355
|
},
|
|
355
356
|
"toolHeader" : {
|
|
356
357
|
"settingsAction" : "配置設定"
|
|
@@ -2,6 +2,6 @@ import styled from 'styled-components';
|
|
|
2
2
|
import { Typography } from '../../Typography';
|
|
3
3
|
export var StyledDeprecation = /*#__PURE__*/styled(Typography).withConfig({
|
|
4
4
|
displayName: "StyledDeprecation",
|
|
5
|
-
componentId: "core-
|
|
5
|
+
componentId: "core-12_31_0__sc-ojy3xo-0"
|
|
6
6
|
})(["display:block;margin-bottom:16px;"]);
|
|
7
7
|
//# sourceMappingURL=Deprecation.styles.js.map
|
|
@@ -6,11 +6,11 @@ import styled from 'styled-components';
|
|
|
6
6
|
import { colors } from '../../_styles/colors';
|
|
7
7
|
var StyledCell = /*#__PURE__*/styled.div.withConfig({
|
|
8
8
|
displayName: "StyledCell",
|
|
9
|
-
componentId: "core-
|
|
9
|
+
componentId: "core-12_31_0__sc-7owp8g-0"
|
|
10
10
|
})(["display:flex;align-items:center;justify-content:center;padding:0 48px;border-bottom:1px dashed ", ";border-right:1px dashed ", ";"], colors.gray90, colors.gray90);
|
|
11
11
|
var StyledGrid = /*#__PURE__*/styled.div.withConfig({
|
|
12
12
|
displayName: "StyledGrid",
|
|
13
|
-
componentId: "core-
|
|
13
|
+
componentId: "core-12_31_0__sc-7owp8g-1"
|
|
14
14
|
})(["align-items:center;justify-content:center;display:grid;gap:0;border-top:1px dashed ", ";border-left:1px dashed ", ";grid-template-columns:repeat( ", ",minmax(0,1fr) );height:100%;width:100%;", "{min-height:", "px;overflow:hidden;}"], colors.gray90, colors.gray90, function (_ref) {
|
|
15
15
|
var _ref$$columns = _ref.$columns,
|
|
16
16
|
$columns = _ref$$columns === void 0 ? 1 : _ref$$columns;
|
|
@@ -21,7 +21,7 @@ var StyledGrid = /*#__PURE__*/styled.div.withConfig({
|
|
|
21
21
|
});
|
|
22
22
|
var StyledGridContainer = /*#__PURE__*/styled.div.withConfig({
|
|
23
23
|
displayName: "StyledGridContainer",
|
|
24
|
-
componentId: "core-
|
|
24
|
+
componentId: "core-12_31_0__sc-7owp8g-2"
|
|
25
25
|
})(["height:100%;padding:24px;width:100%;"]);
|
|
26
26
|
export var StoryGrid = function StoryGrid(_ref3) {
|
|
27
27
|
var children = _ref3.children,
|
|
@@ -164,5 +164,5 @@ export var tzDatabaseNames = ['Pacific/Honolulu', 'America/Los_Angeles', 'Americ
|
|
|
164
164
|
* @deprecatedSince 12.10.0
|
|
165
165
|
*/
|
|
166
166
|
// TODO breaking change requiring a new minimum version of the peerDep, replace with GTK imports
|
|
167
|
-
export var locales = ['en', 'en-CA', 'fr-CA', 'fr-FR', 'es', 'es-ES', 'en-AE', 'en-AU', 'en-GB', 'en-SG', 'th-TH', 'ja-JP', 'pt-BR', 'is-IS', 'de-DE', 'zh-SG', 'pseudo', 'pl-PL'];
|
|
167
|
+
export var locales = ['en', 'en-CA', 'fr-CA', 'fr-FR', 'es', 'es-ES', 'en-AE', 'en-AU', 'en-GB', 'en-SG', 'th-TH', 'ja-JP', 'pt-BR', 'is-IS', 'de-DE', 'zh-SG', 'pseudo', 'pl-PL', 'it-IT', 'pt-PT', 'nb-NO', 'zh-TW'];
|
|
168
168
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","names":["exampleText","none","short_ipsum","short_sentence","long_ipsum","longest_ipsum","long_ipsum_one_line","number","symbol","no_space","intl_symbol","mixed_char","alert_text","Ipsum","lengthOrOptions","recursiveGrow","length","lettercase","trailingPeriod","longString","lastChar","includes","slice","replace","s","toUpperCase","arguments","undefined","out","commonMimeTypes","mockedAcceptFileTypes","id","label","mimetypes","avatarImageUrl","tzDatabaseNames","locales"],"sources":["../../src/_storyHelpers_/constants.tsx"],"sourcesContent":["import type { Locale } from '../_hooks/I18n'\n\nexport const exampleText = {\n default: 'Click me!',\n none: '',\n short_ipsum: 'Lorum',\n short_sentence: 'Did you think you have mastery over fire? Incredible!',\n long_ipsum: `Lorem ip sum dolor sit amet, consectetur adipiscing elit,\n ed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n Scelerisque eleifend donec pretium vulputate sapien nec sagittis.\n Ultricies tristique nulla aliquet enim tortor at auctor urna nunc.\n Vitae turpis massa sed elementum tempus egestas.\n Nunc consequat interdum varius sit amet`,\n longest_ipsum: `Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod\n tempor incididunt ut labore et dolore magna aliqua. Ac tortor dignissim\n convallis aenean et. Facilisis volutpat est velit egestas dui id. In\n nulla posuere sollicitudin aliquam ultrices. Lorem mollis aliquam ut\n porttitor. Convallis aenean et tortor at risus viverra adipiscing at.\n Euismod nisi porta lorem mollis aliquam ut porttitor. Hac habitasse\n platea dictumst vestibulum rhoncus est pellentesque elit ullamcorper.\n Viverra tellus in hac habitasse platea dictumst. Scelerisque viverra lawn\n gnome in aliquam sem fringilla ut morbi tincidunt. Ullamcorper morbi tincidunt\n ornare massa eget. Gravida cum sociis natoque penatibus. Leo vel fringilla est\n ullamcorper eget nulla. Vitae proin sagittis nisl rhoncus mattis rhoncus urna.\n Mauris commodo quis imperdiet massa tincidunt nunc pulvinar sapien et. Id aliquet\n lectus proin nibh troll condimentum id venenatis.`,\n long_ipsum_one_line: `Lorem ip sum dolor sit amet, consectetur adipiscing elit, ed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Scelerisque eleifend donec pretium vulputate sapien nec sagittis. Ultricies tristique nulla aliquet enim tortor at auctor urna nunc. Vitae turpis massa sed elementum tempus egestas. Nunc consequat interdum varius sit amet`,\n number: '0123456789',\n symbol: ')!@#$%^&*(',\n no_space:\n 'ThequickbrownfoxjumpedoverthelazydogItwasindeedthequickbrownfoxthatjumpedoverthelazydog',\n intl_symbol: '¡¿ßøÆ«»ºª',\n mixed_char: 'a!2#4%6 8»',\n alert_text: 'By fire be purged!',\n}\n\nexport function Ipsum(\n lengthOrOptions:\n | number\n | {\n length: number\n lettercase?: 'sentence' | 'title'\n trailingPeriod?: boolean\n }\n) {\n if (typeof lengthOrOptions === 'number') {\n return recursiveGrow(lengthOrOptions)\n }\n const { length, lettercase, trailingPeriod } = lengthOrOptions\n let longString = recursiveGrow(length)\n const lastChar = longString[longString.length - 1]\n if (!trailingPeriod && ['.', ','].includes(lastChar)) {\n longString = longString.slice(0, -1)\n }\n if (lettercase === 'title') {\n longString = longString.replace(/\\b\\w/g, (s) => s.toUpperCase())\n }\n return longString\n}\n\n/**\n * Creates a sentence case sentence.\n * @returns string\n */\nconst recursiveGrow = (length = 1, out = exampleText.longest_ipsum): string => {\n if (!length) {\n return ''\n }\n if (out.length < length) {\n return recursiveGrow(length, out + exampleText.longest_ipsum)\n }\n if (out.length >= length) {\n return out.slice(0, length - 1) + '.'\n }\n return 'Lorem ipsum grow failed.'\n}\n\nexport const commonMimeTypes: Record<string, string> = {\n '.aac': 'audio/aac',\n '.abw': 'application/x-abiword',\n '.arc': 'application/x-freearc',\n '.avi': 'video/x-msvideo',\n '.azw': 'application/vnd.amazon.ebook',\n '.bin': 'application/octet-stream',\n '.bmp': 'image/bmp',\n '.bz': 'application/x-bzip',\n '.bz2': 'application/x-bzip2',\n '.csh': 'application/x-csh',\n '.css': 'text/css',\n '.csv': 'text/csv',\n '.doc': 'application/msword',\n '.docx':\n 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',\n '.eot': 'application/vnd.ms-fontobject',\n '.epub': 'application/epub+zip',\n '.gz': 'application/gzip',\n '.gif': 'image/gif',\n '.htm': 'text/html',\n '.html': 'text/html',\n '.ico': 'image/vnd.microsoft.icon',\n '.ics': 'text/calendar',\n '.jar': 'application/java-archive',\n '.jpeg': 'image/jpeg',\n '.jpg': 'image/jpeg',\n '.js': 'text/javascript',\n '.json': 'application/json',\n '.jsonld': 'application/ld+json',\n '.mid': 'audio/midi',\n '.midi': 'audio/x-midi',\n '.mjs': 'text/javascript',\n '.mp3': 'audio/mpeg',\n '.mpeg': 'video/mpeg',\n '.mpkg': 'application/vnd.apple.installer+xml',\n '.odp': 'application/vnd.oasis.opendocument.presentation',\n '.ods': 'application/vnd.oasis.opendocument.spreadsheet',\n '.odt': 'application/vnd.oasis.opendocument.text',\n '.oga': 'audio/ogg',\n '.ogv': 'video/ogg',\n '.ogx': 'application/ogg',\n '.opus': 'audio/opus',\n '.otf': 'font/otf',\n '.png': 'image/png',\n '.pdf': 'application/pdf',\n '.php': 'application/php',\n '.ppt': 'application/vnd.ms-powerpoint',\n '.pptx':\n 'application/vnd.openxmlformats-officedocument.presentationml.presentation',\n '.rar': 'application/vnd.rar',\n '.rtf': 'application/rtf',\n '.sh': 'application/x-sh',\n '.svg': 'image/svg+xml',\n '.swf': 'application/x-shockwave-flash',\n '.tar': 'application/x-tar',\n '.tif': 'image/tiff',\n '.tiff': 'image/tiff',\n '.ts': 'video/mp2t',\n '.ttf': 'font/ttf',\n '.txt': 'text/plain',\n '.vsd': 'application/vnd.visio',\n '.wav': 'audio/wav',\n '.weba': 'audio/webm',\n '.webm': 'video/webm',\n '.webp': 'image/webp',\n '.woff': 'font/woff',\n '.woff2': 'font/woff2',\n '.xhtml': 'application/xhtml+xml',\n '.xls': 'application/vnd.ms-excel',\n '.xlsx': 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',\n '.xml': 'application/xml, text/xml',\n '.xul': 'application/vnd.mozilla.xul+xml',\n '.zip': 'application/zip',\n '.3gp': 'video/3gpp',\n '.3gp ': 'audio/3gpp',\n '.3g2': 'video/3gpp2, audio/3gpp2',\n '.7z': 'application/x-7z-compressed',\n}\n\nexport const mockedAcceptFileTypes = [\n {\n id: 1,\n label: 'image/*',\n mimetypes: ['image/*'],\n },\n {\n id: 2,\n label: 'audio/*',\n mimetypes: ['audio/*'],\n },\n {\n id: 3,\n label: 'video/*',\n mimetypes: ['video/*'],\n },\n {\n id: 4,\n label: '.pdf',\n mimetypes: ['application/pdf'],\n },\n {\n id: 5,\n label: '.doc, .docx',\n mimetypes: [\n 'application/msword',\n 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',\n ],\n },\n {\n id: 6,\n label: '.ppt, .pptx',\n mimetypes: [\n 'application/vnd.ms-powerpoint',\n 'application/vnd.openxmlformats-officedocument.presentationml.presentation',\n ],\n },\n]\nexport const avatarImageUrl =\n 'https://en.gravatar.com/userimage/46725293/c50eaab013a795dae218cbc7e91227eb.jpeg'\n\n// https://en.wikipedia.org/wiki/List_of_tz_database_time_zones\nexport const tzDatabaseNames: string[] = [\n 'Pacific/Honolulu',\n 'America/Los_Angeles',\n 'America/Chicago',\n 'America/Costa_Rica',\n 'America/New_York',\n 'Europe/London',\n 'Africa/Maputo',\n 'Europe/Kiev',\n 'Asia/Dubai',\n 'Australia/Perth',\n 'Asia/Seoul',\n 'Australia/Sydney',\n 'Pacific/Auckland',\n]\n\n/**\n * @deprecated to get all locales available,\n * you can use TMS_SUPPORTED_LOCALE list or ALL_LOCALES list from [Globalization toolkit](https://github.com/procore/globalization-toolkit)\n * @deprecatedSince 12.10.0\n */\n// TODO breaking change requiring a new minimum version of the peerDep, replace with GTK imports\nexport const locales: Locale[] = [\n 'en',\n 'en-CA',\n 'fr-CA',\n 'fr-FR',\n 'es',\n 'es-ES',\n 'en-AE',\n 'en-AU',\n 'en-GB',\n 'en-SG',\n 'th-TH',\n 'ja-JP',\n 'pt-BR',\n 'is-IS',\n 'de-DE',\n 'zh-SG',\n 'pseudo',\n 'pl-PL',\n]\n"],"mappings":"AAEA,OAAO,IAAMA,WAAW,GAAG;EACzB,WAAS,WAAW;EACpBC,IAAI,EAAE,EAAE;EACRC,WAAW,EAAE,OAAO;EACpBC,cAAc,EAAE,uDAAuD;EACvEC,UAAU,sXAKgC;EAC1CC,aAAa,o+BAYuC;EACpDC,mBAAmB,6VAA6V;EAChXC,MAAM,EAAE,YAAY;EACpBC,MAAM,EAAE,YAAY;EACpBC,QAAQ,EACN,yFAAyF;EAC3FC,WAAW,EAAE,WAAW;EACxBC,UAAU,EAAE,YAAY;EACxBC,UAAU,EAAE;AACd,CAAC;AAED,OAAO,SAASC,KAAKA,CACnBC,eAMK,EACL;EACA,IAAI,OAAOA,eAAe,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,iBAAiB;AAC/B,CAAC,EACD;EACEF,EAAE,EAAE,CAAC;EACLC,KAAK,EAAE,aAAa;EACpBC,SAAS,EAAE,CACT,oBAAoB,EACpB,yEAAyE;AAE7E,CAAC,EACD;EACEF,EAAE,EAAE,CAAC;EACLC,KAAK,EAAE,aAAa;EACpBC,SAAS,EAAE,CACT,+BAA+B,EAC/B,2EAA2E;AAE/E,CAAC,CACF;AACD,OAAO,IAAMC,cAAc,GACzB,kFAAkF;;AAEpF;AACA,OAAO,IAAMC,eAAyB,GAAG,CACvC,kBAAkB,EAClB,qBAAqB,EACrB,iBAAiB,EACjB,oBAAoB,EACpB,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,aAAa,EACb,YAAY,EACZ,iBAAiB,EACjB,YAAY,EACZ,kBAAkB,EAClB,kBAAkB,CACnB;;AAED;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,IAAMC,OAAiB,GAAG,CAC/B,IAAI,EACJ,OAAO,EACP,OAAO,EACP,OAAO,EACP,IAAI,EACJ,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,EACP,QAAQ,EACR,OAAO,CACR"}
|
|
1
|
+
{"version":3,"file":"constants.js","names":["exampleText","none","short_ipsum","short_sentence","long_ipsum","longest_ipsum","long_ipsum_one_line","number","symbol","no_space","intl_symbol","mixed_char","alert_text","Ipsum","lengthOrOptions","recursiveGrow","length","lettercase","trailingPeriod","longString","lastChar","includes","slice","replace","s","toUpperCase","arguments","undefined","out","commonMimeTypes","mockedAcceptFileTypes","id","label","mimetypes","avatarImageUrl","tzDatabaseNames","locales"],"sources":["../../src/_storyHelpers_/constants.tsx"],"sourcesContent":["import type { Locale } from '../_hooks/I18n'\n\nexport const exampleText = {\n default: 'Click me!',\n none: '',\n short_ipsum: 'Lorum',\n short_sentence: 'Did you think you have mastery over fire? Incredible!',\n long_ipsum: `Lorem ip sum dolor sit amet, consectetur adipiscing elit,\n ed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n Scelerisque eleifend donec pretium vulputate sapien nec sagittis.\n Ultricies tristique nulla aliquet enim tortor at auctor urna nunc.\n Vitae turpis massa sed elementum tempus egestas.\n Nunc consequat interdum varius sit amet`,\n longest_ipsum: `Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod\n tempor incididunt ut labore et dolore magna aliqua. Ac tortor dignissim\n convallis aenean et. Facilisis volutpat est velit egestas dui id. In\n nulla posuere sollicitudin aliquam ultrices. Lorem mollis aliquam ut\n porttitor. Convallis aenean et tortor at risus viverra adipiscing at.\n Euismod nisi porta lorem mollis aliquam ut porttitor. Hac habitasse\n platea dictumst vestibulum rhoncus est pellentesque elit ullamcorper.\n Viverra tellus in hac habitasse platea dictumst. Scelerisque viverra lawn\n gnome in aliquam sem fringilla ut morbi tincidunt. Ullamcorper morbi tincidunt\n ornare massa eget. Gravida cum sociis natoque penatibus. Leo vel fringilla est\n ullamcorper eget nulla. Vitae proin sagittis nisl rhoncus mattis rhoncus urna.\n Mauris commodo quis imperdiet massa tincidunt nunc pulvinar sapien et. Id aliquet\n lectus proin nibh troll condimentum id venenatis.`,\n long_ipsum_one_line: `Lorem ip sum dolor sit amet, consectetur adipiscing elit, ed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Scelerisque eleifend donec pretium vulputate sapien nec sagittis. Ultricies tristique nulla aliquet enim tortor at auctor urna nunc. Vitae turpis massa sed elementum tempus egestas. Nunc consequat interdum varius sit amet`,\n number: '0123456789',\n symbol: ')!@#$%^&*(',\n no_space:\n 'ThequickbrownfoxjumpedoverthelazydogItwasindeedthequickbrownfoxthatjumpedoverthelazydog',\n intl_symbol: '¡¿ßøÆ«»ºª',\n mixed_char: 'a!2#4%6 8»',\n alert_text: 'By fire be purged!',\n}\n\nexport function Ipsum(\n lengthOrOptions:\n | number\n | {\n length: number\n lettercase?: 'sentence' | 'title'\n trailingPeriod?: boolean\n }\n) {\n if (typeof lengthOrOptions === 'number') {\n return recursiveGrow(lengthOrOptions)\n }\n const { length, lettercase, trailingPeriod } = lengthOrOptions\n let longString = recursiveGrow(length)\n const lastChar = longString[longString.length - 1]\n if (!trailingPeriod && ['.', ','].includes(lastChar)) {\n longString = longString.slice(0, -1)\n }\n if (lettercase === 'title') {\n longString = longString.replace(/\\b\\w/g, (s) => s.toUpperCase())\n }\n return longString\n}\n\n/**\n * Creates a sentence case sentence.\n * @returns string\n */\nconst recursiveGrow = (length = 1, out = exampleText.longest_ipsum): string => {\n if (!length) {\n return ''\n }\n if (out.length < length) {\n return recursiveGrow(length, out + exampleText.longest_ipsum)\n }\n if (out.length >= length) {\n return out.slice(0, length - 1) + '.'\n }\n return 'Lorem ipsum grow failed.'\n}\n\nexport const commonMimeTypes: Record<string, string> = {\n '.aac': 'audio/aac',\n '.abw': 'application/x-abiword',\n '.arc': 'application/x-freearc',\n '.avi': 'video/x-msvideo',\n '.azw': 'application/vnd.amazon.ebook',\n '.bin': 'application/octet-stream',\n '.bmp': 'image/bmp',\n '.bz': 'application/x-bzip',\n '.bz2': 'application/x-bzip2',\n '.csh': 'application/x-csh',\n '.css': 'text/css',\n '.csv': 'text/csv',\n '.doc': 'application/msword',\n '.docx':\n 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',\n '.eot': 'application/vnd.ms-fontobject',\n '.epub': 'application/epub+zip',\n '.gz': 'application/gzip',\n '.gif': 'image/gif',\n '.htm': 'text/html',\n '.html': 'text/html',\n '.ico': 'image/vnd.microsoft.icon',\n '.ics': 'text/calendar',\n '.jar': 'application/java-archive',\n '.jpeg': 'image/jpeg',\n '.jpg': 'image/jpeg',\n '.js': 'text/javascript',\n '.json': 'application/json',\n '.jsonld': 'application/ld+json',\n '.mid': 'audio/midi',\n '.midi': 'audio/x-midi',\n '.mjs': 'text/javascript',\n '.mp3': 'audio/mpeg',\n '.mpeg': 'video/mpeg',\n '.mpkg': 'application/vnd.apple.installer+xml',\n '.odp': 'application/vnd.oasis.opendocument.presentation',\n '.ods': 'application/vnd.oasis.opendocument.spreadsheet',\n '.odt': 'application/vnd.oasis.opendocument.text',\n '.oga': 'audio/ogg',\n '.ogv': 'video/ogg',\n '.ogx': 'application/ogg',\n '.opus': 'audio/opus',\n '.otf': 'font/otf',\n '.png': 'image/png',\n '.pdf': 'application/pdf',\n '.php': 'application/php',\n '.ppt': 'application/vnd.ms-powerpoint',\n '.pptx':\n 'application/vnd.openxmlformats-officedocument.presentationml.presentation',\n '.rar': 'application/vnd.rar',\n '.rtf': 'application/rtf',\n '.sh': 'application/x-sh',\n '.svg': 'image/svg+xml',\n '.swf': 'application/x-shockwave-flash',\n '.tar': 'application/x-tar',\n '.tif': 'image/tiff',\n '.tiff': 'image/tiff',\n '.ts': 'video/mp2t',\n '.ttf': 'font/ttf',\n '.txt': 'text/plain',\n '.vsd': 'application/vnd.visio',\n '.wav': 'audio/wav',\n '.weba': 'audio/webm',\n '.webm': 'video/webm',\n '.webp': 'image/webp',\n '.woff': 'font/woff',\n '.woff2': 'font/woff2',\n '.xhtml': 'application/xhtml+xml',\n '.xls': 'application/vnd.ms-excel',\n '.xlsx': 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',\n '.xml': 'application/xml, text/xml',\n '.xul': 'application/vnd.mozilla.xul+xml',\n '.zip': 'application/zip',\n '.3gp': 'video/3gpp',\n '.3gp ': 'audio/3gpp',\n '.3g2': 'video/3gpp2, audio/3gpp2',\n '.7z': 'application/x-7z-compressed',\n}\n\nexport const mockedAcceptFileTypes = [\n {\n id: 1,\n label: 'image/*',\n mimetypes: ['image/*'],\n },\n {\n id: 2,\n label: 'audio/*',\n mimetypes: ['audio/*'],\n },\n {\n id: 3,\n label: 'video/*',\n mimetypes: ['video/*'],\n },\n {\n id: 4,\n label: '.pdf',\n mimetypes: ['application/pdf'],\n },\n {\n id: 5,\n label: '.doc, .docx',\n mimetypes: [\n 'application/msword',\n 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',\n ],\n },\n {\n id: 6,\n label: '.ppt, .pptx',\n mimetypes: [\n 'application/vnd.ms-powerpoint',\n 'application/vnd.openxmlformats-officedocument.presentationml.presentation',\n ],\n },\n]\nexport const avatarImageUrl =\n 'https://en.gravatar.com/userimage/46725293/c50eaab013a795dae218cbc7e91227eb.jpeg'\n\n// https://en.wikipedia.org/wiki/List_of_tz_database_time_zones\nexport const tzDatabaseNames: string[] = [\n 'Pacific/Honolulu',\n 'America/Los_Angeles',\n 'America/Chicago',\n 'America/Costa_Rica',\n 'America/New_York',\n 'Europe/London',\n 'Africa/Maputo',\n 'Europe/Kiev',\n 'Asia/Dubai',\n 'Australia/Perth',\n 'Asia/Seoul',\n 'Australia/Sydney',\n 'Pacific/Auckland',\n]\n\n/**\n * @deprecated to get all locales available,\n * you can use TMS_SUPPORTED_LOCALE list or ALL_LOCALES list from [Globalization toolkit](https://github.com/procore/globalization-toolkit)\n * @deprecatedSince 12.10.0\n */\n// TODO breaking change requiring a new minimum version of the peerDep, replace with GTK imports\nexport const locales: Locale[] = [\n 'en',\n 'en-CA',\n 'fr-CA',\n 'fr-FR',\n 'es',\n 'es-ES',\n 'en-AE',\n 'en-AU',\n 'en-GB',\n 'en-SG',\n 'th-TH',\n 'ja-JP',\n 'pt-BR',\n 'is-IS',\n 'de-DE',\n 'zh-SG',\n 'pseudo',\n 'pl-PL',\n 'it-IT',\n 'pt-PT',\n 'nb-NO',\n 'zh-TW',\n]\n"],"mappings":"AAEA,OAAO,IAAMA,WAAW,GAAG;EACzB,WAAS,WAAW;EACpBC,IAAI,EAAE,EAAE;EACRC,WAAW,EAAE,OAAO;EACpBC,cAAc,EAAE,uDAAuD;EACvEC,UAAU,sXAKgC;EAC1CC,aAAa,o+BAYuC;EACpDC,mBAAmB,6VAA6V;EAChXC,MAAM,EAAE,YAAY;EACpBC,MAAM,EAAE,YAAY;EACpBC,QAAQ,EACN,yFAAyF;EAC3FC,WAAW,EAAE,WAAW;EACxBC,UAAU,EAAE,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E,CAAC,SAAS;AACvB,CAAC,EACD;EACEF,EAAE,EAAE,CAAC;EACLC,KAAK,EAAE,MAAM;EACbC,SAAS,EAAE,CAAC,iBAAiB;AAC/B,CAAC,EACD;EACEF,EAAE,EAAE,CAAC;EACLC,KAAK,EAAE,aAAa;EACpBC,SAAS,EAAE,CACT,oBAAoB,EACpB,yEAAyE;AAE7E,CAAC,EACD;EACEF,EAAE,EAAE,CAAC;EACLC,KAAK,EAAE,aAAa;EACpBC,SAAS,EAAE,CACT,+BAA+B,EAC/B,2EAA2E;AAE/E,CAAC,CACF;AACD,OAAO,IAAMC,cAAc,GACzB,kFAAkF;;AAEpF;AACA,OAAO,IAAMC,eAAyB,GAAG,CACvC,kBAAkB,EAClB,qBAAqB,EACrB,iBAAiB,EACjB,oBAAoB,EACpB,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,aAAa,EACb,YAAY,EACZ,iBAAiB,EACjB,YAAY,EACZ,kBAAkB,EAClB,kBAAkB,CACnB;;AAED;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,IAAMC,OAAiB,GAAG,CAC/B,IAAI,EACJ,OAAO,EACP,OAAO,EACP,OAAO,EACP,IAAI,EACJ,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,EACP,QAAQ,EACR,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,CACR"}
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"description": "An array of sections used in the anchor navigation.",
|
|
11
11
|
"descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<p>An array of sections used in the anchor navigation.</p>\n</div><dl class=\"tsd-comment-tags\"><dt>since</dt><dd><p>12.18.0</p>\n</dd></dl></div>",
|
|
12
12
|
"sourceFile": "packages/core-react/src/AnchorNavigation/AnchorNavigation.types.tsx",
|
|
13
|
-
"sourceUrl": "https://github.com/procore/core/blob/
|
|
13
|
+
"sourceUrl": "https://github.com/procore/core/blob/d7acf0a/packages/core-react/src/AnchorNavigation/AnchorNavigation.types.tsx#L15"
|
|
14
14
|
},
|
|
15
15
|
{
|
|
16
16
|
"name": "selected",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"description": "The ID of the currently selected section.",
|
|
21
21
|
"descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<p>The ID of the currently selected section.</p>\n</div><dl class=\"tsd-comment-tags\"><dt>since</dt><dd><p>12.18.0</p>\n</dd></dl></div>",
|
|
22
22
|
"sourceFile": "packages/core-react/src/AnchorNavigation/AnchorNavigation.types.tsx",
|
|
23
|
-
"sourceUrl": "https://github.com/procore/core/blob/
|
|
23
|
+
"sourceUrl": "https://github.com/procore/core/blob/d7acf0a/packages/core-react/src/AnchorNavigation/AnchorNavigation.types.tsx#L20"
|
|
24
24
|
},
|
|
25
25
|
{
|
|
26
26
|
"name": "onSelect",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"description": "Callback function to update the selected section ID.",
|
|
31
31
|
"descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<p>Callback function to update the selected section ID.</p>\n</div><dl class=\"tsd-comment-tags\"><dt>since</dt><dd><p>12.18.0</p>\n</dd></dl></div>",
|
|
32
32
|
"sourceFile": "packages/core-react/src/AnchorNavigation/AnchorNavigation.types.tsx",
|
|
33
|
-
"sourceUrl": "https://github.com/procore/core/blob/
|
|
33
|
+
"sourceUrl": "https://github.com/procore/core/blob/d7acf0a/packages/core-react/src/AnchorNavigation/AnchorNavigation.types.tsx#L25"
|
|
34
34
|
}
|
|
35
35
|
],
|
|
36
36
|
"description": ""
|