@nascentdigital/funnel-core 4.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/AppConfig.d.ts +41 -0
- package/dist/app/AppConfig.js +93 -0
- package/dist/app/BrandConfig.d.ts +13 -0
- package/dist/app/BrandConfig.js +2 -0
- package/dist/app/FeaturesConfig.d.ts +6 -0
- package/dist/app/FeaturesConfig.js +2 -0
- package/dist/app/RegionsConfig.d.ts +43 -0
- package/dist/app/RegionsConfig.js +113 -0
- package/dist/app/UIConfig.d.ts +4 -0
- package/dist/app/UIConfig.js +2 -0
- package/dist/app/index.d.ts +5 -0
- package/dist/app/index.js +21 -0
- package/dist/consent/ConsentCategory.d.ts +12 -0
- package/dist/consent/ConsentCategory.js +28 -0
- package/dist/consent/ConsentService.d.ts +15 -0
- package/dist/consent/ConsentService.js +37 -0
- package/dist/consent/index.d.ts +2 -0
- package/dist/consent/index.js +18 -0
- package/dist/errors/IsometricError.d.ts +19 -0
- package/dist/errors/IsometricError.js +30 -0
- package/dist/errors/IsometricErrorModule.d.ts +11 -0
- package/dist/errors/IsometricErrorModule.js +2 -0
- package/dist/errors/IsometricErrorUtils.d.ts +9 -0
- package/dist/errors/IsometricErrorUtils.js +85 -0
- package/dist/errors/SerializedIsometricError.d.ts +10 -0
- package/dist/errors/SerializedIsometricError.js +15 -0
- package/dist/errors/api/ApiError.d.ts +15 -0
- package/dist/errors/api/ApiError.js +23 -0
- package/dist/errors/api/ApiErrors.d.ts +7 -0
- package/dist/errors/api/ApiErrors.js +67 -0
- package/dist/errors/api/ArgumentError.d.ts +7 -0
- package/dist/errors/api/ArgumentError.js +18 -0
- package/dist/errors/api/ConcurrencyError.d.ts +4 -0
- package/dist/errors/api/ConcurrencyError.js +11 -0
- package/dist/errors/api/ConflictError.d.ts +4 -0
- package/dist/errors/api/ConflictError.js +11 -0
- package/dist/errors/api/DependencyError.d.ts +4 -0
- package/dist/errors/api/DependencyError.js +11 -0
- package/dist/errors/api/IllegalStateError.d.ts +4 -0
- package/dist/errors/api/IllegalStateError.js +11 -0
- package/dist/errors/api/InvalidOperationError.d.ts +4 -0
- package/dist/errors/api/InvalidOperationError.js +11 -0
- package/dist/errors/api/NotAuthenticatedError.d.ts +4 -0
- package/dist/errors/api/NotAuthenticatedError.js +11 -0
- package/dist/errors/api/NotAuthorizedError.d.ts +4 -0
- package/dist/errors/api/NotAuthorizedError.js +11 -0
- package/dist/errors/api/NotAvailableError.d.ts +4 -0
- package/dist/errors/api/NotAvailableError.js +11 -0
- package/dist/errors/api/NotFoundError.d.ts +4 -0
- package/dist/errors/api/NotFoundError.js +11 -0
- package/dist/errors/api/NotImplementedError.d.ts +4 -0
- package/dist/errors/api/NotImplementedError.js +11 -0
- package/dist/errors/api/OfflineError.d.ts +4 -0
- package/dist/errors/api/OfflineError.js +11 -0
- package/dist/errors/api/RangeError.d.ts +4 -0
- package/dist/errors/api/RangeError.js +11 -0
- package/dist/errors/api/ServerError.d.ts +4 -0
- package/dist/errors/api/ServerError.js +11 -0
- package/dist/errors/api/TimeoutError.d.ts +4 -0
- package/dist/errors/api/TimeoutError.js +11 -0
- package/dist/errors/api/index.d.ts +16 -0
- package/dist/errors/api/index.js +32 -0
- package/dist/errors/index.d.ts +5 -0
- package/dist/errors/index.js +26 -0
- package/dist/forms/FormModel.d.ts +47 -0
- package/dist/forms/FormModel.js +149 -0
- package/dist/forms/Forms.d.ts +15 -0
- package/dist/forms/Forms.js +35 -0
- package/dist/forms/IFormService.d.ts +6 -0
- package/dist/forms/IFormService.js +2 -0
- package/dist/forms/TranslateSchema.d.ts +8 -0
- package/dist/forms/TranslateSchema.js +2 -0
- package/dist/forms/index.d.ts +4 -0
- package/dist/forms/index.js +20 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +49 -0
- package/dist/regionalization/Country.d.ts +266 -0
- package/dist/regionalization/Country.js +338 -0
- package/dist/regionalization/Language.d.ts +199 -0
- package/dist/regionalization/Language.js +237 -0
- package/dist/regionalization/Locale.d.ts +28 -0
- package/dist/regionalization/Locale.js +49 -0
- package/dist/regionalization/Localized.d.ts +10 -0
- package/dist/regionalization/Localized.js +36 -0
- package/dist/regionalization/LocalizedCopy.d.ts +9 -0
- package/dist/regionalization/LocalizedCopy.js +26 -0
- package/dist/regionalization/Regionalization.d.ts +50 -0
- package/dist/regionalization/Regionalization.js +260 -0
- package/dist/regionalization/Regions.d.ts +2 -0
- package/dist/regionalization/Regions.js +2 -0
- package/dist/regionalization/index.d.ts +7 -0
- package/dist/regionalization/index.js +23 -0
- package/dist/schema/Asset.d.ts +23 -0
- package/dist/schema/Asset.js +36 -0
- package/dist/schema/AssetScope.d.ts +75 -0
- package/dist/schema/AssetScope.js +146 -0
- package/dist/schema/Block.d.ts +105 -0
- package/dist/schema/Block.js +122 -0
- package/dist/schema/ChangeSet.d.ts +108 -0
- package/dist/schema/ChangeSet.js +187 -0
- package/dist/schema/Collection.d.ts +197 -0
- package/dist/schema/Collection.js +165 -0
- package/dist/schema/CollectionModel.d.ts +30 -0
- package/dist/schema/CollectionModel.js +383 -0
- package/dist/schema/CollectionSnapshot.d.ts +11 -0
- package/dist/schema/CollectionSnapshot.js +12 -0
- package/dist/schema/Fields.d.ts +31 -0
- package/dist/schema/Fields.js +21 -0
- package/dist/schema/Form.d.ts +31 -0
- package/dist/schema/Form.js +23 -0
- package/dist/schema/LinkedCollectionModel.d.ts +9 -0
- package/dist/schema/LinkedCollectionModel.js +19 -0
- package/dist/schema/LinkedData.d.ts +44 -0
- package/dist/schema/LinkedData.js +288 -0
- package/dist/schema/LinkedPageModel.d.ts +11 -0
- package/dist/schema/LinkedPageModel.js +26 -0
- package/dist/schema/Optional.d.ts +23 -0
- package/dist/schema/Optional.js +34 -0
- package/dist/schema/Page.d.ts +299 -0
- package/dist/schema/Page.js +244 -0
- package/dist/schema/PageModel.d.ts +58 -0
- package/dist/schema/PageModel.js +881 -0
- package/dist/schema/PageQuery.d.ts +60 -0
- package/dist/schema/PageQuery.js +116 -0
- package/dist/schema/PageRoute.d.ts +7 -0
- package/dist/schema/PageRoute.js +48 -0
- package/dist/schema/PageSnapshot.d.ts +11 -0
- package/dist/schema/PageSnapshot.js +12 -0
- package/dist/schema/Section.d.ts +71 -0
- package/dist/schema/Section.js +35 -0
- package/dist/schema/Seo.d.ts +13 -0
- package/dist/schema/Seo.js +25 -0
- package/dist/schema/Site.d.ts +40 -0
- package/dist/schema/Site.js +87 -0
- package/dist/schema/SiteModel.d.ts +5 -0
- package/dist/schema/SiteModel.js +10 -0
- package/dist/schema/Tag.d.ts +28 -0
- package/dist/schema/Tag.js +59 -0
- package/dist/schema/TagGroup.d.ts +26 -0
- package/dist/schema/TagGroup.js +64 -0
- package/dist/schema/field/Field.d.ts +179 -0
- package/dist/schema/field/Field.js +309 -0
- package/dist/schema/field/base/AssetField.d.ts +148 -0
- package/dist/schema/field/base/AssetField.js +206 -0
- package/dist/schema/field/base/BooleanField.d.ts +21 -0
- package/dist/schema/field/base/BooleanField.js +38 -0
- package/dist/schema/field/base/CollectionField.d.ts +34 -0
- package/dist/schema/field/base/CollectionField.js +85 -0
- package/dist/schema/field/base/DateField.d.ts +21 -0
- package/dist/schema/field/base/DateField.js +37 -0
- package/dist/schema/field/base/DynamicPagesField.d.ts +36 -0
- package/dist/schema/field/base/DynamicPagesField.js +50 -0
- package/dist/schema/field/base/EmbeddedVideoField.d.ts +45 -0
- package/dist/schema/field/base/EmbeddedVideoField.js +176 -0
- package/dist/schema/field/base/EnumField.d.ts +40 -0
- package/dist/schema/field/base/EnumField.js +131 -0
- package/dist/schema/field/base/FormField.d.ts +25 -0
- package/dist/schema/field/base/FormField.js +48 -0
- package/dist/schema/field/base/LinkField.d.ts +103 -0
- package/dist/schema/field/base/LinkField.js +201 -0
- package/dist/schema/field/base/PageField.d.ts +46 -0
- package/dist/schema/field/base/PageField.js +83 -0
- package/dist/schema/field/base/RichTextField.d.ts +71 -0
- package/dist/schema/field/base/RichTextField.js +196 -0
- package/dist/schema/field/base/TextField.d.ts +33 -0
- package/dist/schema/field/base/TextField.js +86 -0
- package/dist/schema/field/base/TimestampField.d.ts +25 -0
- package/dist/schema/field/base/TimestampField.js +41 -0
- package/dist/schema/field/base/index.d.ts +13 -0
- package/dist/schema/field/base/index.js +29 -0
- package/dist/schema/field/composite/ListField.d.ts +47 -0
- package/dist/schema/field/composite/ListField.js +107 -0
- package/dist/schema/field/composite/ObjectField.d.ts +56 -0
- package/dist/schema/field/composite/ObjectField.js +19 -0
- package/dist/schema/field/composite/index.d.ts +2 -0
- package/dist/schema/field/composite/index.js +18 -0
- package/dist/schema/field/index.d.ts +3 -0
- package/dist/schema/field/index.js +19 -0
- package/dist/schema/index.d.ts +25 -0
- package/dist/schema/index.js +41 -0
- package/dist/services/EventBus.d.ts +17 -0
- package/dist/services/EventBus.js +37 -0
- package/dist/services/humanVerification/IHumanVerification.d.ts +8 -0
- package/dist/services/humanVerification/IHumanVerification.js +2 -0
- package/dist/services/humanVerification/index.d.ts +1 -0
- package/dist/services/humanVerification/index.js +17 -0
- package/dist/services/index.d.ts +3 -0
- package/dist/services/index.js +19 -0
- package/dist/services/leadGen/Contact.d.ts +40 -0
- package/dist/services/leadGen/Contact.js +38 -0
- package/dist/services/leadGen/ILeadGen.d.ts +16 -0
- package/dist/services/leadGen/ILeadGen.js +2 -0
- package/dist/services/leadGen/index.d.ts +2 -0
- package/dist/services/leadGen/index.js +18 -0
- package/dist/types/BoxedValue.d.ts +3 -0
- package/dist/types/BoxedValue.js +2 -0
- package/dist/types/Callback.d.ts +9 -0
- package/dist/types/Callback.js +2 -0
- package/dist/types/DateString.d.ts +35 -0
- package/dist/types/DateString.js +172 -0
- package/dist/types/FilterConditionally.d.ts +3 -0
- package/dist/types/FilterConditionally.js +2 -0
- package/dist/types/MaybeConditionalValue.d.ts +8 -0
- package/dist/types/MaybeConditionalValue.js +12 -0
- package/dist/types/Ordinal.d.ts +17 -0
- package/dist/types/Ordinal.js +38 -0
- package/dist/types/OverridableStringUnion.d.ts +2 -0
- package/dist/types/OverridableStringUnion.js +2 -0
- package/dist/types/PartialBy.d.ts +1 -0
- package/dist/types/PartialBy.js +2 -0
- package/dist/types/PickData.d.ts +6 -0
- package/dist/types/PickData.js +2 -0
- package/dist/types/Provider.d.ts +4 -0
- package/dist/types/Provider.js +2 -0
- package/dist/types/RequiredBy.d.ts +1 -0
- package/dist/types/RequiredBy.js +2 -0
- package/dist/types/Result.d.ts +16 -0
- package/dist/types/Result.js +2 -0
- package/dist/types/Timestamp.d.ts +17 -0
- package/dist/types/Timestamp.js +57 -0
- package/dist/types/Transform.d.ts +4 -0
- package/dist/types/Transform.js +2 -0
- package/dist/types/index.d.ts +14 -0
- package/dist/types/index.js +30 -0
- package/dist/ui/Accessible.d.ts +5 -0
- package/dist/ui/Accessible.js +15 -0
- package/dist/ui/BlockThemes.d.ts +19 -0
- package/dist/ui/BlockThemes.js +29 -0
- package/dist/ui/ColorMode.d.ts +12 -0
- package/dist/ui/ColorMode.js +49 -0
- package/dist/ui/File.d.ts +43 -0
- package/dist/ui/File.js +55 -0
- package/dist/ui/FileType.d.ts +8 -0
- package/dist/ui/FileType.js +48 -0
- package/dist/ui/ImageSource.d.ts +12 -0
- package/dist/ui/ImageSource.js +48 -0
- package/dist/ui/MimeType.d.ts +28 -0
- package/dist/ui/MimeType.js +110 -0
- package/dist/ui/Placement.d.ts +21 -0
- package/dist/ui/Placement.js +135 -0
- package/dist/ui/Position.d.ts +6 -0
- package/dist/ui/Position.js +42 -0
- package/dist/ui/Selector.d.ts +6 -0
- package/dist/ui/Selector.js +23 -0
- package/dist/ui/SemanticColor.d.ts +8 -0
- package/dist/ui/SemanticColor.js +237 -0
- package/dist/ui/Visual.d.ts +24 -0
- package/dist/ui/Visual.js +66 -0
- package/dist/ui/block-layout/BlockLayout.d.ts +99 -0
- package/dist/ui/block-layout/BlockLayout.js +286 -0
- package/dist/ui/block-layout/index.d.ts +1 -0
- package/dist/ui/block-layout/index.js +17 -0
- package/dist/ui/browser/BlurHasher.d.ts +13 -0
- package/dist/ui/browser/BlurHasher.js +76 -0
- package/dist/ui/browser/Browser.d.ts +107 -0
- package/dist/ui/browser/Browser.js +313 -0
- package/dist/ui/browser/ImageProxy.d.ts +30 -0
- package/dist/ui/browser/ImageProxy.js +132 -0
- package/dist/ui/browser/InputEvent.d.ts +13 -0
- package/dist/ui/browser/InputEvent.js +2 -0
- package/dist/ui/browser/SVGProxy.d.ts +9 -0
- package/dist/ui/browser/SVGProxy.js +59 -0
- package/dist/ui/browser/VideoProxy.d.ts +42 -0
- package/dist/ui/browser/VideoProxy.js +235 -0
- package/dist/ui/browser/index.d.ts +6 -0
- package/dist/ui/browser/index.js +22 -0
- package/dist/ui/fields/Field.d.ts +80 -0
- package/dist/ui/fields/Field.js +298 -0
- package/dist/ui/fields/FieldList.d.ts +80 -0
- package/dist/ui/fields/FieldList.js +421 -0
- package/dist/ui/fields/FieldListValidator.d.ts +9 -0
- package/dist/ui/fields/FieldListValidator.js +37 -0
- package/dist/ui/fields/FieldModel.d.ts +15 -0
- package/dist/ui/fields/FieldModel.js +28 -0
- package/dist/ui/fields/FieldSerializer.d.ts +13 -0
- package/dist/ui/fields/FieldSerializer.js +71 -0
- package/dist/ui/fields/FieldValidator.d.ts +19 -0
- package/dist/ui/fields/FieldValidator.js +98 -0
- package/dist/ui/fields/ObjectField.d.ts +75 -0
- package/dist/ui/fields/ObjectField.js +288 -0
- package/dist/ui/fields/errors.json +44 -0
- package/dist/ui/fields/index.d.ts +7 -0
- package/dist/ui/fields/index.js +23 -0
- package/dist/ui/fields/validators/AssetValidator.d.ts +9 -0
- package/dist/ui/fields/validators/AssetValidator.js +25 -0
- package/dist/ui/fields/validators/DateValidator.d.ts +9 -0
- package/dist/ui/fields/validators/DateValidator.js +41 -0
- package/dist/ui/fields/validators/EnumValidator.d.ts +10 -0
- package/dist/ui/fields/validators/EnumValidator.js +77 -0
- package/dist/ui/fields/validators/GenericValidator.d.ts +6 -0
- package/dist/ui/fields/validators/GenericValidator.js +22 -0
- package/dist/ui/fields/validators/LinkValidator.d.ts +9 -0
- package/dist/ui/fields/validators/LinkValidator.js +146 -0
- package/dist/ui/fields/validators/RichTextValidator.d.ts +6 -0
- package/dist/ui/fields/validators/RichTextValidator.js +35 -0
- package/dist/ui/fields/validators/TextValidator.d.ts +10 -0
- package/dist/ui/fields/validators/TextValidator.js +138 -0
- package/dist/ui/fields/validators/TimestampValidator.d.ts +9 -0
- package/dist/ui/fields/validators/TimestampValidator.js +41 -0
- package/dist/ui/fields/validators/ValidatorHelper.d.ts +23 -0
- package/dist/ui/fields/validators/ValidatorHelper.js +55 -0
- package/dist/ui/fields/validators/index.d.ts +8 -0
- package/dist/ui/fields/validators/index.js +24 -0
- package/dist/ui/geometry/AspectRatio.d.ts +27 -0
- package/dist/ui/geometry/AspectRatio.js +77 -0
- package/dist/ui/geometry/Bounds.d.ts +4 -0
- package/dist/ui/geometry/Bounds.js +11 -0
- package/dist/ui/geometry/Frame.d.ts +3 -0
- package/dist/ui/geometry/Frame.js +2 -0
- package/dist/ui/geometry/Insets.d.ts +14 -0
- package/dist/ui/geometry/Insets.js +14 -0
- package/dist/ui/geometry/PixelSize.d.ts +1 -0
- package/dist/ui/geometry/PixelSize.js +2 -0
- package/dist/ui/geometry/Point.d.ts +7 -0
- package/dist/ui/geometry/Point.js +15 -0
- package/dist/ui/geometry/Rect.d.ts +19 -0
- package/dist/ui/geometry/Rect.js +68 -0
- package/dist/ui/geometry/ScreenSize.d.ts +1 -0
- package/dist/ui/geometry/ScreenSize.js +2 -0
- package/dist/ui/geometry/Size.d.ts +7 -0
- package/dist/ui/geometry/Size.js +9 -0
- package/dist/ui/geometry/index.d.ts +9 -0
- package/dist/ui/geometry/index.js +25 -0
- package/dist/ui/index.d.ts +18 -0
- package/dist/ui/index.js +34 -0
- package/dist/ui/responsive/Breakpoint.d.ts +8 -0
- package/dist/ui/responsive/Breakpoint.js +24 -0
- package/dist/ui/responsive/BreakpointObserver.d.ts +16 -0
- package/dist/ui/responsive/BreakpointObserver.js +104 -0
- package/dist/ui/responsive/Breakpoints.d.ts +5 -0
- package/dist/ui/responsive/Breakpoints.js +15 -0
- package/dist/ui/responsive/ResponsiveValue.d.ts +7 -0
- package/dist/ui/responsive/ResponsiveValue.js +26 -0
- package/dist/ui/responsive/index.d.ts +4 -0
- package/dist/ui/responsive/index.js +20 -0
- package/dist/ui/richtext/LexicalUtils.d.ts +31 -0
- package/dist/ui/richtext/LexicalUtils.js +314 -0
- package/dist/ui/richtext/StyledTextNode.d.ts +33 -0
- package/dist/ui/richtext/StyledTextNode.js +101 -0
- package/dist/ui/richtext/index.d.ts +2 -0
- package/dist/ui/richtext/index.js +18 -0
- package/dist/utils/ArrayUtils.d.ts +17 -0
- package/dist/utils/ArrayUtils.js +66 -0
- package/dist/utils/ByteSize.d.ts +19 -0
- package/dist/utils/ByteSize.js +33 -0
- package/dist/utils/DateUtils.d.ts +15 -0
- package/dist/utils/DateUtils.js +100 -0
- package/dist/utils/Deferral.d.ts +28 -0
- package/dist/utils/Deferral.js +107 -0
- package/dist/utils/Duration.d.ts +7 -0
- package/dist/utils/Duration.js +35 -0
- package/dist/utils/Fn.d.ts +14 -0
- package/dist/utils/Fn.js +52 -0
- package/dist/utils/ObjectUtils.d.ts +89 -0
- package/dist/utils/ObjectUtils.js +159 -0
- package/dist/utils/Random.d.ts +15 -0
- package/dist/utils/Random.js +72 -0
- package/dist/utils/StringUtils.d.ts +10 -0
- package/dist/utils/StringUtils.js +51 -0
- package/dist/utils/UrlUtils.d.ts +22 -0
- package/dist/utils/UrlUtils.js +119 -0
- package/dist/utils/Value.d.ts +23 -0
- package/dist/utils/Value.js +122 -0
- package/dist/utils/index.d.ts +12 -0
- package/dist/utils/index.js +28 -0
- package/dist/utils/isDefined.d.ts +1 -0
- package/dist/utils/isDefined.js +6 -0
- package/package.json +64 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./BoxedValue"), exports);
|
|
18
|
+
__exportStar(require("./Callback"), exports);
|
|
19
|
+
__exportStar(require("./DateString"), exports);
|
|
20
|
+
__exportStar(require("./FilterConditionally"), exports);
|
|
21
|
+
__exportStar(require("./MaybeConditionalValue"), exports);
|
|
22
|
+
__exportStar(require("./Ordinal"), exports);
|
|
23
|
+
__exportStar(require("./OverridableStringUnion"), exports);
|
|
24
|
+
__exportStar(require("./PartialBy"), exports);
|
|
25
|
+
__exportStar(require("./PickData"), exports);
|
|
26
|
+
__exportStar(require("./Provider"), exports);
|
|
27
|
+
__exportStar(require("./RequiredBy"), exports);
|
|
28
|
+
__exportStar(require("./Result"), exports);
|
|
29
|
+
__exportStar(require("./Timestamp"), exports);
|
|
30
|
+
__exportStar(require("./Transform"), exports);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Accessible = void 0;
|
|
4
|
+
const StringUtils_1 = require("../utils/StringUtils");
|
|
5
|
+
// extension
|
|
6
|
+
var Accessible;
|
|
7
|
+
(function (Accessible) {
|
|
8
|
+
// constants
|
|
9
|
+
Accessible.values = ['always', 'never', 'optional', 'system'];
|
|
10
|
+
// helpers
|
|
11
|
+
function getName(accessible) {
|
|
12
|
+
return StringUtils_1.StringUtils.capitalize(accessible);
|
|
13
|
+
}
|
|
14
|
+
Accessible.getName = getName;
|
|
15
|
+
})(Accessible || (exports.Accessible = Accessible = {}));
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { OverridableStringUnion, PartialBy } from '../types';
|
|
2
|
+
export type BlockThemes = Readonly<BlockThemes.Options>;
|
|
3
|
+
export declare namespace BlockThemes {
|
|
4
|
+
type Theme = 'default';
|
|
5
|
+
namespace Theme {
|
|
6
|
+
type Extended = OverridableStringUnion<Theme, Overrides>;
|
|
7
|
+
interface Overrides {
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
type Option = {
|
|
11
|
+
name: string;
|
|
12
|
+
group?: string;
|
|
13
|
+
hint?: string;
|
|
14
|
+
};
|
|
15
|
+
type Options = Record<Theme.Extended, Option>;
|
|
16
|
+
function current(): Readonly<Options>;
|
|
17
|
+
function set<TTheme extends string = string>(themes: PartialBy<BlockThemes, 'default'>): void;
|
|
18
|
+
function getClassName(theme: Theme): string;
|
|
19
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BlockThemes = void 0;
|
|
4
|
+
// extension
|
|
5
|
+
var BlockThemes;
|
|
6
|
+
(function (BlockThemes) {
|
|
7
|
+
// methods
|
|
8
|
+
function current() {
|
|
9
|
+
return _themes;
|
|
10
|
+
}
|
|
11
|
+
BlockThemes.current = current;
|
|
12
|
+
function set(themes) {
|
|
13
|
+
_themes = Object.assign(Object.assign({}, _default), themes);
|
|
14
|
+
}
|
|
15
|
+
BlockThemes.set = set;
|
|
16
|
+
function getClassName(theme) {
|
|
17
|
+
var _a;
|
|
18
|
+
// get entry
|
|
19
|
+
const { group = 'default' } = (_a = _themes[theme]) !== null && _a !== void 0 ? _a : {};
|
|
20
|
+
// render
|
|
21
|
+
return `nd-theme-${theme} nd-themeGroup-${group}`;
|
|
22
|
+
}
|
|
23
|
+
BlockThemes.getClassName = getClassName;
|
|
24
|
+
})(BlockThemes || (exports.BlockThemes = BlockThemes = {}));
|
|
25
|
+
// constants
|
|
26
|
+
const _default = {
|
|
27
|
+
default: { name: 'Default', hint: 'The default theme' }
|
|
28
|
+
};
|
|
29
|
+
let _themes = _default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
export type ColorMode = 'light' | 'dark';
|
|
3
|
+
export declare namespace ColorMode {
|
|
4
|
+
/**
|
|
5
|
+
* Starts streaming `ColorMode` and changes, starting with the current value.
|
|
6
|
+
*/
|
|
7
|
+
function current$(): Observable<ColorMode>;
|
|
8
|
+
/**
|
|
9
|
+
* Gets the current `ColorMode` value.
|
|
10
|
+
*/
|
|
11
|
+
function current(): ColorMode;
|
|
12
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ColorMode = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const Browser_1 = require("./browser/Browser");
|
|
6
|
+
// extension
|
|
7
|
+
var ColorMode;
|
|
8
|
+
(function (ColorMode) {
|
|
9
|
+
// internal behavior / subscription
|
|
10
|
+
let _colorMode = undefined;
|
|
11
|
+
function _current$() {
|
|
12
|
+
// return existing subject (if any)
|
|
13
|
+
if (_colorMode) {
|
|
14
|
+
return _colorMode;
|
|
15
|
+
}
|
|
16
|
+
// create fixed color mode subject if we're SSRing
|
|
17
|
+
const window = Browser_1.Browser.window;
|
|
18
|
+
if (!window) {
|
|
19
|
+
_colorMode = new rxjs_1.BehaviorSubject('light');
|
|
20
|
+
}
|
|
21
|
+
// or create active observing via browser (never ends)
|
|
22
|
+
else {
|
|
23
|
+
// create behavior with current value
|
|
24
|
+
const darkModePreference = window.matchMedia('(prefers-color-scheme: dark)');
|
|
25
|
+
const colorMode = new rxjs_1.BehaviorSubject(darkModePreference.matches ? 'dark' : 'light');
|
|
26
|
+
_colorMode = colorMode;
|
|
27
|
+
// update changes (forever)
|
|
28
|
+
darkModePreference.addEventListener('change', e => {
|
|
29
|
+
colorMode.next(e.matches ? 'dark' : 'light');
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
// return color mode
|
|
33
|
+
return _colorMode;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Starts streaming `ColorMode` and changes, starting with the current value.
|
|
37
|
+
*/
|
|
38
|
+
function current$() {
|
|
39
|
+
return _current$().asObservable();
|
|
40
|
+
}
|
|
41
|
+
ColorMode.current$ = current$;
|
|
42
|
+
/**
|
|
43
|
+
* Gets the current `ColorMode` value.
|
|
44
|
+
*/
|
|
45
|
+
function current() {
|
|
46
|
+
return _current$().getValue();
|
|
47
|
+
}
|
|
48
|
+
ColorMode.current = current;
|
|
49
|
+
})(ColorMode || (exports.ColorMode = ColorMode = {}));
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Tagged } from 'type-fest';
|
|
2
|
+
import { ImageData } from './ImageSource';
|
|
3
|
+
import { MimeType } from './MimeType';
|
|
4
|
+
export type File = File.Image | File.Video | File.Audio | File.Document;
|
|
5
|
+
export declare namespace File {
|
|
6
|
+
export type Id = Tagged<string, 'funnel.File.Id'>;
|
|
7
|
+
type Base = {
|
|
8
|
+
id: Id;
|
|
9
|
+
name: string;
|
|
10
|
+
url: string;
|
|
11
|
+
size: number;
|
|
12
|
+
};
|
|
13
|
+
export type Image = Base & {
|
|
14
|
+
mimeType: MimeType.Image;
|
|
15
|
+
width: number;
|
|
16
|
+
height: number;
|
|
17
|
+
};
|
|
18
|
+
export namespace Image {
|
|
19
|
+
function filter(value: any): value is Image;
|
|
20
|
+
function toImageData(image: Image): ImageData;
|
|
21
|
+
}
|
|
22
|
+
export type Video = Base & {
|
|
23
|
+
mimeType: MimeType.Video;
|
|
24
|
+
};
|
|
25
|
+
export namespace Video {
|
|
26
|
+
function filter(value: any): value is Video;
|
|
27
|
+
}
|
|
28
|
+
export type Audio = Base & {
|
|
29
|
+
mimeType: MimeType.Audio;
|
|
30
|
+
};
|
|
31
|
+
export namespace Audio {
|
|
32
|
+
function filter(value: any): value is Video;
|
|
33
|
+
}
|
|
34
|
+
export type Document = Base & {
|
|
35
|
+
mimeType: MimeType.Document;
|
|
36
|
+
};
|
|
37
|
+
export namespace Document {
|
|
38
|
+
function filter(value: any): value is Video;
|
|
39
|
+
}
|
|
40
|
+
export type Placeholder = Omit<Base, 'url' | 'size'>;
|
|
41
|
+
export function filter(value: any): value is File;
|
|
42
|
+
export {};
|
|
43
|
+
}
|
package/dist/ui/File.js
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.File = void 0;
|
|
4
|
+
const MimeType_1 = require("./MimeType");
|
|
5
|
+
// extension
|
|
6
|
+
var File;
|
|
7
|
+
(function (File) {
|
|
8
|
+
let Image;
|
|
9
|
+
(function (Image) {
|
|
10
|
+
function filter(value) {
|
|
11
|
+
return File.filter(value) && MimeType_1.MimeType.image.includes(value.mimeType);
|
|
12
|
+
}
|
|
13
|
+
Image.filter = filter;
|
|
14
|
+
function toImageData(image) {
|
|
15
|
+
const { url, width, height } = image;
|
|
16
|
+
return {
|
|
17
|
+
src: url,
|
|
18
|
+
width,
|
|
19
|
+
height
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
Image.toImageData = toImageData;
|
|
23
|
+
})(Image = File.Image || (File.Image = {}));
|
|
24
|
+
let Video;
|
|
25
|
+
(function (Video) {
|
|
26
|
+
function filter(value) {
|
|
27
|
+
return File.filter(value) && MimeType_1.MimeType.video.includes(value.mimeType);
|
|
28
|
+
}
|
|
29
|
+
Video.filter = filter;
|
|
30
|
+
})(Video = File.Video || (File.Video = {}));
|
|
31
|
+
let Audio;
|
|
32
|
+
(function (Audio) {
|
|
33
|
+
function filter(value) {
|
|
34
|
+
return File.filter(value) && MimeType_1.MimeType.audio.includes(value.mimeType);
|
|
35
|
+
}
|
|
36
|
+
Audio.filter = filter;
|
|
37
|
+
})(Audio = File.Audio || (File.Audio = {}));
|
|
38
|
+
let Document;
|
|
39
|
+
(function (Document) {
|
|
40
|
+
function filter(value) {
|
|
41
|
+
return File.filter(value) && MimeType_1.MimeType.document.includes(value.mimeType);
|
|
42
|
+
}
|
|
43
|
+
Document.filter = filter;
|
|
44
|
+
})(Document = File.Document || (File.Document = {}));
|
|
45
|
+
// helpers
|
|
46
|
+
function filter(value) {
|
|
47
|
+
return !!value
|
|
48
|
+
&& typeof value === 'object'
|
|
49
|
+
&& !Array.isArray(value)
|
|
50
|
+
&& 'id' in value && typeof value.id === 'string'
|
|
51
|
+
&& 'url' in value && typeof value.url === 'string'
|
|
52
|
+
&& 'mimeType' in value && typeof value.mimeType === 'string' && MimeType_1.MimeType.filter(value.mimeType);
|
|
53
|
+
}
|
|
54
|
+
File.filter = filter;
|
|
55
|
+
})(File || (exports.File = File = {}));
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { MimeType } from './MimeType';
|
|
2
|
+
export type FileType = 'image' | 'video' | 'icon' | 'audio' | 'document' | 'other';
|
|
3
|
+
export declare namespace FileType {
|
|
4
|
+
const values: ReadonlyArray<FileType>;
|
|
5
|
+
function coerce(mimeType: MimeType): FileType;
|
|
6
|
+
function compare(lhs: FileType, rhs: FileType): 0 | 1 | -1;
|
|
7
|
+
function filter(value: any): value is FileType;
|
|
8
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FileType = void 0;
|
|
4
|
+
// extension
|
|
5
|
+
var FileType;
|
|
6
|
+
(function (FileType) {
|
|
7
|
+
// values
|
|
8
|
+
FileType.values = ['image', 'video', 'icon', 'audio', 'document', 'other'];
|
|
9
|
+
// methods
|
|
10
|
+
function coerce(mimeType) {
|
|
11
|
+
switch (mimeType) {
|
|
12
|
+
case 'application/pdf':
|
|
13
|
+
return 'document';
|
|
14
|
+
case 'image/gif':
|
|
15
|
+
case 'image/jpeg':
|
|
16
|
+
case 'image/png':
|
|
17
|
+
case 'image/webp':
|
|
18
|
+
return 'image';
|
|
19
|
+
case 'image/svg+xml':
|
|
20
|
+
return 'icon';
|
|
21
|
+
case 'audio/mp3':
|
|
22
|
+
case 'audio/ogg':
|
|
23
|
+
return 'audio';
|
|
24
|
+
case 'video/mp4':
|
|
25
|
+
case 'video/webm':
|
|
26
|
+
return 'video';
|
|
27
|
+
default:
|
|
28
|
+
return 'other';
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
FileType.coerce = coerce;
|
|
32
|
+
function compare(lhs, rhs) {
|
|
33
|
+
const lhsIndex = FileType.values.indexOf(lhs);
|
|
34
|
+
const rhsIndex = FileType.values.indexOf(rhs);
|
|
35
|
+
return lhsIndex === rhsIndex
|
|
36
|
+
? 0
|
|
37
|
+
: lhsIndex < rhsIndex
|
|
38
|
+
? -1
|
|
39
|
+
: 1;
|
|
40
|
+
}
|
|
41
|
+
FileType.compare = compare;
|
|
42
|
+
function filter(value) {
|
|
43
|
+
return !!value
|
|
44
|
+
&& typeof value === 'string'
|
|
45
|
+
&& FileType.values.includes(value);
|
|
46
|
+
}
|
|
47
|
+
FileType.filter = filter;
|
|
48
|
+
})(FileType || (exports.FileType = FileType = {}));
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type ImageSource = string | ImageData;
|
|
2
|
+
export type ImageData = {
|
|
3
|
+
src: string;
|
|
4
|
+
width?: number;
|
|
5
|
+
height?: number;
|
|
6
|
+
};
|
|
7
|
+
export declare namespace ImageSource {
|
|
8
|
+
function coerce(value: any): ImageSource | undefined;
|
|
9
|
+
}
|
|
10
|
+
export declare namespace ImageData {
|
|
11
|
+
function filter(value: any): value is ImageData;
|
|
12
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ImageData = exports.ImageSource = void 0;
|
|
4
|
+
const File_1 = require("./File");
|
|
5
|
+
// extensions
|
|
6
|
+
var ImageSource;
|
|
7
|
+
(function (ImageSource) {
|
|
8
|
+
function coerce(value) {
|
|
9
|
+
// handle next-js image format
|
|
10
|
+
if (ImageData.filter(value)) {
|
|
11
|
+
return value;
|
|
12
|
+
}
|
|
13
|
+
// also coerce image content
|
|
14
|
+
else if (File_1.File.Image.filter(value)) {
|
|
15
|
+
return File_1.File.Image.toImageData(value);
|
|
16
|
+
}
|
|
17
|
+
// handle source-like
|
|
18
|
+
else if (value && typeof value === 'object' && typeof value.src === 'string') {
|
|
19
|
+
return value.src;
|
|
20
|
+
}
|
|
21
|
+
// or just raw value
|
|
22
|
+
else if (value && typeof value === 'string') {
|
|
23
|
+
return value;
|
|
24
|
+
}
|
|
25
|
+
// or URL
|
|
26
|
+
else if (value && value instanceof URL) {
|
|
27
|
+
return value.href;
|
|
28
|
+
}
|
|
29
|
+
// fallback to undefined
|
|
30
|
+
return undefined;
|
|
31
|
+
}
|
|
32
|
+
ImageSource.coerce = coerce;
|
|
33
|
+
})(ImageSource || (exports.ImageSource = ImageSource = {}));
|
|
34
|
+
var ImageData;
|
|
35
|
+
(function (ImageData) {
|
|
36
|
+
function filter(value) {
|
|
37
|
+
// skip if not an object
|
|
38
|
+
if (typeof value !== 'object') {
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
// check properties to match
|
|
42
|
+
const data = value;
|
|
43
|
+
return data && data.src && typeof data.src === 'string'
|
|
44
|
+
&& data.width && typeof data.width === 'number'
|
|
45
|
+
&& data.height && typeof data.height === 'number';
|
|
46
|
+
}
|
|
47
|
+
ImageData.filter = filter;
|
|
48
|
+
})(ImageData || (exports.ImageData = ImageData = {}));
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { FileType } from './FileType';
|
|
2
|
+
export type MimeType = MimeType.Image | MimeType.Video | MimeType.Audio | MimeType.Document;
|
|
3
|
+
export declare namespace MimeType {
|
|
4
|
+
const image: readonly ["image/jpeg", "image/png", "image/gif", "image/webp", "image/svg+xml"];
|
|
5
|
+
const video: readonly ["video/mp4", "video/webm"];
|
|
6
|
+
const audio: readonly ["audio/mp3", "audio/ogg"];
|
|
7
|
+
const document: readonly ["application/pdf"];
|
|
8
|
+
const any: readonly ["image/jpeg", "image/png", "image/gif", "image/webp", "image/svg+xml", "video/mp4", "video/webm", "audio/mp3", "audio/ogg", "application/pdf"];
|
|
9
|
+
type Image = typeof image[number];
|
|
10
|
+
namespace Image {
|
|
11
|
+
function filter(value: MimeType): value is Image;
|
|
12
|
+
}
|
|
13
|
+
type Video = typeof video[number];
|
|
14
|
+
namespace Video {
|
|
15
|
+
function filter(value: MimeType): value is Image;
|
|
16
|
+
}
|
|
17
|
+
namespace Visual {
|
|
18
|
+
function filter(value: MimeType): value is Image | Video;
|
|
19
|
+
function filterRaster(value: MimeType): value is Image | Video;
|
|
20
|
+
}
|
|
21
|
+
type Audio = typeof audio[number];
|
|
22
|
+
type Document = typeof document[number];
|
|
23
|
+
const values: ReadonlyArray<MimeType>;
|
|
24
|
+
function filter(value: any): value is MimeType;
|
|
25
|
+
function getFileType(mimeType: MimeType): FileType;
|
|
26
|
+
function getFileExtension(mimeType: MimeType): string;
|
|
27
|
+
function forFileType(fileType: FileType): MimeType[];
|
|
28
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MimeType = void 0;
|
|
4
|
+
const errors_1 = require("../errors");
|
|
5
|
+
// extension
|
|
6
|
+
var MimeType;
|
|
7
|
+
(function (MimeType) {
|
|
8
|
+
// formats
|
|
9
|
+
MimeType.image = ['image/jpeg', 'image/png', 'image/gif', 'image/webp', 'image/svg+xml'];
|
|
10
|
+
MimeType.video = ['video/mp4', 'video/webm'];
|
|
11
|
+
MimeType.audio = ['audio/mp3', 'audio/ogg'];
|
|
12
|
+
MimeType.document = ['application/pdf'];
|
|
13
|
+
MimeType.any = [...MimeType.image, ...MimeType.video, ...MimeType.audio, ...MimeType.document];
|
|
14
|
+
let Image;
|
|
15
|
+
(function (Image) {
|
|
16
|
+
function filter(value) {
|
|
17
|
+
return MimeType.image.includes(value);
|
|
18
|
+
}
|
|
19
|
+
Image.filter = filter;
|
|
20
|
+
})(Image = MimeType.Image || (MimeType.Image = {}));
|
|
21
|
+
let Video;
|
|
22
|
+
(function (Video) {
|
|
23
|
+
function filter(value) {
|
|
24
|
+
return MimeType.video.includes(value);
|
|
25
|
+
}
|
|
26
|
+
Video.filter = filter;
|
|
27
|
+
})(Video = MimeType.Video || (MimeType.Video = {}));
|
|
28
|
+
let Visual;
|
|
29
|
+
(function (Visual) {
|
|
30
|
+
function filter(value) {
|
|
31
|
+
return Image.filter(value) || Video.filter(value);
|
|
32
|
+
}
|
|
33
|
+
Visual.filter = filter;
|
|
34
|
+
function filterRaster(value) {
|
|
35
|
+
return (Image.filter(value) && value !== 'image/svg+xml') || Video.filter(value);
|
|
36
|
+
}
|
|
37
|
+
Visual.filterRaster = filterRaster;
|
|
38
|
+
})(Visual = MimeType.Visual || (MimeType.Visual = {}));
|
|
39
|
+
// all
|
|
40
|
+
MimeType.values = [...MimeType.image, ...MimeType.video, ...MimeType.image, ...MimeType.document];
|
|
41
|
+
// helpers
|
|
42
|
+
function filter(value) {
|
|
43
|
+
return !!value
|
|
44
|
+
&& typeof value === 'string'
|
|
45
|
+
&& MimeType.values.includes(value);
|
|
46
|
+
}
|
|
47
|
+
MimeType.filter = filter;
|
|
48
|
+
function getFileType(mimeType) {
|
|
49
|
+
if (MimeType.image.includes(mimeType)) {
|
|
50
|
+
return 'image';
|
|
51
|
+
}
|
|
52
|
+
else if (MimeType.video.includes(mimeType)) {
|
|
53
|
+
return 'video';
|
|
54
|
+
}
|
|
55
|
+
else if (MimeType.audio.includes(mimeType)) {
|
|
56
|
+
return 'audio';
|
|
57
|
+
}
|
|
58
|
+
else if (MimeType.document.includes(mimeType)) {
|
|
59
|
+
return 'document';
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
return 'other';
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
MimeType.getFileType = getFileType;
|
|
66
|
+
function getFileExtension(mimeType) {
|
|
67
|
+
switch (mimeType) {
|
|
68
|
+
case 'image/gif':
|
|
69
|
+
return 'gif';
|
|
70
|
+
case 'image/jpeg':
|
|
71
|
+
return 'jpeg';
|
|
72
|
+
case 'image/png':
|
|
73
|
+
return 'png';
|
|
74
|
+
case 'image/webp':
|
|
75
|
+
return 'webp';
|
|
76
|
+
case 'image/svg+xml':
|
|
77
|
+
return 'svg';
|
|
78
|
+
case 'video/mp4':
|
|
79
|
+
return 'mp4';
|
|
80
|
+
case 'video/webm':
|
|
81
|
+
return 'webm';
|
|
82
|
+
case 'audio/mp3':
|
|
83
|
+
return 'mp3';
|
|
84
|
+
case 'audio/ogg':
|
|
85
|
+
return 'ogg';
|
|
86
|
+
case 'application/pdf':
|
|
87
|
+
return 'pdf';
|
|
88
|
+
default:
|
|
89
|
+
return '?';
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
MimeType.getFileExtension = getFileExtension;
|
|
93
|
+
function forFileType(fileType) {
|
|
94
|
+
switch (fileType) {
|
|
95
|
+
case 'image':
|
|
96
|
+
return [...MimeType.image];
|
|
97
|
+
case 'icon':
|
|
98
|
+
return ['image/svg+xml'];
|
|
99
|
+
case 'video':
|
|
100
|
+
return [...MimeType.video];
|
|
101
|
+
case 'audio':
|
|
102
|
+
return [...MimeType.audio];
|
|
103
|
+
case 'document':
|
|
104
|
+
return [...MimeType.document];
|
|
105
|
+
default:
|
|
106
|
+
throw new errors_1.NotImplementedError(`No support for FileType "${fileType}"`);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
MimeType.forFileType = forFileType;
|
|
110
|
+
})(MimeType || (exports.MimeType = MimeType = {}));
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Frame, Insets, Rect, Size } from './geometry';
|
|
2
|
+
export type Placement = Placement.Side | `${Placement.Side}-${Placement.Anchor}`;
|
|
3
|
+
export declare namespace Placement {
|
|
4
|
+
type Side = 'top' | 'bottom' | 'left' | 'right';
|
|
5
|
+
type Anchor = 'start' | 'end' | 'match';
|
|
6
|
+
type Components = {
|
|
7
|
+
side: Side;
|
|
8
|
+
anchor?: Anchor;
|
|
9
|
+
};
|
|
10
|
+
function getComponents(placement: Placement): Components;
|
|
11
|
+
type RelativeTo = {};
|
|
12
|
+
type ForContentArgs = {
|
|
13
|
+
containerRect: Rect;
|
|
14
|
+
containerPadding?: number | Insets;
|
|
15
|
+
anchorRect: Rect;
|
|
16
|
+
anchorOffset?: number;
|
|
17
|
+
placement: Placement;
|
|
18
|
+
contentSize: Readonly<Size>;
|
|
19
|
+
};
|
|
20
|
+
function forContent({ containerRect, containerPadding, anchorRect, anchorOffset, placement, contentSize }: ForContentArgs): Partial<Frame>;
|
|
21
|
+
}
|