@orangelogic/orange-dam-content-browser-sdk 2.1.54 → 2.1.57
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/build/ApiService.d.ts +15 -0
- package/build/App.d.ts +62 -0
- package/build/AppContext.d.ts +18 -0
- package/build/GlobalConfigContext.d.ts +33 -0
- package/build/OrangeDAMContentBrowserSDK.min.css +2 -0
- package/build/OrangeDAMContentBrowserSDK.min.css.map +1 -0
- package/build/OrangeDAMContentBrowserSDK.min.js +11481 -0
- package/build/OrangeDAMContentBrowserSDK.min.js.map +1 -0
- package/build/asset-manifest.json +13 -0
- package/build/components/ArrayClamp/ArrayClamp.d.ts +10 -0
- package/build/components/ArrayClamp/ArrayClamp.styled.d.ts +1 -0
- package/build/components/ArrayClamp/index.d.ts +1 -0
- package/build/components/Browser/Browser.constants.d.ts +3 -0
- package/build/components/Browser/Browser.d.ts +22 -0
- package/build/components/Browser/Browser.styled.d.ts +2 -0
- package/build/components/Browser/BrowserItem.d.ts +13 -0
- package/build/components/Browser/LoadMoreButton.d.ts +9 -0
- package/build/components/ControlBar/ControlBar.constants.d.ts +10 -0
- package/build/components/ControlBar/ControlBar.d.ts +23 -0
- package/build/components/ControlBar/ControlBar.styled.d.ts +1 -0
- package/build/components/ControlBar/Facet/Facet.d.ts +14 -0
- package/build/components/ControlBar/Facet/index.d.ts +1 -0
- package/build/components/FormatDialog/CropPreviewer/CropPreviewer.d.ts +41 -0
- package/{src/components/FormatDialog/CropPreviewer/index.ts → build/components/FormatDialog/CropPreviewer/index.d.ts} +1 -1
- package/build/components/FormatDialog/CustomRendition/CustomRendition.constants.d.ts +5 -0
- package/build/components/FormatDialog/CustomRendition/CustomRendition.d.ts +56 -0
- package/build/components/FormatDialog/CustomRendition/CustomRendition.styled.d.ts +1 -0
- package/build/components/FormatDialog/CustomRendition/index.d.ts +1 -0
- package/build/components/FormatDialog/CustomRendition/transformations/Crop.d.ts +26 -0
- package/build/components/FormatDialog/CustomRendition/transformations/Extension.d.ts +11 -0
- package/build/components/FormatDialog/CustomRendition/transformations/Format.d.ts +10 -0
- package/build/components/FormatDialog/CustomRendition/transformations/Metadata.d.ts +7 -0
- package/build/components/FormatDialog/CustomRendition/transformations/Quality.d.ts +7 -0
- package/build/components/FormatDialog/CustomRendition/transformations/Resize.d.ts +18 -0
- package/build/components/FormatDialog/CustomRendition/transformations/Rotate.d.ts +8 -0
- package/{src/components/FormatDialog/CustomRendition/transformations/index.ts → build/components/FormatDialog/CustomRendition/transformations/index.d.ts} +3 -1
- package/build/components/FormatDialog/FormatDialog.d.ts +49 -0
- package/build/components/FormatDialog/FormatDialog.styled.d.ts +3 -0
- package/build/components/FormatDialog/Previewer/Previewer.d.ts +17 -0
- package/build/components/FormatDialog/Previewer/Previewer.styled.d.ts +1 -0
- package/build/components/FormatDialog/Previewer/index.d.ts +1 -0
- package/build/components/FormatDialog/ProxyMenu/ProxyMenu.d.ts +20 -0
- package/build/components/FormatDialog/ProxyMenu/ProxyMenu.styled.d.ts +2 -0
- package/build/components/FormatDialog/ProxyMenu/index.d.ts +1 -0
- package/build/components/FormatDialog/TrackingParameters/TrackingParameters.d.ts +13 -0
- package/build/components/FormatDialog/TrackingParameters/index.d.ts +1 -0
- package/build/components/FormatDialog/VersionHistory/VersionHistory.d.ts +6 -0
- package/build/components/FormatDialog/VersionHistory/VersionHistory.styled.d.ts +1 -0
- package/build/components/FormatDialog/VersionHistory/index.d.ts +1 -0
- package/build/components/FormatDialog/index.d.ts +1 -0
- package/build/components/Header/Header.d.ts +15 -0
- package/build/components/Header/Header.styled.d.ts +5 -0
- package/build/components/Loader/Loader.d.ts +7 -0
- package/build/components/Loader/index.d.ts +1 -0
- package/build/components/NoResult/NoResult.d.ts +7 -0
- package/build/components/NoResult/index.d.ts +1 -0
- package/build/components/Result/AssetCard/AssetCard.d.ts +15 -0
- package/build/components/Result/AssetCard/AssetCard.styled.d.ts +2 -0
- package/build/components/Result/AssetCard/AssetCardWrapper.d.ts +18 -0
- package/build/components/Result/AssetCard/AssetCardWrapper.styled.d.ts +1 -0
- package/build/components/Result/AssetCard/index.d.ts +1 -0
- package/build/components/Result/AssetPreview/AssetPreview.d.ts +11 -0
- package/build/components/Result/AssetPreview/AssetPreview.styled.d.ts +1 -0
- package/build/components/Result/AssetPreview/ImagePreview/ImagePreview.d.ts +11 -0
- package/build/components/Result/AssetPreview/ImagePreview/index.d.ts +1 -0
- package/build/components/Result/AssetPreview/OtherPreview/OtherPreview.d.ts +9 -0
- package/build/components/Result/AssetPreview/OtherPreview/OtherPreview.styled.d.ts +1 -0
- package/build/components/Result/AssetPreview/OtherPreview/index.d.ts +1 -0
- package/build/components/Result/AssetPreview/VideoPreview/VideoPreview.d.ts +11 -0
- package/build/components/Result/AssetPreview/VideoPreview/index.d.ts +1 -0
- package/build/components/Result/AssetPreview/index.d.ts +1 -0
- package/build/consts/asset.d.ts +14 -0
- package/build/consts/auth.d.ts +4 -0
- package/build/consts/data.d.ts +21 -0
- package/build/index.d.ts +229 -0
- package/build/index.html +1 -0
- package/build/page/Authenticate/Authenticate.d.ts +2 -0
- package/build/page/Authenticate/ConnectingBackground.d.ts +8 -0
- package/build/page/Authenticate/index.d.ts +2 -0
- package/build/page/Home/Home.d.ts +6 -0
- package/build/page/Home/Home.styled.d.ts +2 -0
- package/build/setupTests.d.ts +1 -0
- package/build/store/assets/assets.api.d.ts +66 -0
- package/build/store/assets/assets.service.d.ts +23 -0
- package/build/store/assets/assets.slice.d.ts +65 -0
- package/build/store/auth/auth.service.d.ts +10 -0
- package/build/store/auth/auth.slice.d.ts +76 -0
- package/build/store/index.d.ts +368 -0
- package/build/store/search/search.api.d.ts +39 -0
- package/build/store/search/search.slice.d.ts +12 -0
- package/build/store/user/user.api.d.ts +5 -0
- package/build/types/assets.d.ts +68 -0
- package/build/types/auth.d.ts +35 -0
- package/build/types/common.d.ts +11 -0
- package/build/types/download.d.ts +8 -0
- package/build/types/navigation.d.ts +3 -0
- package/build/types/search.d.ts +148 -0
- package/{src/types/storage.ts → build/types/storage.d.ts} +1 -1
- package/build/types/user.d.ts +7 -0
- package/build/utils/api.d.ts +27 -0
- package/build/utils/array.d.ts +13 -0
- package/build/utils/constants.d.ts +11 -0
- package/build/utils/function.d.ts +1 -0
- package/build/utils/getRequestUrl.d.ts +1 -0
- package/build/utils/hooks.d.ts +1 -0
- package/build/utils/icon.d.ts +3 -0
- package/build/utils/image.d.ts +24 -0
- package/build/utils/number.d.ts +4 -0
- package/build/utils/rotate.d.ts +4 -0
- package/build/utils/storage.d.ts +23 -0
- package/build/utils/string.d.ts +12 -0
- package/build/view/AssetsPicker.d.ts +6 -0
- package/package.json +49 -8
- package/.env +0 -1
- package/.eslintignore +0 -2
- package/.eslintrc.json +0 -82
- package/.releaserc +0 -17
- package/.travis.yml +0 -20
- package/CBSDKdemo.html +0 -315
- package/GitVersion.yml +0 -18
- package/azure-pipeline.yaml +0 -93
- package/clientlib.config.js +0 -36
- package/config/env.js +0 -105
- package/config/getHttpsConfig.js +0 -67
- package/config/jest/babelTransform.js +0 -30
- package/config/jest/cssTransform.js +0 -14
- package/config/jest/fileTransform.js +0 -41
- package/config/modules.js +0 -135
- package/config/paths.js +0 -79
- package/config/webpack/persistentCache/createEnvironmentHash.js +0 -10
- package/config/webpack.config.js +0 -762
- package/config/webpackDevServer.config.js +0 -128
- package/config-overrides.js +0 -8
- package/gab_extension/GAB.html +0 -85
- package/gab_extension/GoogleChrome/manifest.json +0 -28
- package/gab_extension/GoogleChrome/src/assets/icon48.png +0 -0
- package/gab_extension/GoogleChrome/src/background/index.js +0 -6
- package/gab_extension/GoogleChrome/src/scripts/index.js +0 -347
- package/gab_extension/MozillaFirefox/manifest.json +0 -20
- package/gab_extension/MozillaFirefox/src/assets/icon.png +0 -0
- package/gab_extension/MozillaFirefox/src/background/index.js +0 -5
- package/gab_extension/MozillaFirefox/src/scripts/index.js +0 -347
- package/gab_extension/README.md +0 -11
- package/gab_extension/Safari/Orange DAM Asset Browser Extension/Orange DAM Asset Browser Extension.xcodeproj/project.pbxproj +0 -927
- package/gab_extension/Safari/Orange DAM Asset Browser Extension/Orange DAM Asset Browser Extension.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -7
- package/gab_extension/Safari/Orange DAM Asset Browser Extension/Orange DAM Asset Browser Extension.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
- 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 +0 -19
- package/gab_extension/Safari/Orange DAM Asset Browser Extension/Shared (App)/Assets.xcassets/AccentColor.colorset/Contents.json +0 -11
- package/gab_extension/Safari/Orange DAM Asset Browser Extension/Shared (App)/Assets.xcassets/AppIcon.appiconset/Contents.json +0 -63
- package/gab_extension/Safari/Orange DAM Asset Browser Extension/Shared (App)/Assets.xcassets/Contents.json +0 -6
- package/gab_extension/Safari/Orange DAM Asset Browser Extension/Shared (App)/Assets.xcassets/LargeIcon.imageset/Contents.json +0 -20
- package/gab_extension/Safari/Orange DAM Asset Browser Extension/Shared (App)/Base.lproj/Main.html +0 -23
- 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 +0 -24
- package/gab_extension/Safari/Orange DAM Asset Browser Extension/Shared (App)/Resources/Style.css +0 -61
- package/gab_extension/Safari/Orange DAM Asset Browser Extension/Shared (App)/ViewController.swift +0 -81
- package/gab_extension/Safari/Orange DAM Asset Browser Extension/Shared (Extension)/SafariWebExtensionHandler.swift +0 -26
- package/gab_extension/Safari/Orange DAM Asset Browser Extension/iOS (App)/AppDelegate.swift +0 -24
- package/gab_extension/Safari/Orange DAM Asset Browser Extension/iOS (App)/Base.lproj/LaunchScreen.storyboard +0 -36
- package/gab_extension/Safari/Orange DAM Asset Browser Extension/iOS (App)/Base.lproj/Main.storyboard +0 -38
- package/gab_extension/Safari/Orange DAM Asset Browser Extension/iOS (App)/Info.plist +0 -27
- package/gab_extension/Safari/Orange DAM Asset Browser Extension/iOS (App)/SceneDelegate.swift +0 -18
- package/gab_extension/Safari/Orange DAM Asset Browser Extension/iOS (Extension)/Info.plist +0 -13
- package/gab_extension/Safari/Orange DAM Asset Browser Extension/macOS (App)/AppDelegate.swift +0 -21
- package/gab_extension/Safari/Orange DAM Asset Browser Extension/macOS (App)/Base.lproj/Main.storyboard +0 -125
- package/gab_extension/Safari/Orange DAM Asset Browser Extension/macOS (App)/Info.plist +0 -8
- package/gab_extension/Safari/Orange DAM Asset Browser Extension/macOS (App)/Orange DAM Asset Browser Extension.entitlements +0 -12
- package/gab_extension/Safari/Orange DAM Asset Browser Extension/macOS (Extension)/Info.plist +0 -13
- package/gab_extension/Safari/Orange DAM Asset Browser Extension/macOS (Extension)/Orange DAM Asset Browser Extension.entitlements +0 -10
- package/public/index.html +0 -92
- package/scripts/build.js +0 -218
- package/scripts/start.js +0 -154
- package/scripts/test.js +0 -53
- package/src/App.tsx +0 -98
- package/src/AppContext.ts +0 -18
- package/src/GlobalConfigContext.ts +0 -46
- package/src/components/ArrayClamp/ArrayClamp.styled.ts +0 -42
- package/src/components/ArrayClamp/ArrayClamp.tsx +0 -167
- package/src/components/ArrayClamp/index.ts +0 -1
- package/src/components/Browser/Browser.styled.ts +0 -82
- package/src/components/Browser/Browser.tsx +0 -284
- package/src/components/Browser/BrowserItem.tsx +0 -98
- package/src/components/ControlBar/ControlBar.constants.tsx +0 -66
- package/src/components/ControlBar/ControlBar.styled.ts +0 -82
- package/src/components/ControlBar/ControlBar.tsx +0 -528
- package/src/components/ControlBar/Facet/Facet.tsx +0 -113
- package/src/components/ControlBar/Facet/index.ts +0 -1
- package/src/components/FormatDialog/CropPreviewer/CropPreviewer.tsx +0 -224
- package/src/components/FormatDialog/CustomRendition/CustomRendition.constants.ts +0 -24
- package/src/components/FormatDialog/CustomRendition/CustomRendition.styled.ts +0 -57
- package/src/components/FormatDialog/CustomRendition/CustomRendition.tsx +0 -178
- package/src/components/FormatDialog/CustomRendition/index.ts +0 -1
- package/src/components/FormatDialog/CustomRendition/transformations/Crop.tsx +0 -249
- package/src/components/FormatDialog/CustomRendition/transformations/Extension.tsx +0 -54
- package/src/components/FormatDialog/CustomRendition/transformations/Format.tsx +0 -86
- package/src/components/FormatDialog/CustomRendition/transformations/Resize.tsx +0 -176
- package/src/components/FormatDialog/CustomRendition/transformations/Rotate.tsx +0 -101
- package/src/components/FormatDialog/FormatDialog.styled.ts +0 -137
- package/src/components/FormatDialog/FormatDialog.tsx +0 -1533
- package/src/components/FormatDialog/Previewer/Previewer.styled.ts +0 -31
- package/src/components/FormatDialog/Previewer/Previewer.tsx +0 -143
- package/src/components/FormatDialog/Previewer/index.ts +0 -1
- package/src/components/FormatDialog/ProxyMenu/ProxyMenu.styled.ts +0 -88
- package/src/components/FormatDialog/ProxyMenu/ProxyMenu.tsx +0 -74
- package/src/components/FormatDialog/ProxyMenu/index.ts +0 -1
- package/src/components/FormatDialog/TrackingParameters/TrackingParameters.tsx +0 -59
- package/src/components/FormatDialog/TrackingParameters/index.ts +0 -1
- package/src/components/FormatDialog/index.ts +0 -1
- package/src/components/Header/Header.styled.ts +0 -51
- package/src/components/Header/Header.tsx +0 -118
- package/src/components/Loader/Loader.tsx +0 -37
- package/src/components/Loader/index.ts +0 -1
- package/src/components/NoResult/NoResult.tsx +0 -37
- package/src/components/NoResult/index.tsx +0 -1
- package/src/components/Result/AssetCard/AssetCard.styled.ts +0 -120
- package/src/components/Result/AssetCard/AssetCard.tsx +0 -192
- package/src/components/Result/AssetCard/AssetCardWrapper.styled.ts +0 -35
- package/src/components/Result/AssetCard/AssetCardWrapper.tsx +0 -165
- package/src/components/Result/AssetCard/index.ts +0 -1
- package/src/components/Result/AssetPreview/AssetPreview.styled.ts +0 -108
- package/src/components/Result/AssetPreview/AssetPreview.tsx +0 -78
- package/src/components/Result/AssetPreview/ImagePreview/ImagePreview.tsx +0 -42
- package/src/components/Result/AssetPreview/ImagePreview/index.ts +0 -1
- package/src/components/Result/AssetPreview/OtherPreview/OtherPreview.styled.ts +0 -23
- package/src/components/Result/AssetPreview/OtherPreview/OtherPreview.tsx +0 -28
- package/src/components/Result/AssetPreview/OtherPreview/index.ts +0 -1
- package/src/components/Result/AssetPreview/VideoPreview/VideoPreview.tsx +0 -132
- package/src/components/Result/AssetPreview/VideoPreview/index.ts +0 -1
- package/src/components/Result/AssetPreview/index.ts +0 -1
- package/src/consts/asset.ts +0 -16
- package/src/consts/data.ts +0 -17
- package/src/index.tsx +0 -305
- package/src/page/Authenticate/Authenticate.tsx +0 -232
- package/src/page/Authenticate/ConnectingBackground.tsx +0 -44
- package/src/page/Authenticate/index.tsx +0 -94
- package/src/page/Home/Home.styled.ts +0 -46
- package/src/page/Home/Home.tsx +0 -941
- package/src/react-web-component.d.ts +0 -4617
- package/src/store/assets/assets.api.ts +0 -167
- package/src/store/assets/assets.service.ts +0 -223
- package/src/store/assets/assets.slice.ts +0 -104
- package/src/store/auth/auth.service.ts +0 -71
- package/src/store/auth/auth.slice.ts +0 -295
- package/src/store/index.ts +0 -27
- package/src/store/search/search.api.ts +0 -319
- package/src/store/search/search.slice.ts +0 -28
- package/src/store/user/user.api.ts +0 -29
- package/src/styles.css +0 -42
- package/src/types/assets.ts +0 -71
- package/src/types/auth.ts +0 -42
- package/src/types/common.ts +0 -11
- package/src/types/download.ts +0 -8
- package/src/types/navigation.ts +0 -3
- package/src/types/search.ts +0 -116
- package/src/types/user.ts +0 -6
- package/src/utils/api.ts +0 -186
- package/src/utils/array.ts +0 -25
- package/src/utils/constants.ts +0 -12
- package/src/utils/fetch.ts +0 -116
- package/src/utils/getRequestUrl.ts +0 -15
- package/src/utils/hooks.ts +0 -36
- package/src/utils/icon.ts +0 -22
- package/src/utils/image.ts +0 -157
- package/src/utils/number.ts +0 -11
- package/src/utils/rotate.ts +0 -23
- package/src/utils/storage.ts +0 -184
- package/src/utils/string.ts +0 -24
- package/src/view/AssetsPicker.tsx +0 -24
- package/src/web-component.d.ts +0 -8151
- package/tsconfig.eslint.json +0 -10
- package/tsconfig.json +0 -37
- /package/{src/components/Browser/index.ts → build/components/Browser/index.d.ts} +0 -0
- /package/{src/components/ControlBar/index.ts → build/components/ControlBar/index.d.ts} +0 -0
- /package/{src/components/Header/index.ts → build/components/Header/index.d.ts} +0 -0
- /package/{public → build}/favicon.ico +0 -0
- /package/{public → build}/logo192.png +0 -0
- /package/{public → build}/logo512.png +0 -0
- /package/{public → build}/manifest.json +0 -0
- /package/{src/page/Home/index.ts → build/page/Home/index.d.ts} +0 -0
- /package/{public → build}/robots.txt +0 -0
package/scripts/test.js
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
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
DELETED
|
@@ -1,98 +0,0 @@
|
|
|
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;
|
package/src/AppContext.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
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
|
-
});
|
|
@@ -1,46 +0,0 @@
|
|
|
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
|
-
});
|
|
@@ -1,42 +0,0 @@
|
|
|
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
|
-
`;
|
|
@@ -1,167 +0,0 @@
|
|
|
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;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from './ArrayClamp';
|
|
@@ -1,82 +0,0 @@
|
|
|
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
|
-
`;
|