@orangelogic/orange-dam-content-browser-sdk 1.0.1-test
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/README.md +57 -0
- package/azure-pipeline.yaml +94 -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 +192 -0
- package/public/favicon.ico +0 -0
- package/public/index.html +92 -0
- package/public/logo192.png +0 -0
- package/public/logo512.png +0 -0
- package/public/manifest.json +25 -0
- package/public/robots.txt +3 -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/Browser/index.ts +1 -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/ControlBar/index.ts +1 -0
- package/src/components/FormatDialog/CropPreviewer/CropPreviewer.tsx +224 -0
- package/src/components/FormatDialog/CropPreviewer/index.ts +3 -0
- 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/src/components/FormatDialog/CustomRendition/transformations/index.ts +5 -0
- 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/Header/index.ts +1 -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/page/Home/index.ts +1 -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/src/types/storage.ts +1 -0
- 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/.env
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
BUILD_PATH=./build
|
package/.eslintignore
ADDED
package/.eslintrc.json
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
{
|
|
2
|
+
"env": {
|
|
3
|
+
"browser": true,
|
|
4
|
+
"es2021": true,
|
|
5
|
+
"jest/globals": true
|
|
6
|
+
},
|
|
7
|
+
"extends": [
|
|
8
|
+
"airbnb-typescript/base",
|
|
9
|
+
"plugin:@typescript-eslint/recommended",
|
|
10
|
+
"plugin:import/typescript",
|
|
11
|
+
"plugin:react/recommended",
|
|
12
|
+
"plugin:react/jsx-runtime",
|
|
13
|
+
"plugin:react-hooks/recommended"
|
|
14
|
+
],
|
|
15
|
+
"parser": "@typescript-eslint/parser",
|
|
16
|
+
"parserOptions": {
|
|
17
|
+
"ecmaVersion": "latest",
|
|
18
|
+
"sourceType": "module",
|
|
19
|
+
"project": "./tsconfig.eslint.json"
|
|
20
|
+
},
|
|
21
|
+
"plugins": [
|
|
22
|
+
"@typescript-eslint",
|
|
23
|
+
"import",
|
|
24
|
+
"jest"
|
|
25
|
+
],
|
|
26
|
+
"rules": {
|
|
27
|
+
"@typescript-eslint/ban-ts-comment": "off",
|
|
28
|
+
"@typescript-eslint/no-explicit-any": "warn",
|
|
29
|
+
"@typescript-eslint/return-await": "off",
|
|
30
|
+
"no-unused-vars": "off",
|
|
31
|
+
"react/display-name": "off",
|
|
32
|
+
"@typescript-eslint/no-unused-vars": [
|
|
33
|
+
"warn",
|
|
34
|
+
{
|
|
35
|
+
"argsIgnorePattern": "^_",
|
|
36
|
+
"varsIgnorePattern": "^_",
|
|
37
|
+
"caughtErrorsIgnorePattern": "^_"
|
|
38
|
+
}
|
|
39
|
+
],
|
|
40
|
+
"linebreak-style": 0,
|
|
41
|
+
"max-len": [
|
|
42
|
+
"error",
|
|
43
|
+
{
|
|
44
|
+
"code": 200,
|
|
45
|
+
"ignoreTemplateLiterals": true,
|
|
46
|
+
"ignoreStrings": true
|
|
47
|
+
}
|
|
48
|
+
],
|
|
49
|
+
"import/extensions": [
|
|
50
|
+
"error",
|
|
51
|
+
"ignorePackages",
|
|
52
|
+
{
|
|
53
|
+
"": "never",
|
|
54
|
+
"js": "never",
|
|
55
|
+
"jsx": "never",
|
|
56
|
+
"ts": "never",
|
|
57
|
+
"tsx": "never"
|
|
58
|
+
}
|
|
59
|
+
],
|
|
60
|
+
"import/no-extraneous-dependencies": [
|
|
61
|
+
"error", {
|
|
62
|
+
"devDependencies": false,
|
|
63
|
+
"optionalDependencies": false,
|
|
64
|
+
"peerDependencies": false,
|
|
65
|
+
"packageDir": "./"
|
|
66
|
+
}
|
|
67
|
+
],
|
|
68
|
+
"react-hooks/exhaustive-deps": "warn"
|
|
69
|
+
},
|
|
70
|
+
"settings": {
|
|
71
|
+
"import/resolver": {
|
|
72
|
+
"node": {
|
|
73
|
+
"extensions": [
|
|
74
|
+
".js",
|
|
75
|
+
".jsx",
|
|
76
|
+
".ts",
|
|
77
|
+
".tsx"
|
|
78
|
+
]
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
package/.releaserc
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"plugins": [
|
|
3
|
+
"@semantic-release/commit-analyzer",
|
|
4
|
+
"@semantic-release/release-notes-generator",
|
|
5
|
+
["@semantic-release/npm", {
|
|
6
|
+
"npmPublish": false
|
|
7
|
+
}],
|
|
8
|
+
["@semantic-release/exec", {
|
|
9
|
+
"prepareCmd": "npm run build"
|
|
10
|
+
}],
|
|
11
|
+
["@semantic-release/git", {
|
|
12
|
+
"assets": ["dist/**/*", "docs", "package.json"],
|
|
13
|
+
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
|
|
14
|
+
}],
|
|
15
|
+
"@semantic-release/github"
|
|
16
|
+
]
|
|
17
|
+
}
|
package/.travis.yml
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
language: node_js
|
|
2
|
+
node_js:
|
|
3
|
+
- lts/*
|
|
4
|
+
- "stable"
|
|
5
|
+
script:
|
|
6
|
+
- npm test
|
|
7
|
+
- npm run build
|
|
8
|
+
jobs:
|
|
9
|
+
include:
|
|
10
|
+
# Define the release stage that runs semantic-release
|
|
11
|
+
- stage: release
|
|
12
|
+
node_js: lts/*
|
|
13
|
+
# Advanced: optionally overwrite your default `script` step to skip the tests
|
|
14
|
+
# It may not needed if `npm run build` and `npm test` run in preversion step
|
|
15
|
+
# script: skip
|
|
16
|
+
deploy:
|
|
17
|
+
provider: script
|
|
18
|
+
skip_cleanup: true
|
|
19
|
+
script:
|
|
20
|
+
- npm run release
|
package/CBSDKdemo.html
ADDED
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="UTF-8" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
+
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" />
|
|
8
|
+
|
|
9
|
+
<script src="https://downloads.orangelogic.com/ContentBrowserSDK/v1.0.1-test/OrangeDAMContentBrowserSDK.min.js"></script>
|
|
10
|
+
<link rel="stylesheet" type="text/css"
|
|
11
|
+
href="https://downloads.orangelogic.com/ContentBrowserSDK/v1.0.1-test/OrangeDAMContentBrowserSDK.min.css">
|
|
12
|
+
|
|
13
|
+
<style>
|
|
14
|
+
* {
|
|
15
|
+
box-sizing: border-box;
|
|
16
|
+
}
|
|
17
|
+
body {
|
|
18
|
+
color: var(--cx-color-neutral);
|
|
19
|
+
font-family: 'Roboto', sans-serif;
|
|
20
|
+
padding: 1rem;
|
|
21
|
+
}
|
|
22
|
+
p {
|
|
23
|
+
margin: 0;
|
|
24
|
+
}
|
|
25
|
+
#app {
|
|
26
|
+
display: flex;
|
|
27
|
+
gap: 0.5em;
|
|
28
|
+
height: 800px;
|
|
29
|
+
}
|
|
30
|
+
#asset-browser-container {
|
|
31
|
+
flex: 1;
|
|
32
|
+
display: flex;
|
|
33
|
+
flex-direction: column;
|
|
34
|
+
}
|
|
35
|
+
#asset-browser-header {
|
|
36
|
+
display: flex;
|
|
37
|
+
justify-content: space-between;
|
|
38
|
+
align-items: center;
|
|
39
|
+
}
|
|
40
|
+
#react-app-root {
|
|
41
|
+
flex: 1;
|
|
42
|
+
border: 2px solid var(--cx-color-neutral);
|
|
43
|
+
border-radius: var(--cx-border-radius-small);
|
|
44
|
+
}
|
|
45
|
+
#more {
|
|
46
|
+
display: flex;
|
|
47
|
+
flex-direction: column;
|
|
48
|
+
gap: 0.5rem;
|
|
49
|
+
min-width: 400px;
|
|
50
|
+
height: 100%;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.wrapper {
|
|
54
|
+
display: flex;
|
|
55
|
+
flex-direction: column;
|
|
56
|
+
flex-basis: 50%;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.wrapper button {
|
|
60
|
+
border: none;
|
|
61
|
+
cursor: pointer;
|
|
62
|
+
margin-top: var(--cx-spacing-small);
|
|
63
|
+
padding: var(--cx-spacing-x-small) var(--cx-spacing-medium);
|
|
64
|
+
letter-spacing: 0.05em;
|
|
65
|
+
width: 100%;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
#config,
|
|
69
|
+
#output {
|
|
70
|
+
border: 2px solid var(--cx-color-neutral);
|
|
71
|
+
border-radius: var(--cx-border-radius-small);
|
|
72
|
+
padding: var(--cx-spacing-small);
|
|
73
|
+
position: relative;
|
|
74
|
+
flex: 1;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
#content {
|
|
78
|
+
position: absolute;
|
|
79
|
+
top: 0;
|
|
80
|
+
left: 0;
|
|
81
|
+
width: 100%;
|
|
82
|
+
height: 100%;
|
|
83
|
+
overflow-y: auto;
|
|
84
|
+
white-space: pre;
|
|
85
|
+
}
|
|
86
|
+
</style>
|
|
87
|
+
</head>
|
|
88
|
+
|
|
89
|
+
<body>
|
|
90
|
+
<div id="app">
|
|
91
|
+
<div id="asset-browser-container">
|
|
92
|
+
<div id="asset-browser-header">
|
|
93
|
+
<span>OrangeDAM Content Browser SDK</span>
|
|
94
|
+
<div>
|
|
95
|
+
<input type="checkbox" id="mobile">
|
|
96
|
+
<label for="mobile">Mobile</label>
|
|
97
|
+
</div>
|
|
98
|
+
</div>
|
|
99
|
+
<div id="react-app-root"></div>
|
|
100
|
+
</div>
|
|
101
|
+
<div id="more">
|
|
102
|
+
<div class="wrapper">
|
|
103
|
+
<span>Config</span>
|
|
104
|
+
<div id="config">
|
|
105
|
+
<div id="content" contenteditable></div>
|
|
106
|
+
</div>
|
|
107
|
+
<button onclick="loadConfig()">Load config</button>
|
|
108
|
+
</div>
|
|
109
|
+
<div class="wrapper">
|
|
110
|
+
<span>Output</span>
|
|
111
|
+
<textarea id="output"></textarea>
|
|
112
|
+
</div>
|
|
113
|
+
</div>
|
|
114
|
+
</div>
|
|
115
|
+
<div>
|
|
116
|
+
<h3>Properties</h3>
|
|
117
|
+
<div style="display: flex;">
|
|
118
|
+
<ul>
|
|
119
|
+
<li>
|
|
120
|
+
<b>onAssetSelected</b>
|
|
121
|
+
<p>
|
|
122
|
+
A function that will be called when an asset is selected. The function will receive an array of selected assets.
|
|
123
|
+
</p>
|
|
124
|
+
</li>
|
|
125
|
+
<li>
|
|
126
|
+
<b>onError</b>
|
|
127
|
+
<p>
|
|
128
|
+
A function that will be called when an error occurs. The function will receive an error message and the error object.
|
|
129
|
+
</p>
|
|
130
|
+
</li>
|
|
131
|
+
<li>
|
|
132
|
+
<b>onClose</b>
|
|
133
|
+
<p>
|
|
134
|
+
A function that will be called when the content browser is closed.
|
|
135
|
+
</p>
|
|
136
|
+
</li>
|
|
137
|
+
<li>
|
|
138
|
+
<b>publicApplicationName</b> (default blank)
|
|
139
|
+
<p>
|
|
140
|
+
The public name of the DAM to display in the login screen.
|
|
141
|
+
</p>
|
|
142
|
+
</li>
|
|
143
|
+
<li>
|
|
144
|
+
<b>pluginName</b> (default "OrangeDAM Content Browser")
|
|
145
|
+
<p>
|
|
146
|
+
The name of the plugin to display in the login screen.
|
|
147
|
+
</p>
|
|
148
|
+
</li>
|
|
149
|
+
<li>
|
|
150
|
+
<b>containerId</b>
|
|
151
|
+
<p>
|
|
152
|
+
The id of the container element to attach the content browser. If not provided, the content browser will open in a popup.
|
|
153
|
+
</p>
|
|
154
|
+
</li>
|
|
155
|
+
<li>
|
|
156
|
+
<b>baseUrl</b>
|
|
157
|
+
<p>
|
|
158
|
+
The default base URL to pre-fill in the content browser.
|
|
159
|
+
</p>
|
|
160
|
+
</li>
|
|
161
|
+
<li>
|
|
162
|
+
<b>ctaText</b> (default "Insert")
|
|
163
|
+
<p>
|
|
164
|
+
The text to display on the insert button.
|
|
165
|
+
</p>
|
|
166
|
+
</li>
|
|
167
|
+
<li>
|
|
168
|
+
<b>availableDocTypes</b>
|
|
169
|
+
<p>
|
|
170
|
+
An array of available OrangeDAM asset types to filter the assets.
|
|
171
|
+
The available doc types will be configured in OL Platform. If not provided, all doc types will be available.
|
|
172
|
+
To get the available asset of a doc type, you can add a wildcard (*) at the end of the doc type name.
|
|
173
|
+
<br/>
|
|
174
|
+
<span>E.g. Images*, Videos*, Audio*, Others*,...</span>
|
|
175
|
+
</p>
|
|
176
|
+
<p>
|
|
177
|
+
<small>
|
|
178
|
+
Note: The asset types are case-sensitive.
|
|
179
|
+
</small>
|
|
180
|
+
</p>
|
|
181
|
+
</li>
|
|
182
|
+
<li>
|
|
183
|
+
<b>availableRepresentativeSubtypes</b>
|
|
184
|
+
<p>
|
|
185
|
+
An array of supported OrangeDAM subtypes to allow inserting representative image. If not provided, all subtypes will be supported.
|
|
186
|
+
<br/>
|
|
187
|
+
<span>E.g. Standard Image, Standard Video, Standard Audio, Other,...</span>
|
|
188
|
+
</p>
|
|
189
|
+
<p>
|
|
190
|
+
<small>
|
|
191
|
+
Note: The subtypes are case-sensitive.
|
|
192
|
+
</small>
|
|
193
|
+
</p>
|
|
194
|
+
</li>
|
|
195
|
+
</ul>
|
|
196
|
+
<ul>
|
|
197
|
+
<li>
|
|
198
|
+
<b>displayInfo</b>
|
|
199
|
+
<p>
|
|
200
|
+
An object to configure the display of the asset information. The object has the following properties:
|
|
201
|
+
</p>
|
|
202
|
+
<ul>
|
|
203
|
+
<li>title (default true)</li>
|
|
204
|
+
<li>dimension (default true)</li>
|
|
205
|
+
<li>fileSize (default false)</li>
|
|
206
|
+
<li>tags (default false)</li>
|
|
207
|
+
</ul>
|
|
208
|
+
</li>
|
|
209
|
+
<li>
|
|
210
|
+
<b>extraFields</b>
|
|
211
|
+
<p>
|
|
212
|
+
An array of extra fields to get from the assets. The fields are in the format of "coreField.FieldName" or "document.FieldName".
|
|
213
|
+
</p>
|
|
214
|
+
</li>
|
|
215
|
+
<li>
|
|
216
|
+
<b>lastLocationMode</b> (default false)
|
|
217
|
+
<p>
|
|
218
|
+
A boolean to enable the last location mode. When enabled, the content browser open the last selected folder on loaded.
|
|
219
|
+
</p>
|
|
220
|
+
</li>
|
|
221
|
+
<li>
|
|
222
|
+
<b>persistMode</b> (default true)
|
|
223
|
+
<p>
|
|
224
|
+
A boolean to enable the persist mode. When enabled, the content browser will not close after selecting an asset.
|
|
225
|
+
</p>
|
|
226
|
+
</li>
|
|
227
|
+
<li>
|
|
228
|
+
<b>allowTracking</b> (default true)
|
|
229
|
+
<p>
|
|
230
|
+
A boolean to enable tracking. When enabled, the user will be able to input tracking parameters to be added to the asset URL.
|
|
231
|
+
</p>
|
|
232
|
+
</li>
|
|
233
|
+
<li>
|
|
234
|
+
<b>showCollections</b> (default true)
|
|
235
|
+
<p>
|
|
236
|
+
A boolean to show collections in the content browser.
|
|
237
|
+
</p>
|
|
238
|
+
</li>
|
|
239
|
+
<li>
|
|
240
|
+
<b>useSession</b>
|
|
241
|
+
<p>
|
|
242
|
+
The session id to use for the content browser. Try logging out and in whenever you change the sesssion.
|
|
243
|
+
</p>
|
|
244
|
+
</li>
|
|
245
|
+
</ul>
|
|
246
|
+
</div>
|
|
247
|
+
|
|
248
|
+
<script>
|
|
249
|
+
function loadDefaultConfig() {
|
|
250
|
+
const config = {
|
|
251
|
+
onAssetSelected: (assets) => {
|
|
252
|
+
document.getElementById('output').value = JSON.stringify(assets, undefined, 2);
|
|
253
|
+
window.open(assets[0].imageUrl, '_blank');
|
|
254
|
+
},
|
|
255
|
+
onError: (errorMessage, error) => {
|
|
256
|
+
},
|
|
257
|
+
availableDocTypes: ['Images*', 'Videos*', 'Audio*', 'Others*'],
|
|
258
|
+
availableRepresentativeSubtypes: ['Other'],
|
|
259
|
+
// container element to attach, leave blank to open popup
|
|
260
|
+
containerId: 'react-app-root',
|
|
261
|
+
ctaText: 'Open in new tab',
|
|
262
|
+
// extra asset fields to get
|
|
263
|
+
extraFields: ['coreField.OriginalFileName', 'document.CortexPath'],
|
|
264
|
+
// default base url to pre-filled
|
|
265
|
+
baseUrl: 'https://qa-latest.orangelogic.com',
|
|
266
|
+
displayInfo: {
|
|
267
|
+
title: true,
|
|
268
|
+
dimension: true,
|
|
269
|
+
fileSize: false,
|
|
270
|
+
tags: false,
|
|
271
|
+
},
|
|
272
|
+
lastLocationMode: true,
|
|
273
|
+
persistMode: true,
|
|
274
|
+
publicApplicationName: "",
|
|
275
|
+
pluginName: "OrangeDAM Content Browser",
|
|
276
|
+
showCollections: true,
|
|
277
|
+
lastLocationMode: true,
|
|
278
|
+
allowTracking: true,
|
|
279
|
+
useSession: '',
|
|
280
|
+
};
|
|
281
|
+
document.getElementById("content").innerHTML = JSON.stringify(config, function(key, value) {
|
|
282
|
+
if (typeof value === "function") {
|
|
283
|
+
return value.toString().replace(/\n/g, "<br/>");
|
|
284
|
+
}
|
|
285
|
+
return value;
|
|
286
|
+
}, 4).replace(/\n/g, "<br/>");
|
|
287
|
+
}
|
|
288
|
+
function loadConfig() {
|
|
289
|
+
const value = document.getElementById("content").textContent;
|
|
290
|
+
const config = JSON.parse(value.replace(/<br>/g, ""), function(key, value) {
|
|
291
|
+
if (typeof value === "string" && (key === "onAssetSelected" || key === "onError")) {
|
|
292
|
+
return new Function("return " + value)();
|
|
293
|
+
}
|
|
294
|
+
return value;
|
|
295
|
+
});
|
|
296
|
+
OrangeDAMContentBrowser.close();
|
|
297
|
+
OrangeDAMContentBrowser.open(config);
|
|
298
|
+
}
|
|
299
|
+
window.onload = function() {
|
|
300
|
+
loadDefaultConfig();
|
|
301
|
+
|
|
302
|
+
document.getElementById('mobile').addEventListener('change', function() {
|
|
303
|
+
const checked = this.checked;
|
|
304
|
+
const container = document.getElementById('react-app-root');
|
|
305
|
+
if (checked) {
|
|
306
|
+
container.style.maxWidth = '400px';
|
|
307
|
+
} else {
|
|
308
|
+
container.style.maxWidth = 'none';
|
|
309
|
+
}
|
|
310
|
+
});
|
|
311
|
+
};
|
|
312
|
+
</script>
|
|
313
|
+
</body>
|
|
314
|
+
|
|
315
|
+
</html>
|
package/GitVersion.yml
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
mode: Mainline
|
|
2
|
+
assembly-versioning-scheme: MajorMinor
|
|
3
|
+
assembly-file-versioning-scheme: MajorMinorPatchTag
|
|
4
|
+
assembly-informational-format: '{InformationalVersion}'
|
|
5
|
+
branches:
|
|
6
|
+
main:
|
|
7
|
+
tag: ci
|
|
8
|
+
increment: None
|
|
9
|
+
regex: ^master$|^tags/
|
|
10
|
+
feature:
|
|
11
|
+
regex: ^dev/
|
|
12
|
+
hotfix:
|
|
13
|
+
regex: ^fix/
|
|
14
|
+
support:
|
|
15
|
+
regex: ^stable/
|
|
16
|
+
pull-request:
|
|
17
|
+
increment: None
|
|
18
|
+
tag: pr
|
package/README.md
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Introduction
|
|
2
|
+
Orange Logic’s OrangeDAM Content Browser SDK allows authenticated users to browse Orange Logic assets in external web applications. You can use this tool to develop custom integrations between your Orange Logic platform and other software your organization uses.
|
|
3
|
+
|
|
4
|
+
For example, let’s say your organization’s creative team stores images in Orange Logic. However, the marketing team uses a Content Management System (CMS) to build webpages. You can add the OrangeDAM Content Browser SDK to your CMS so users can search, filter, and select assets directly from Orange Logic, and then use them in your CMS.
|
|
5
|
+
|
|
6
|
+
# Getting Started
|
|
7
|
+
|
|
8
|
+
## Installation process
|
|
9
|
+
Install dependencies with
|
|
10
|
+
```
|
|
11
|
+
npm install
|
|
12
|
+
```
|
|
13
|
+
or
|
|
14
|
+
```
|
|
15
|
+
yarn
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Software dependencies
|
|
19
|
+
NodeJS v18 or higher
|
|
20
|
+
|
|
21
|
+
## Latest releases
|
|
22
|
+
Content Browser SDK v2.1.0
|
|
23
|
+
|
|
24
|
+
# Build and Test
|
|
25
|
+
- Run the project with
|
|
26
|
+
```
|
|
27
|
+
yarn start
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
- Build with
|
|
31
|
+
```
|
|
32
|
+
yarn build
|
|
33
|
+
```
|
|
34
|
+
- use the 2 files `build\static\js\ContentBrowserSDK.min.js` and `build\static\css\ContentBrowserSDK.min.css` in your other projects
|
|
35
|
+
|
|
36
|
+
# More guide
|
|
37
|
+
For detail guides on usage check out the [Orange Logic Developer Portal](https://developer.orangelogic.com/docs/generic-asset-browser)
|
|
38
|
+
|
|
39
|
+
# Change Log
|
|
40
|
+
* Apr 8, 2025 - v2.1.0
|
|
41
|
+
* Rename GAB to Content Browser SDK
|
|
42
|
+
* Revamp the Content Browser SDK's entire UI
|
|
43
|
+
* Add a new demo page with more explanations on the invoke function's properties
|
|
44
|
+
* Content Browser SDK now allows you to pick all asset file extensions
|
|
45
|
+
* Add on-the-fly image transformation functionality
|
|
46
|
+
* Add tracking link capabilities
|
|
47
|
+
* More control on the Content Browser's invoke parameters level and Orange DAM administrative level
|
|
48
|
+
* Dec 20, 2024 - v1.2.2
|
|
49
|
+
* Change Orange DAM to OrangeDAM
|
|
50
|
+
* GAB in demo will not pre populate with "https://cortexdemo2.orangelogic.com/" any more
|
|
51
|
+
* Nov 08, 2024 - v1.2.1
|
|
52
|
+
* Resolve CSS conflict with AEM (https://link.orangelogic.com/Tasks/28L9P3)
|
|
53
|
+
* Jul 09, 2024 - v1.2.0
|
|
54
|
+
* Handle encrypted asset thumbnails (https://link.orangelogic.com/Tasks/4152M3)
|
|
55
|
+
* May 29, 2024 - v1.1.0
|
|
56
|
+
* Add the ability to select a proxy in the GAB UI
|
|
57
|
+
* Handle authentication when reopening the GAB
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
trigger:
|
|
2
|
+
tags:
|
|
3
|
+
include:
|
|
4
|
+
- '*.*.*'
|
|
5
|
+
branches:
|
|
6
|
+
include:
|
|
7
|
+
- 'master'
|
|
8
|
+
|
|
9
|
+
resources:
|
|
10
|
+
repositories:
|
|
11
|
+
- repository: infra-templates
|
|
12
|
+
type: git
|
|
13
|
+
name: Infra_Pipelines-templates-dev
|
|
14
|
+
ref: refs/tags/1.0.15
|
|
15
|
+
|
|
16
|
+
- repository: gab-extension
|
|
17
|
+
type: git
|
|
18
|
+
name: GAB_Browser_Extension
|
|
19
|
+
ref: main
|
|
20
|
+
|
|
21
|
+
variables:
|
|
22
|
+
- group: "Global Vars"
|
|
23
|
+
|
|
24
|
+
parameters:
|
|
25
|
+
- name: promoteLatest
|
|
26
|
+
displayName: Enable promoting to latest
|
|
27
|
+
type: boolean
|
|
28
|
+
default: false
|
|
29
|
+
|
|
30
|
+
stages:
|
|
31
|
+
- stage: Build
|
|
32
|
+
dependsOn: []
|
|
33
|
+
jobs:
|
|
34
|
+
- job: BuildPackage
|
|
35
|
+
displayName: 'Build GAB'
|
|
36
|
+
pool:
|
|
37
|
+
name: Azure Pipelines
|
|
38
|
+
steps:
|
|
39
|
+
- checkout: self
|
|
40
|
+
clean: true
|
|
41
|
+
fetchDepth: 0
|
|
42
|
+
path: s
|
|
43
|
+
|
|
44
|
+
- checkout: gab-extension
|
|
45
|
+
clean: true
|
|
46
|
+
fetchDepth: 0
|
|
47
|
+
path: s/gab_extension
|
|
48
|
+
|
|
49
|
+
- template: azure-pipelines/common/steps-printenv.yml@infra-templates
|
|
50
|
+
|
|
51
|
+
- template: azure-pipelines/common/steps-gitversion.yml@infra-templates
|
|
52
|
+
|
|
53
|
+
- template: azure-pipelines/common/npm/steps-node-setup.yml@infra-templates
|
|
54
|
+
parameters:
|
|
55
|
+
versionSpec: 18.x
|
|
56
|
+
|
|
57
|
+
- task: replacetokens@6
|
|
58
|
+
displayName: 'Replace tokens in HTML files'
|
|
59
|
+
inputs:
|
|
60
|
+
sources: |
|
|
61
|
+
**/CBSDKdemo.html
|
|
62
|
+
**/GAB.html
|
|
63
|
+
tokenPattern: 'custom'
|
|
64
|
+
tokenPrefix: '__'
|
|
65
|
+
tokenSuffix: '__'
|
|
66
|
+
additionalVariables: |
|
|
67
|
+
- tag: v$(GitVersion.FullSemVer)
|
|
68
|
+
|
|
69
|
+
- template: azure-pipelines/common/npm/steps-npm-package.yml@infra-templates
|
|
70
|
+
parameters:
|
|
71
|
+
npmEndpoint: 'OL NPM registry'
|
|
72
|
+
isCustomNpmEndpoint: true
|
|
73
|
+
version: '$(GitVersion.FullSemVer)'
|
|
74
|
+
skipBuild: false
|
|
75
|
+
|
|
76
|
+
- template: azure-pipelines/common/steps-s3-publish.yml@infra-templates
|
|
77
|
+
parameters:
|
|
78
|
+
artifacts:
|
|
79
|
+
- sourceFolder: 'build/static/css'
|
|
80
|
+
targetFolder: 'ContentBrowserSDK/v$(GitVersion.FullSemVer)'
|
|
81
|
+
contents: OrangeDAMContentBrowserSDK.min.css
|
|
82
|
+
- sourceFolder: 'build/static/js'
|
|
83
|
+
targetFolder: 'ContentBrowserSDK/v$(GitVersion.FullSemVer)'
|
|
84
|
+
contents: OrangeDAMContentBrowserSDK.min.js
|
|
85
|
+
- sourceFolder: '.'
|
|
86
|
+
targetFolder: 'ContentBrowserSDK/v$(GitVersion.FullSemVer)'
|
|
87
|
+
contents: CBSDKdemo.html
|
|
88
|
+
- ${{ if eq(parameters.promoteLatest, true) }}:
|
|
89
|
+
- sourceFolder: '.'
|
|
90
|
+
targetFolder: 'ContentBrowserSDK/latest'
|
|
91
|
+
contents: CBSDKdemo.html
|
|
92
|
+
- sourceFolder: 'gab_extension'
|
|
93
|
+
targetFolder: 'ContentBrowserSDK/v$(GitVersion.FullSemVer)'
|
|
94
|
+
contents: GAB.html
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration file for aem-clientlib-generator
|
|
3
|
+
*/
|
|
4
|
+
module.exports = {
|
|
5
|
+
// default working directory (can be changed per 'cwd' in every asset option)
|
|
6
|
+
context: __dirname,
|
|
7
|
+
|
|
8
|
+
// path to the clientlib root folder (output)
|
|
9
|
+
clientLibRoot: 'dist',
|
|
10
|
+
|
|
11
|
+
// define all clientlib options here as array... (multiple clientlibs)
|
|
12
|
+
libs: [
|
|
13
|
+
{
|
|
14
|
+
name: 'example',
|
|
15
|
+
assets: {
|
|
16
|
+
js: [
|
|
17
|
+
'src/js/*.js',
|
|
18
|
+
],
|
|
19
|
+
css: [
|
|
20
|
+
'src/css/*.css',
|
|
21
|
+
],
|
|
22
|
+
},
|
|
23
|
+
// Clientlib categories this will register to
|
|
24
|
+
categories: [
|
|
25
|
+
'orangelogic.genericassetbrowser.clientlibs',
|
|
26
|
+
],
|
|
27
|
+
// Prevent Generic Asset Browser from minifying JS bundle with ancient YUI
|
|
28
|
+
jsProcessor: [
|
|
29
|
+
'default:none',
|
|
30
|
+
'min:none',
|
|
31
|
+
],
|
|
32
|
+
// Package format XML for vault or JSON for SLING-INF
|
|
33
|
+
serializationFormat: 'xml',
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
};
|