@orangelogic/orange-dam-content-browser-sdk 2.1.53 → 2.1.54
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/.env +1 -0
- package/.eslintignore +2 -0
- package/.eslintrc.json +82 -0
- package/.releaserc +17 -0
- package/.travis.yml +20 -0
- package/CBSDKdemo.html +315 -0
- package/GitVersion.yml +18 -0
- package/azure-pipeline.yaml +93 -0
- package/clientlib.config.js +36 -0
- package/config/env.js +105 -0
- package/config/getHttpsConfig.js +67 -0
- package/config/jest/babelTransform.js +30 -0
- package/config/jest/cssTransform.js +14 -0
- package/config/jest/fileTransform.js +41 -0
- package/config/modules.js +135 -0
- package/config/paths.js +79 -0
- package/config/webpack/persistentCache/createEnvironmentHash.js +10 -0
- package/config/webpack.config.js +762 -0
- package/config/webpackDevServer.config.js +128 -0
- package/config-overrides.js +8 -0
- package/gab_extension/GAB.html +85 -0
- package/gab_extension/GoogleChrome/manifest.json +28 -0
- package/gab_extension/GoogleChrome/src/assets/icon48.png +0 -0
- package/gab_extension/GoogleChrome/src/background/index.js +6 -0
- package/gab_extension/GoogleChrome/src/scripts/index.js +347 -0
- package/gab_extension/MozillaFirefox/manifest.json +20 -0
- package/gab_extension/MozillaFirefox/src/assets/icon.png +0 -0
- package/gab_extension/MozillaFirefox/src/background/index.js +5 -0
- package/gab_extension/MozillaFirefox/src/scripts/index.js +347 -0
- package/gab_extension/README.md +11 -0
- package/gab_extension/Safari/Orange DAM Asset Browser Extension/Orange DAM Asset Browser Extension.xcodeproj/project.pbxproj +927 -0
- package/gab_extension/Safari/Orange DAM Asset Browser Extension/Orange DAM Asset Browser Extension.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- package/gab_extension/Safari/Orange DAM Asset Browser Extension/Orange DAM Asset Browser Extension.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/gab_extension/Safari/Orange DAM Asset Browser Extension/Orange DAM Asset Browser Extension.xcodeproj/project.xcworkspace/xcuserdata/oldevmac01.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/gab_extension/Safari/Orange DAM Asset Browser Extension/Orange DAM Asset Browser Extension.xcodeproj/xcuserdata/oldevmac01.xcuserdatad/xcschemes/xcschememanagement.plist +19 -0
- package/gab_extension/Safari/Orange DAM Asset Browser Extension/Shared (App)/Assets.xcassets/AccentColor.colorset/Contents.json +11 -0
- package/gab_extension/Safari/Orange DAM Asset Browser Extension/Shared (App)/Assets.xcassets/AppIcon.appiconset/Contents.json +63 -0
- package/gab_extension/Safari/Orange DAM Asset Browser Extension/Shared (App)/Assets.xcassets/Contents.json +6 -0
- package/gab_extension/Safari/Orange DAM Asset Browser Extension/Shared (App)/Assets.xcassets/LargeIcon.imageset/Contents.json +20 -0
- package/gab_extension/Safari/Orange DAM Asset Browser Extension/Shared (App)/Base.lproj/Main.html +23 -0
- package/gab_extension/Safari/Orange DAM Asset Browser Extension/Shared (App)/Resources/Icon.png +0 -0
- package/gab_extension/Safari/Orange DAM Asset Browser Extension/Shared (App)/Resources/Script.js +24 -0
- package/gab_extension/Safari/Orange DAM Asset Browser Extension/Shared (App)/Resources/Style.css +61 -0
- package/gab_extension/Safari/Orange DAM Asset Browser Extension/Shared (App)/ViewController.swift +81 -0
- package/gab_extension/Safari/Orange DAM Asset Browser Extension/Shared (Extension)/SafariWebExtensionHandler.swift +26 -0
- package/gab_extension/Safari/Orange DAM Asset Browser Extension/iOS (App)/AppDelegate.swift +24 -0
- package/gab_extension/Safari/Orange DAM Asset Browser Extension/iOS (App)/Base.lproj/LaunchScreen.storyboard +36 -0
- package/gab_extension/Safari/Orange DAM Asset Browser Extension/iOS (App)/Base.lproj/Main.storyboard +38 -0
- package/gab_extension/Safari/Orange DAM Asset Browser Extension/iOS (App)/Info.plist +27 -0
- package/gab_extension/Safari/Orange DAM Asset Browser Extension/iOS (App)/SceneDelegate.swift +18 -0
- package/gab_extension/Safari/Orange DAM Asset Browser Extension/iOS (Extension)/Info.plist +13 -0
- package/gab_extension/Safari/Orange DAM Asset Browser Extension/macOS (App)/AppDelegate.swift +21 -0
- package/gab_extension/Safari/Orange DAM Asset Browser Extension/macOS (App)/Base.lproj/Main.storyboard +125 -0
- package/gab_extension/Safari/Orange DAM Asset Browser Extension/macOS (App)/Info.plist +8 -0
- package/gab_extension/Safari/Orange DAM Asset Browser Extension/macOS (App)/Orange DAM Asset Browser Extension.entitlements +12 -0
- package/gab_extension/Safari/Orange DAM Asset Browser Extension/macOS (Extension)/Info.plist +13 -0
- package/gab_extension/Safari/Orange DAM Asset Browser Extension/macOS (Extension)/Orange DAM Asset Browser Extension.entitlements +10 -0
- package/package.json +8 -49
- package/public/index.html +92 -0
- package/scripts/build.js +218 -0
- package/scripts/start.js +154 -0
- package/scripts/test.js +53 -0
- package/src/App.tsx +98 -0
- package/src/AppContext.ts +18 -0
- package/src/GlobalConfigContext.ts +46 -0
- package/src/components/ArrayClamp/ArrayClamp.styled.ts +42 -0
- package/src/components/ArrayClamp/ArrayClamp.tsx +167 -0
- package/src/components/ArrayClamp/index.ts +1 -0
- package/src/components/Browser/Browser.styled.ts +82 -0
- package/src/components/Browser/Browser.tsx +284 -0
- package/src/components/Browser/BrowserItem.tsx +98 -0
- package/src/components/ControlBar/ControlBar.constants.tsx +66 -0
- package/src/components/ControlBar/ControlBar.styled.ts +82 -0
- package/src/components/ControlBar/ControlBar.tsx +528 -0
- package/src/components/ControlBar/Facet/Facet.tsx +113 -0
- package/src/components/ControlBar/Facet/index.ts +1 -0
- package/src/components/FormatDialog/CropPreviewer/CropPreviewer.tsx +224 -0
- package/{build/components/FormatDialog/CropPreviewer/index.d.ts → src/components/FormatDialog/CropPreviewer/index.ts} +1 -1
- package/src/components/FormatDialog/CustomRendition/CustomRendition.constants.ts +24 -0
- package/src/components/FormatDialog/CustomRendition/CustomRendition.styled.ts +57 -0
- package/src/components/FormatDialog/CustomRendition/CustomRendition.tsx +178 -0
- package/src/components/FormatDialog/CustomRendition/index.ts +1 -0
- package/src/components/FormatDialog/CustomRendition/transformations/Crop.tsx +249 -0
- package/src/components/FormatDialog/CustomRendition/transformations/Extension.tsx +54 -0
- package/src/components/FormatDialog/CustomRendition/transformations/Format.tsx +86 -0
- package/src/components/FormatDialog/CustomRendition/transformations/Resize.tsx +176 -0
- package/src/components/FormatDialog/CustomRendition/transformations/Rotate.tsx +101 -0
- package/{build/components/FormatDialog/CustomRendition/transformations/index.d.ts → src/components/FormatDialog/CustomRendition/transformations/index.ts} +1 -3
- package/src/components/FormatDialog/FormatDialog.styled.ts +137 -0
- package/src/components/FormatDialog/FormatDialog.tsx +1533 -0
- package/src/components/FormatDialog/Previewer/Previewer.styled.ts +31 -0
- package/src/components/FormatDialog/Previewer/Previewer.tsx +143 -0
- package/src/components/FormatDialog/Previewer/index.ts +1 -0
- package/src/components/FormatDialog/ProxyMenu/ProxyMenu.styled.ts +88 -0
- package/src/components/FormatDialog/ProxyMenu/ProxyMenu.tsx +74 -0
- package/src/components/FormatDialog/ProxyMenu/index.ts +1 -0
- package/src/components/FormatDialog/TrackingParameters/TrackingParameters.tsx +59 -0
- package/src/components/FormatDialog/TrackingParameters/index.ts +1 -0
- package/src/components/FormatDialog/index.ts +1 -0
- package/src/components/Header/Header.styled.ts +51 -0
- package/src/components/Header/Header.tsx +118 -0
- package/src/components/Loader/Loader.tsx +37 -0
- package/src/components/Loader/index.ts +1 -0
- package/src/components/NoResult/NoResult.tsx +37 -0
- package/src/components/NoResult/index.tsx +1 -0
- package/src/components/Result/AssetCard/AssetCard.styled.ts +120 -0
- package/src/components/Result/AssetCard/AssetCard.tsx +192 -0
- package/src/components/Result/AssetCard/AssetCardWrapper.styled.ts +35 -0
- package/src/components/Result/AssetCard/AssetCardWrapper.tsx +165 -0
- package/src/components/Result/AssetCard/index.ts +1 -0
- package/src/components/Result/AssetPreview/AssetPreview.styled.ts +108 -0
- package/src/components/Result/AssetPreview/AssetPreview.tsx +78 -0
- package/src/components/Result/AssetPreview/ImagePreview/ImagePreview.tsx +42 -0
- package/src/components/Result/AssetPreview/ImagePreview/index.ts +1 -0
- package/src/components/Result/AssetPreview/OtherPreview/OtherPreview.styled.ts +23 -0
- package/src/components/Result/AssetPreview/OtherPreview/OtherPreview.tsx +28 -0
- package/src/components/Result/AssetPreview/OtherPreview/index.ts +1 -0
- package/src/components/Result/AssetPreview/VideoPreview/VideoPreview.tsx +132 -0
- package/src/components/Result/AssetPreview/VideoPreview/index.ts +1 -0
- package/src/components/Result/AssetPreview/index.ts +1 -0
- package/src/consts/asset.ts +16 -0
- package/src/consts/data.ts +17 -0
- package/src/index.tsx +305 -0
- package/src/page/Authenticate/Authenticate.tsx +232 -0
- package/src/page/Authenticate/ConnectingBackground.tsx +44 -0
- package/src/page/Authenticate/index.tsx +94 -0
- package/src/page/Home/Home.styled.ts +46 -0
- package/src/page/Home/Home.tsx +941 -0
- package/src/react-web-component.d.ts +4617 -0
- package/src/store/assets/assets.api.ts +167 -0
- package/src/store/assets/assets.service.ts +223 -0
- package/src/store/assets/assets.slice.ts +104 -0
- package/src/store/auth/auth.service.ts +71 -0
- package/src/store/auth/auth.slice.ts +295 -0
- package/src/store/index.ts +27 -0
- package/src/store/search/search.api.ts +319 -0
- package/src/store/search/search.slice.ts +28 -0
- package/src/store/user/user.api.ts +29 -0
- package/src/styles.css +42 -0
- package/src/types/assets.ts +71 -0
- package/src/types/auth.ts +42 -0
- package/src/types/common.ts +11 -0
- package/src/types/download.ts +8 -0
- package/src/types/navigation.ts +3 -0
- package/src/types/search.ts +116 -0
- package/{build/types/storage.d.ts → src/types/storage.ts} +1 -1
- package/src/types/user.ts +6 -0
- package/src/utils/api.ts +186 -0
- package/src/utils/array.ts +25 -0
- package/src/utils/constants.ts +12 -0
- package/src/utils/fetch.ts +116 -0
- package/src/utils/getRequestUrl.ts +15 -0
- package/src/utils/hooks.ts +36 -0
- package/src/utils/icon.ts +22 -0
- package/src/utils/image.ts +157 -0
- package/src/utils/number.ts +11 -0
- package/src/utils/rotate.ts +23 -0
- package/src/utils/storage.ts +184 -0
- package/src/utils/string.ts +24 -0
- package/src/view/AssetsPicker.tsx +24 -0
- package/src/web-component.d.ts +8151 -0
- package/tsconfig.eslint.json +10 -0
- package/tsconfig.json +37 -0
- package/build/ApiService.d.ts +0 -15
- package/build/App.d.ts +0 -62
- package/build/AppContext.d.ts +0 -18
- package/build/GlobalConfigContext.d.ts +0 -32
- package/build/OrangeDAMContentBrowserSDK.min.css +0 -2
- package/build/OrangeDAMContentBrowserSDK.min.css.map +0 -1
- package/build/OrangeDAMContentBrowserSDK.min.js +0 -11468
- package/build/OrangeDAMContentBrowserSDK.min.js.map +0 -1
- package/build/asset-manifest.json +0 -13
- package/build/components/ArrayClamp/ArrayClamp.d.ts +0 -10
- package/build/components/ArrayClamp/ArrayClamp.styled.d.ts +0 -1
- package/build/components/ArrayClamp/index.d.ts +0 -1
- package/build/components/Browser/Browser.constants.d.ts +0 -3
- package/build/components/Browser/Browser.d.ts +0 -21
- package/build/components/Browser/Browser.styled.d.ts +0 -2
- package/build/components/Browser/BrowserItem.d.ts +0 -13
- package/build/components/Browser/LoadMoreButton.d.ts +0 -9
- package/build/components/ControlBar/ControlBar.constants.d.ts +0 -10
- package/build/components/ControlBar/ControlBar.d.ts +0 -23
- package/build/components/ControlBar/ControlBar.styled.d.ts +0 -1
- package/build/components/ControlBar/Facet/Facet.d.ts +0 -14
- package/build/components/ControlBar/Facet/index.d.ts +0 -1
- package/build/components/FormatDialog/CropPreviewer/CropPreviewer.d.ts +0 -41
- package/build/components/FormatDialog/CustomRendition/CustomRendition.constants.d.ts +0 -5
- package/build/components/FormatDialog/CustomRendition/CustomRendition.d.ts +0 -56
- package/build/components/FormatDialog/CustomRendition/CustomRendition.styled.d.ts +0 -1
- package/build/components/FormatDialog/CustomRendition/index.d.ts +0 -1
- package/build/components/FormatDialog/CustomRendition/transformations/Crop.d.ts +0 -26
- package/build/components/FormatDialog/CustomRendition/transformations/Extension.d.ts +0 -11
- package/build/components/FormatDialog/CustomRendition/transformations/Format.d.ts +0 -10
- package/build/components/FormatDialog/CustomRendition/transformations/Metadata.d.ts +0 -7
- package/build/components/FormatDialog/CustomRendition/transformations/Quality.d.ts +0 -7
- package/build/components/FormatDialog/CustomRendition/transformations/Resize.d.ts +0 -18
- package/build/components/FormatDialog/CustomRendition/transformations/Rotate.d.ts +0 -8
- package/build/components/FormatDialog/FormatDialog.d.ts +0 -49
- package/build/components/FormatDialog/FormatDialog.styled.d.ts +0 -3
- package/build/components/FormatDialog/Previewer/Previewer.d.ts +0 -17
- package/build/components/FormatDialog/Previewer/Previewer.styled.d.ts +0 -1
- package/build/components/FormatDialog/Previewer/index.d.ts +0 -1
- package/build/components/FormatDialog/ProxyMenu/ProxyMenu.d.ts +0 -20
- package/build/components/FormatDialog/ProxyMenu/ProxyMenu.styled.d.ts +0 -2
- package/build/components/FormatDialog/ProxyMenu/index.d.ts +0 -1
- package/build/components/FormatDialog/TrackingParameters/TrackingParameters.d.ts +0 -13
- package/build/components/FormatDialog/TrackingParameters/index.d.ts +0 -1
- package/build/components/FormatDialog/VersionHistory/VersionHistory.d.ts +0 -6
- package/build/components/FormatDialog/VersionHistory/VersionHistory.styled.d.ts +0 -1
- package/build/components/FormatDialog/VersionHistory/index.d.ts +0 -1
- package/build/components/FormatDialog/index.d.ts +0 -1
- package/build/components/Header/Header.d.ts +0 -15
- package/build/components/Header/Header.styled.d.ts +0 -5
- package/build/components/Loader/Loader.d.ts +0 -7
- package/build/components/Loader/index.d.ts +0 -1
- package/build/components/NoResult/NoResult.d.ts +0 -7
- package/build/components/NoResult/index.d.ts +0 -1
- package/build/components/Result/AssetCard/AssetCard.d.ts +0 -15
- package/build/components/Result/AssetCard/AssetCard.styled.d.ts +0 -2
- package/build/components/Result/AssetCard/AssetCardWrapper.d.ts +0 -18
- package/build/components/Result/AssetCard/AssetCardWrapper.styled.d.ts +0 -1
- package/build/components/Result/AssetCard/index.d.ts +0 -1
- package/build/components/Result/AssetPreview/AssetPreview.d.ts +0 -11
- package/build/components/Result/AssetPreview/AssetPreview.styled.d.ts +0 -1
- package/build/components/Result/AssetPreview/ImagePreview/ImagePreview.d.ts +0 -11
- package/build/components/Result/AssetPreview/ImagePreview/index.d.ts +0 -1
- package/build/components/Result/AssetPreview/OtherPreview/OtherPreview.d.ts +0 -9
- package/build/components/Result/AssetPreview/OtherPreview/OtherPreview.styled.d.ts +0 -1
- package/build/components/Result/AssetPreview/OtherPreview/index.d.ts +0 -1
- package/build/components/Result/AssetPreview/VideoPreview/VideoPreview.d.ts +0 -11
- package/build/components/Result/AssetPreview/VideoPreview/index.d.ts +0 -1
- package/build/components/Result/AssetPreview/index.d.ts +0 -1
- package/build/consts/asset.d.ts +0 -14
- package/build/consts/auth.d.ts +0 -4
- package/build/consts/data.d.ts +0 -21
- package/build/index.d.ts +0 -225
- package/build/index.html +0 -1
- package/build/page/Authenticate/Authenticate.d.ts +0 -2
- package/build/page/Authenticate/ConnectingBackground.d.ts +0 -8
- package/build/page/Authenticate/index.d.ts +0 -2
- package/build/page/Home/Home.d.ts +0 -6
- package/build/page/Home/Home.styled.d.ts +0 -2
- package/build/setupTests.d.ts +0 -1
- package/build/store/assets/assets.api.d.ts +0 -66
- package/build/store/assets/assets.service.d.ts +0 -23
- package/build/store/assets/assets.slice.d.ts +0 -65
- package/build/store/auth/auth.service.d.ts +0 -10
- package/build/store/auth/auth.slice.d.ts +0 -76
- package/build/store/index.d.ts +0 -368
- package/build/store/search/search.api.d.ts +0 -39
- package/build/store/search/search.slice.d.ts +0 -12
- package/build/store/user/user.api.d.ts +0 -5
- package/build/types/assets.d.ts +0 -68
- package/build/types/auth.d.ts +0 -35
- package/build/types/common.d.ts +0 -11
- package/build/types/download.d.ts +0 -8
- package/build/types/navigation.d.ts +0 -3
- package/build/types/search.d.ts +0 -148
- package/build/types/user.d.ts +0 -7
- package/build/utils/api.d.ts +0 -27
- package/build/utils/array.d.ts +0 -13
- package/build/utils/constants.d.ts +0 -11
- package/build/utils/function.d.ts +0 -1
- package/build/utils/getRequestUrl.d.ts +0 -1
- package/build/utils/hooks.d.ts +0 -1
- package/build/utils/icon.d.ts +0 -3
- package/build/utils/image.d.ts +0 -24
- package/build/utils/number.d.ts +0 -4
- package/build/utils/rotate.d.ts +0 -4
- package/build/utils/storage.d.ts +0 -23
- package/build/utils/string.d.ts +0 -12
- package/build/view/AssetsPicker.d.ts +0 -6
- /package/{build → public}/favicon.ico +0 -0
- /package/{build → public}/logo192.png +0 -0
- /package/{build → public}/logo512.png +0 -0
- /package/{build → public}/manifest.json +0 -0
- /package/{build → public}/robots.txt +0 -0
- /package/{build/components/Browser/index.d.ts → src/components/Browser/index.ts} +0 -0
- /package/{build/components/ControlBar/index.d.ts → src/components/ControlBar/index.ts} +0 -0
- /package/{build/components/Header/index.d.ts → src/components/Header/index.ts} +0 -0
- /package/{build/page/Home/index.d.ts → src/page/Home/index.ts} +0 -0
package/scripts/start.js
ADDED
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
// Do this as the first thing so that any code reading it knows the right env.
|
|
5
|
+
process.env.BABEL_ENV = 'development';
|
|
6
|
+
process.env.NODE_ENV = 'development';
|
|
7
|
+
|
|
8
|
+
// Makes the script crash on unhandled rejections instead of silently
|
|
9
|
+
// ignoring them. In the future, promise rejections that are not handled will
|
|
10
|
+
// terminate the Node.js process with a non-zero exit code.
|
|
11
|
+
process.on('unhandledRejection', err => {
|
|
12
|
+
throw err;
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
// Ensure environment variables are read.
|
|
16
|
+
require('../config/env');
|
|
17
|
+
|
|
18
|
+
const fs = require('fs');
|
|
19
|
+
const chalk = require('react-dev-utils/chalk');
|
|
20
|
+
const webpack = require('webpack');
|
|
21
|
+
const WebpackDevServer = require('webpack-dev-server');
|
|
22
|
+
const clearConsole = require('react-dev-utils/clearConsole');
|
|
23
|
+
const checkRequiredFiles = require('react-dev-utils/checkRequiredFiles');
|
|
24
|
+
const {
|
|
25
|
+
choosePort,
|
|
26
|
+
createCompiler,
|
|
27
|
+
prepareProxy,
|
|
28
|
+
prepareUrls,
|
|
29
|
+
} = require('react-dev-utils/WebpackDevServerUtils');
|
|
30
|
+
const openBrowser = require('react-dev-utils/openBrowser');
|
|
31
|
+
const semver = require('semver');
|
|
32
|
+
const paths = require('../config/paths');
|
|
33
|
+
const configFactory = require('../config/webpack.config');
|
|
34
|
+
const createDevServerConfig = require('../config/webpackDevServer.config');
|
|
35
|
+
const getClientEnvironment = require('../config/env');
|
|
36
|
+
const react = require(require.resolve('react', { paths: [paths.appPath] }));
|
|
37
|
+
|
|
38
|
+
const env = getClientEnvironment(paths.publicUrlOrPath.slice(0, -1));
|
|
39
|
+
const useYarn = fs.existsSync(paths.yarnLockFile);
|
|
40
|
+
const isInteractive = process.stdout.isTTY;
|
|
41
|
+
|
|
42
|
+
// Warn and crash if required files are missing
|
|
43
|
+
if (!checkRequiredFiles([paths.appHtml, paths.appIndexJs])) {
|
|
44
|
+
process.exit(1);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// Tools like Cloud9 rely on this.
|
|
48
|
+
const DEFAULT_PORT = parseInt(process.env.PORT, 10) || 3000;
|
|
49
|
+
const HOST = process.env.HOST || '0.0.0.0';
|
|
50
|
+
|
|
51
|
+
if (process.env.HOST) {
|
|
52
|
+
console.log(
|
|
53
|
+
chalk.cyan(
|
|
54
|
+
`Attempting to bind to HOST environment variable: ${chalk.yellow(
|
|
55
|
+
chalk.bold(process.env.HOST),
|
|
56
|
+
)}`,
|
|
57
|
+
),
|
|
58
|
+
);
|
|
59
|
+
console.log(
|
|
60
|
+
'If this was unintentional, check that you haven\'t mistakenly set it in your shell.',
|
|
61
|
+
);
|
|
62
|
+
console.log(
|
|
63
|
+
`Learn more here: ${chalk.yellow('https://cra.link/advanced-config')}`,
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// We require that you explicitly set browsers and do not fall back to
|
|
68
|
+
// browserslist defaults.
|
|
69
|
+
const { checkBrowsers } = require('react-dev-utils/browsersHelper');
|
|
70
|
+
checkBrowsers(paths.appPath, isInteractive)
|
|
71
|
+
.then(() => {
|
|
72
|
+
// We attempt to use the default port but if it is busy, we offer the user to
|
|
73
|
+
// run on a different port. `choosePort()` Promise resolves to the next free port.
|
|
74
|
+
return choosePort(HOST, DEFAULT_PORT);
|
|
75
|
+
})
|
|
76
|
+
.then(port => {
|
|
77
|
+
if (port == null) {
|
|
78
|
+
// We have not found a port.
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const config = configFactory('development');
|
|
83
|
+
const protocol = process.env.HTTPS === 'true' ? 'https' : 'http';
|
|
84
|
+
const appName = require(paths.appPackageJson).name;
|
|
85
|
+
|
|
86
|
+
const useTypeScript = fs.existsSync(paths.appTsConfig);
|
|
87
|
+
const urls = prepareUrls(
|
|
88
|
+
protocol,
|
|
89
|
+
HOST,
|
|
90
|
+
port,
|
|
91
|
+
paths.publicUrlOrPath.slice(0, -1),
|
|
92
|
+
);
|
|
93
|
+
// Create a webpack compiler that is configured with custom messages.
|
|
94
|
+
const compiler = createCompiler({
|
|
95
|
+
appName,
|
|
96
|
+
config,
|
|
97
|
+
urls,
|
|
98
|
+
useYarn,
|
|
99
|
+
useTypeScript,
|
|
100
|
+
webpack,
|
|
101
|
+
});
|
|
102
|
+
// Load proxy config
|
|
103
|
+
const proxySetting = require(paths.appPackageJson).proxy;
|
|
104
|
+
const proxyConfig = prepareProxy(
|
|
105
|
+
proxySetting,
|
|
106
|
+
paths.appPublic,
|
|
107
|
+
paths.publicUrlOrPath,
|
|
108
|
+
);
|
|
109
|
+
// Serve webpack assets generated by the compiler over a web server.
|
|
110
|
+
const serverConfig = {
|
|
111
|
+
...createDevServerConfig(proxyConfig, urls.lanUrlForConfig),
|
|
112
|
+
host: HOST,
|
|
113
|
+
port,
|
|
114
|
+
};
|
|
115
|
+
const devServer = new WebpackDevServer(serverConfig, compiler);
|
|
116
|
+
// Launch WebpackDevServer.
|
|
117
|
+
devServer.startCallback(() => {
|
|
118
|
+
if (isInteractive) {
|
|
119
|
+
clearConsole();
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
if (env.raw.FAST_REFRESH && semver.lt(react.version, '16.10.0')) {
|
|
123
|
+
console.log(
|
|
124
|
+
chalk.yellow(
|
|
125
|
+
`Fast Refresh requires React 16.10 or higher. You are using React ${react.version}.`,
|
|
126
|
+
),
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
console.log(chalk.cyan('Starting the development server...\n'));
|
|
131
|
+
openBrowser(urls.localUrlForBrowser);
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
['SIGINT', 'SIGTERM'].forEach(function (sig) {
|
|
135
|
+
process.on(sig, function () {
|
|
136
|
+
devServer.close();
|
|
137
|
+
process.exit();
|
|
138
|
+
});
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
if (process.env.CI !== 'true') {
|
|
142
|
+
// Gracefully exit when stdin ends
|
|
143
|
+
process.stdin.on('end', function () {
|
|
144
|
+
devServer.close();
|
|
145
|
+
process.exit();
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
})
|
|
149
|
+
.catch(err => {
|
|
150
|
+
if (err && err.message) {
|
|
151
|
+
console.log(err.message);
|
|
152
|
+
}
|
|
153
|
+
process.exit(1);
|
|
154
|
+
});
|
package/scripts/test.js
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
// Do this as the first thing so that any code reading it knows the right env.
|
|
5
|
+
process.env.BABEL_ENV = 'test';
|
|
6
|
+
process.env.NODE_ENV = 'test';
|
|
7
|
+
process.env.PUBLIC_URL = '';
|
|
8
|
+
|
|
9
|
+
// Makes the script crash on unhandled rejections instead of silently
|
|
10
|
+
// ignoring them. In the future, promise rejections that are not handled will
|
|
11
|
+
// terminate the Node.js process with a non-zero exit code.
|
|
12
|
+
process.on('unhandledRejection', err => {
|
|
13
|
+
throw err;
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
// Ensure environment variables are read.
|
|
17
|
+
require('../config/env');
|
|
18
|
+
|
|
19
|
+
const jest = require('jest');
|
|
20
|
+
const execSync = require('child_process').execSync;
|
|
21
|
+
let argv = process.argv.slice(2);
|
|
22
|
+
|
|
23
|
+
function isInGitRepository() {
|
|
24
|
+
try {
|
|
25
|
+
execSync('git rev-parse --is-inside-work-tree', { stdio: 'ignore' });
|
|
26
|
+
return true;
|
|
27
|
+
} catch (e) {
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function isInMercurialRepository() {
|
|
33
|
+
try {
|
|
34
|
+
execSync('hg --cwd . root', { stdio: 'ignore' });
|
|
35
|
+
return true;
|
|
36
|
+
} catch (e) {
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// Watch unless on CI or explicitly running all tests
|
|
42
|
+
if (
|
|
43
|
+
!process.env.CI &&
|
|
44
|
+
argv.indexOf('--watchAll') === -1 &&
|
|
45
|
+
argv.indexOf('--watchAll=false') === -1
|
|
46
|
+
) {
|
|
47
|
+
// https://github.com/facebook/create-react-app/issues/5210
|
|
48
|
+
const hasSourceControl = isInGitRepository() || isInMercurialRepository();
|
|
49
|
+
argv.push(hasSourceControl ? '--watch' : '--watchAll');
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
jest.run(argv);
|
package/src/App.tsx
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { FC, useCallback, useEffect, useMemo, useState } from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import WebFont from 'webfontloader';
|
|
4
|
+
|
|
5
|
+
import { AppContext, AppContextType } from '@/AppContext';
|
|
6
|
+
import AssetsPicker from '@/view/AssetsPicker';
|
|
7
|
+
|
|
8
|
+
type Props = {
|
|
9
|
+
containerId?: string;
|
|
10
|
+
extraFields?: string[];
|
|
11
|
+
multiSelect?: boolean;
|
|
12
|
+
publicApplicationName?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Call back when we close the app modal.
|
|
15
|
+
* Note: This only applicable when containerId is not defined
|
|
16
|
+
* @returns
|
|
17
|
+
*/
|
|
18
|
+
onClose?: () => void;
|
|
19
|
+
onError: AppContextType['onError'];
|
|
20
|
+
onAssetSelected: AppContextType['onAssetSelected'];
|
|
21
|
+
onImageSelected: AppContextType['onImageSelected'];
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const Container = styled.div<{ open?: boolean }>`
|
|
25
|
+
background-color: var(--cx-color-neutral-0);
|
|
26
|
+
display: ${({ open }) => (open ? 'block' : 'none')};
|
|
27
|
+
height: 100vh;
|
|
28
|
+
left: 0;
|
|
29
|
+
position: fixed;
|
|
30
|
+
top: 0;
|
|
31
|
+
width: 100vw;
|
|
32
|
+
z-index: var(--cx-z-index-dialog);
|
|
33
|
+
`;
|
|
34
|
+
|
|
35
|
+
export const App: FC<Props> = ({
|
|
36
|
+
extraFields = [],
|
|
37
|
+
containerId,
|
|
38
|
+
multiSelect,
|
|
39
|
+
onClose,
|
|
40
|
+
onError,
|
|
41
|
+
onAssetSelected,
|
|
42
|
+
onImageSelected,
|
|
43
|
+
}) => {
|
|
44
|
+
useEffect(() => {
|
|
45
|
+
WebFont.load({
|
|
46
|
+
google: {
|
|
47
|
+
families: [
|
|
48
|
+
'Fira Code',
|
|
49
|
+
'Fira Mono',
|
|
50
|
+
'Fira Sans',
|
|
51
|
+
'Fira Sans Condensed',
|
|
52
|
+
'Fira Sans Extra Condensed',
|
|
53
|
+
],
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
const script = document.createElement('script');
|
|
58
|
+
script.src = 'https://design-system.orangelogic.com/entry.1.0.212.js';
|
|
59
|
+
script.type = 'module';
|
|
60
|
+
document.head.appendChild(script);
|
|
61
|
+
|
|
62
|
+
return () => {
|
|
63
|
+
document.head.removeChild(script);
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
}, []);
|
|
67
|
+
const [open, setOpen] = useState(true);
|
|
68
|
+
|
|
69
|
+
const handleClose = useCallback(() => {
|
|
70
|
+
setOpen(false);
|
|
71
|
+
onClose?.();
|
|
72
|
+
}, [onClose]);
|
|
73
|
+
|
|
74
|
+
const contextValue = useMemo(
|
|
75
|
+
() => ({
|
|
76
|
+
extraFields,
|
|
77
|
+
onAssetSelected,
|
|
78
|
+
onImageSelected,
|
|
79
|
+
onError,
|
|
80
|
+
onClose: handleClose,
|
|
81
|
+
}),
|
|
82
|
+
[extraFields, handleClose, onAssetSelected, onError, onImageSelected],
|
|
83
|
+
);
|
|
84
|
+
|
|
85
|
+
return (
|
|
86
|
+
<AppContext.Provider value={contextValue}>
|
|
87
|
+
{containerId ? (
|
|
88
|
+
<AssetsPicker multiSelect={multiSelect} />
|
|
89
|
+
) : (
|
|
90
|
+
<Container open={open}>
|
|
91
|
+
<AssetsPicker multiSelect={multiSelect} />
|
|
92
|
+
</Container>
|
|
93
|
+
)}
|
|
94
|
+
</AppContext.Provider>
|
|
95
|
+
);
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
export default App;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { createContext } from 'react';
|
|
2
|
+
import { GetAssetLinkResponse } from './types/search';
|
|
3
|
+
|
|
4
|
+
export type AppContextType = {
|
|
5
|
+
extraFields: string[];
|
|
6
|
+
onAssetSelected: (asset: GetAssetLinkResponse[]) => void;
|
|
7
|
+
onImageSelected: (image: GetAssetLinkResponse[]) => void;
|
|
8
|
+
onError: (errorMessage?: string, error?: Error) => void;
|
|
9
|
+
onClose: () => void;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const AppContext = createContext<AppContextType>({
|
|
13
|
+
extraFields: [],
|
|
14
|
+
onAssetSelected: () => { },
|
|
15
|
+
onImageSelected: () => { },
|
|
16
|
+
onError: () => { },
|
|
17
|
+
onClose: () => { },
|
|
18
|
+
});
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { createContext } from 'react';
|
|
2
|
+
|
|
3
|
+
export type ImageCardDisplayInfo = {
|
|
4
|
+
title?: boolean,
|
|
5
|
+
dimension?: boolean,
|
|
6
|
+
fileSize?: boolean,
|
|
7
|
+
tags?: boolean,
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export type PluginInfo = {
|
|
11
|
+
publicApplicationName?: string,
|
|
12
|
+
pluginName?: string,
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export type GlobalConfigContextType = {
|
|
16
|
+
availableDocTypes?: string[];
|
|
17
|
+
availableRepresentativeSubtypes?: string[];
|
|
18
|
+
ctaText: string;
|
|
19
|
+
displayInfo: ImageCardDisplayInfo;
|
|
20
|
+
lastLocationMode?: boolean;
|
|
21
|
+
persistMode: boolean;
|
|
22
|
+
pluginInfo: PluginInfo;
|
|
23
|
+
isContentBrowserPopedup: boolean;
|
|
24
|
+
searchInDrive: boolean;
|
|
25
|
+
showCollections?: boolean;
|
|
26
|
+
useSession?: string;
|
|
27
|
+
allowTracking: boolean;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export const GlobalConfigContext = createContext<GlobalConfigContextType>({
|
|
31
|
+
availableDocTypes: [],
|
|
32
|
+
availableRepresentativeSubtypes: [],
|
|
33
|
+
ctaText: 'Insert',
|
|
34
|
+
persistMode: false,
|
|
35
|
+
displayInfo: {
|
|
36
|
+
title: true,
|
|
37
|
+
dimension: true,
|
|
38
|
+
fileSize: false,
|
|
39
|
+
tags: false,
|
|
40
|
+
},
|
|
41
|
+
pluginInfo: {},
|
|
42
|
+
isContentBrowserPopedup: false,
|
|
43
|
+
searchInDrive: false,
|
|
44
|
+
showCollections: false,
|
|
45
|
+
allowTracking: true,
|
|
46
|
+
});
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
|
|
3
|
+
export const Container = styled.div`
|
|
4
|
+
align-items: center;
|
|
5
|
+
display: flex;
|
|
6
|
+
gap: var(--cx-spacing-2x-small);
|
|
7
|
+
text-overflow: ellipsis;
|
|
8
|
+
overflow: hidden;
|
|
9
|
+
|
|
10
|
+
.array-clamp__items-container{
|
|
11
|
+
display: flex;
|
|
12
|
+
align-items: center;
|
|
13
|
+
flex-wrap: nowrap;
|
|
14
|
+
flex-grow: 1;
|
|
15
|
+
flex-shrink: 1;
|
|
16
|
+
overflow: hidden;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.array-clamp__item {
|
|
20
|
+
white-space: nowrap;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.array-clamp__separator {
|
|
24
|
+
white-space: pre;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.array-clamp__item.clamped {
|
|
28
|
+
display: none;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.array-clamp__indicator {
|
|
32
|
+
flex-shrink: 0;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.array-clamp__indicator::part(base) {
|
|
36
|
+
max-width: 4rem;
|
|
37
|
+
display: flex;
|
|
38
|
+
overflow-wrap: break-word;
|
|
39
|
+
padding: 0 0.6em;
|
|
40
|
+
line-height: 0;
|
|
41
|
+
}
|
|
42
|
+
`;
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import React, {
|
|
2
|
+
FC,
|
|
3
|
+
isValidElement,
|
|
4
|
+
useCallback,
|
|
5
|
+
useEffect,
|
|
6
|
+
useMemo,
|
|
7
|
+
useRef,
|
|
8
|
+
useState,
|
|
9
|
+
} from 'react';
|
|
10
|
+
|
|
11
|
+
import { CxResizeObserver } from '@/web-component';
|
|
12
|
+
import { Container } from './ArrayClamp.styled';
|
|
13
|
+
|
|
14
|
+
type ArrayClampProps = {
|
|
15
|
+
children: React.ReactNode;
|
|
16
|
+
className?: string;
|
|
17
|
+
separator?: string;
|
|
18
|
+
tooltipSeparator?: string;
|
|
19
|
+
getChildString?: (index: number) => string;
|
|
20
|
+
};
|
|
21
|
+
type ArrayChildrenProps = {
|
|
22
|
+
children: React.ReactNode;
|
|
23
|
+
isClamped: (index: number) => boolean | undefined;
|
|
24
|
+
separator?: string;
|
|
25
|
+
totalVisible: number;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const ArrayChildren: FC<ArrayChildrenProps> = ({
|
|
29
|
+
children,
|
|
30
|
+
isClamped,
|
|
31
|
+
separator,
|
|
32
|
+
totalVisible,
|
|
33
|
+
}) => {
|
|
34
|
+
const renderLastItem = (child: React.ReactNode, index: number) => {
|
|
35
|
+
return (
|
|
36
|
+
<cx-line-clamp
|
|
37
|
+
class={`array-clamp__item ${isClamped(index) ? 'clamped' : ''}`}
|
|
38
|
+
>
|
|
39
|
+
{child}
|
|
40
|
+
</cx-line-clamp>
|
|
41
|
+
);
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const renderItem = (child: React.ReactNode, index: number) => {
|
|
45
|
+
if (index === totalVisible - 1) {
|
|
46
|
+
return renderLastItem(child, index);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return (
|
|
50
|
+
<span
|
|
51
|
+
className={`array-clamp__item ${isClamped(index) ? 'clamped' : ''}`}
|
|
52
|
+
>
|
|
53
|
+
{child}
|
|
54
|
+
<span className="array-clamp__separator">{separator}</span>
|
|
55
|
+
</span>
|
|
56
|
+
);
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
return React.Children.map(children, (child, index) =>
|
|
60
|
+
renderItem(child, index),
|
|
61
|
+
);
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
const ArrayClamp: FC<ArrayClampProps> = ({ children, className, separator = ', ', tooltipSeparator, getChildString }) => {
|
|
65
|
+
const containerRef = useRef<HTMLDivElement>(null);
|
|
66
|
+
const resizeObserverRef = useRef<CxResizeObserver>(null);
|
|
67
|
+
const [clampedMap, setClampedMap] = useState(new Map<number, boolean>());
|
|
68
|
+
|
|
69
|
+
const totalClamped = Array.from(clampedMap.values()).filter(Boolean).length;
|
|
70
|
+
const totalVisible = React.Children.count(children) - totalClamped;
|
|
71
|
+
|
|
72
|
+
const hiddenChildrenStr = useMemo(() => {
|
|
73
|
+
return React.Children.toArray(children)
|
|
74
|
+
.map((child, index) => {
|
|
75
|
+
if (!clampedMap.get(index)) {
|
|
76
|
+
return '';
|
|
77
|
+
}
|
|
78
|
+
if (getChildString) {
|
|
79
|
+
return getChildString(index);
|
|
80
|
+
}
|
|
81
|
+
if (typeof child === 'string') {
|
|
82
|
+
return child;
|
|
83
|
+
} else if (isValidElement(child)) {
|
|
84
|
+
return (child.props as { children: string }).children;
|
|
85
|
+
} else {
|
|
86
|
+
return '';
|
|
87
|
+
}
|
|
88
|
+
})
|
|
89
|
+
.filter(Boolean)
|
|
90
|
+
.join(tooltipSeparator || separator);
|
|
91
|
+
}, [children, clampedMap, tooltipSeparator, separator, getChildString]);
|
|
92
|
+
|
|
93
|
+
useEffect(() => {
|
|
94
|
+
const container = containerRef.current;
|
|
95
|
+
const resizeObserver = resizeObserverRef.current;
|
|
96
|
+
|
|
97
|
+
if (!container || !resizeObserver) {
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
const handleResize = () => {
|
|
102
|
+
const items = container.querySelectorAll('.array-clamp__item');
|
|
103
|
+
const containerWidth = container.clientWidth;
|
|
104
|
+
let currentWidth = 0;
|
|
105
|
+
let hasClamped = false;
|
|
106
|
+
|
|
107
|
+
items.forEach((item, index) => {
|
|
108
|
+
if (hasClamped) {
|
|
109
|
+
setClampedMap((prev) => new Map(prev.set(index, true)));
|
|
110
|
+
} else {
|
|
111
|
+
currentWidth += item.clientWidth;
|
|
112
|
+
|
|
113
|
+
if (currentWidth > containerWidth) {
|
|
114
|
+
hasClamped = true;
|
|
115
|
+
setClampedMap((prev) => new Map(prev.set(index, true)));
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
const onResize = (e: CustomEvent) => {
|
|
122
|
+
if (e.target !== resizeObserver) {
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
handleResize();
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
resizeObserver.addEventListener('cx-resize', onResize);
|
|
129
|
+
handleResize();
|
|
130
|
+
|
|
131
|
+
return () => {
|
|
132
|
+
resizeObserver.removeEventListener('cx-resize', onResize);
|
|
133
|
+
};
|
|
134
|
+
}, [children]);
|
|
135
|
+
|
|
136
|
+
const isClamped = useCallback(
|
|
137
|
+
(index: number) => {
|
|
138
|
+
return clampedMap.get(index);
|
|
139
|
+
},
|
|
140
|
+
[clampedMap],
|
|
141
|
+
);
|
|
142
|
+
|
|
143
|
+
return (
|
|
144
|
+
<Container className={`array-clamp ${className}`}>
|
|
145
|
+
<cx-resize-observer ref={resizeObserverRef}>
|
|
146
|
+
<div ref={containerRef} className={'array-clamp__items-container'}>
|
|
147
|
+
<ArrayChildren
|
|
148
|
+
isClamped={isClamped}
|
|
149
|
+
separator={separator}
|
|
150
|
+
totalVisible={totalVisible}
|
|
151
|
+
>
|
|
152
|
+
{children}
|
|
153
|
+
</ArrayChildren>
|
|
154
|
+
</div>
|
|
155
|
+
{totalClamped > 0 && (
|
|
156
|
+
<cx-tag variant="neutral" size="small" pill class="array-clamp__indicator">
|
|
157
|
+
<cx-line-clamp tooltip={hiddenChildrenStr} lines={1}>
|
|
158
|
+
+{totalClamped}
|
|
159
|
+
</cx-line-clamp>
|
|
160
|
+
</cx-tag>
|
|
161
|
+
)}
|
|
162
|
+
</cx-resize-observer>
|
|
163
|
+
</Container>
|
|
164
|
+
);
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
export default ArrayClamp;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './ArrayClamp';
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { CxDrawerProps } from '@/react-web-component';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
|
|
4
|
+
export const Drawer = styled('cx-drawer')<CxDrawerProps>`
|
|
5
|
+
&::part(base) {
|
|
6
|
+
z-index: var(--cx-z-index-dialog);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
&::part(body) {
|
|
10
|
+
padding: 0;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
cx-input {
|
|
14
|
+
width: 100%;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
cx-space {
|
|
18
|
+
height: 100%;
|
|
19
|
+
width: 100%;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.browser__folders {
|
|
23
|
+
width: 100%;
|
|
24
|
+
flex: 1;
|
|
25
|
+
overflow-y: auto;
|
|
26
|
+
position: relative;
|
|
27
|
+
|
|
28
|
+
cx-tree {
|
|
29
|
+
width: 100%;
|
|
30
|
+
position: absolute;
|
|
31
|
+
top: 0;
|
|
32
|
+
left: 0;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.browser__folders {
|
|
37
|
+
cx-tree-item {
|
|
38
|
+
&::part(item) {
|
|
39
|
+
padding: 0;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
cx-skeleton {
|
|
44
|
+
--border-radius: var(--cx-border-radius-medium);
|
|
45
|
+
width: 100%;
|
|
46
|
+
height: 32px;
|
|
47
|
+
margin-bottom: var(--cx-spacing-3x-small);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.browser__collections {
|
|
52
|
+
border: none;
|
|
53
|
+
padding: none;
|
|
54
|
+
width: 100%;
|
|
55
|
+
|
|
56
|
+
cx-menu-item {
|
|
57
|
+
&::part(base) {
|
|
58
|
+
border-radius: var(--cx-border-radius-large);
|
|
59
|
+
font-size: var(--cx-font-size-medium);
|
|
60
|
+
padding: var(--cx-spacing-2x-small) var(--cx-spacing-small);
|
|
61
|
+
}
|
|
62
|
+
&::part(checked-icon) {
|
|
63
|
+
display: none;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
&.selected::part(base) {
|
|
67
|
+
background-color: var(--cx-color-primary-50);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
&.selected::part(label),
|
|
71
|
+
&.selected::part(prefix),
|
|
72
|
+
&.selected::part(suffix) {
|
|
73
|
+
color: var(--cx-color-primary-600);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.browser__collections__menu {
|
|
79
|
+
border: none;
|
|
80
|
+
max-height: 200px;
|
|
81
|
+
}
|
|
82
|
+
`;
|