configuration-management 0.1.6 → 0.1.8

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/README.md CHANGED
@@ -98,8 +98,17 @@ createRoot(document.getElementById('root')).render(
98
98
  )
99
99
  ```
100
100
 
101
- The web UI is **pre-built** in the package (`web/dist/index.js`), so no Parcel
102
- `includeNodeModules` or webpack aliases are required in your host `package.json`.
101
+ The web UI is **pre-built** in the package. Import the JS entry — styles load automatically:
102
+
103
+ ```js
104
+ import { ConfigurationManagementApp, configureWeb } from 'configuration-management/web'
105
+ ```
106
+
107
+ Or import styles separately:
108
+
109
+ ```js
110
+ import 'configuration-management/web/styles.css'
111
+ ```
103
112
 
104
113
  | Export | Description |
105
114
  |--------|-------------|
@@ -117,9 +126,8 @@ OpenWhisk runtime actions and the Commerce Admin extension manifest ship with th
117
126
 
118
127
  #### Automatic wiring on `npm install`
119
128
 
120
- The package runs a **postinstall** script that:
121
-
122
- 1. Patches your project's `app.config.yaml` (if present) with:
129
+ The package runs a **postinstall** script that patches your project's `app.config.yaml`
130
+ (if present) with:
123
131
 
124
132
  ```yaml
125
133
  extensions:
@@ -127,20 +135,8 @@ extensions:
127
135
  $include: node_modules/configuration-management/actions/configurations/ext.config.yaml
128
136
  ```
129
137
 
130
- 2. Scaffolds a minimal `web-src/` bootstrap (if missing or previously auto-generated):
131
-
132
- ```
133
- web-src/
134
- ├── index.html
135
- └── src/
136
- ├── index.js ← imports ConfigurationManagementApp from the package
137
- ├── exc-runtime.js
138
- └── config.json ← created empty; filled by aio app deploy
139
- ```
140
-
141
- Custom `web-src` files are left untouched unless they were created by a prior install
142
- (files containing the `configuration-management: auto-generated bootstrap` marker, or
143
- an older bootstrap that imports `configuration-management/web`).
138
+ It does **not** modify your `web-src/` files. Add the UI to your existing App Builder
139
+ bootstrap manually (see React Admin UI above).
144
140
 
145
141
  - Run `npm install` from your App Builder project root (where `app.config.yaml` lives).
146
142
  - Do not use `npm install --ignore-scripts` (that skips postinstall).
@@ -176,11 +172,10 @@ The bundled `ext.config.yaml` declares all actions under the `ConfigurationManag
176
172
 
177
173
  ```
178
174
  my-app/
179
- ├── app.config.yaml ← $include ext.config from node_modules (above)
175
+ ├── app.config.yaml ← $include ext.config (auto-patched on npm install)
180
176
  ├── web-src/
181
- │ ├── index.html
182
177
  │ └── src/
183
- │ ├── index.js ← import ConfigurationManagementApp + configureWeb
178
+ │ ├── index.js ← your app bootstrap + package imports (see above)
184
179
  │ └── config.json ← generated by aio app deploy
185
180
  ├── .env
186
181
  └── package.json ← depends on configuration-management
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "configuration-management",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
4
4
  "description": "Schema-driven system configuration for Adobe Commerce App Builder sync apps. Magento-style scoped config in Adobe App Builder Database (ABDB) with encryption, Commerce REST helpers, and React Admin UI.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Adobe Inc.",
@@ -30,9 +30,10 @@
30
30
  "./crypto": "./src/system-config-crypto.js",
31
31
  "./shared": "./src/system-config-shared.js",
32
32
  "./oauth1a": "./src/oauth1a.js",
33
- "./web": "./web/dist/index.js",
34
- "./web/index.js": "./web/dist/index.js",
35
- "./web/styles.css": "./web/src/styles/index.css",
33
+ "./web": "./web/index.js",
34
+ "./web/index.js": "./web/index.js",
35
+ "./web/styles.css": "./web/styles.css",
36
+ "./web/dist/index.css": "./web/dist/index.css",
36
37
  "./web/src/styles/index.css": "./web/src/styles/index.css",
37
38
  "./actions/utils": "./actions/utils.js",
38
39
  "./actions/ext.config.yaml": "./actions/configurations/ext.config.yaml"
@@ -20,6 +20,8 @@ async function main () {
20
20
  const entry = path.join(pkgRoot, 'web/src/index.js')
21
21
  const outdir = path.join(pkgRoot, 'web/dist')
22
22
  const outfile = path.join(outdir, 'index.js')
23
+ const stylesSrc = path.join(pkgRoot, 'web/src/styles/index.css')
24
+ const stylesFlat = path.join(pkgRoot, 'web/styles.css')
23
25
 
24
26
  fs.mkdirSync(outdir, { recursive: true })
25
27
 
@@ -31,12 +33,19 @@ async function main () {
31
33
  outfile,
32
34
  packages: 'external',
33
35
  jsx: 'automatic',
34
- loader: { '.js': 'jsx' },
36
+ loader: { '.js': 'jsx', '.css': 'css' },
35
37
  target: ['chrome79', 'firefox85', 'safari13'],
36
38
  logLevel: 'info'
37
39
  })
38
40
 
41
+ // Parcel does not resolve nested @import inside node_modules — ship a flat file.
42
+ fs.copyFileSync(stylesSrc, stylesFlat)
43
+
39
44
  console.log('[configuration-management] built web/dist/index.js')
45
+ if (fs.existsSync(path.join(outdir, 'index.css'))) {
46
+ console.log('[configuration-management] built web/dist/index.css')
47
+ }
48
+ console.log('[configuration-management] copied web/styles.css')
40
49
  }
41
50
 
42
51
  if (require.main === module) {
package/scripts/setup.js CHANGED
@@ -10,9 +10,6 @@ const path = require('path')
10
10
  const EXTENSION_POINT = 'commerce/backend-ui/1'
11
11
  const INCLUDE_REL = 'node_modules/configuration-management/actions/configurations/ext.config.yaml'
12
12
  const MARKER = '# configuration-management (auto-linked on npm install)'
13
- const WEB_BOOTSTRAP_MARKER = 'configuration-management: auto-generated bootstrap'
14
-
15
- const TEMPLATES_DIR = path.join(__dirname, 'templates')
16
13
 
17
14
  function escapeRe (str) {
18
15
  return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
@@ -21,10 +18,7 @@ function escapeRe (str) {
21
18
  function findProjectRoot (startDir) {
22
19
  let dir = startDir
23
20
  while (dir && dir !== path.dirname(dir)) {
24
- if (
25
- fs.existsSync(path.join(dir, 'app.config.yaml')) ||
26
- fs.existsSync(path.join(dir, 'web-src'))
27
- ) {
21
+ if (fs.existsSync(path.join(dir, 'app.config.yaml'))) {
28
22
  return dir
29
23
  }
30
24
  dir = path.dirname(dir)
@@ -41,57 +35,6 @@ function resolveProjectRoot () {
41
35
  return findProjectRoot(process.cwd())
42
36
  }
43
37
 
44
- function readTemplate (name) {
45
- return fs.readFileSync(path.join(TEMPLATES_DIR, name), 'utf8')
46
- }
47
-
48
- function writeIfMissingOrManaged (filePath, content, marker) {
49
- if (fs.existsSync(filePath)) {
50
- const existing = fs.readFileSync(filePath, 'utf8')
51
- if (existing.includes(marker)) {
52
- const dir = path.dirname(filePath)
53
- fs.mkdirSync(dir, { recursive: true })
54
- const changed = existing !== content
55
- if (changed) {
56
- fs.writeFileSync(filePath, content, 'utf8')
57
- }
58
- return { changed, reason: changed ? 'updated-managed' : 'unchanged-managed', path: filePath }
59
- }
60
- return { changed: false, reason: 'skipped-custom-file', path: filePath }
61
- }
62
- const dir = path.dirname(filePath)
63
- fs.mkdirSync(dir, { recursive: true })
64
- fs.writeFileSync(filePath, content, 'utf8')
65
- return { changed: true, reason: 'written', path: filePath }
66
- }
67
-
68
- function writeWebSrcIndex (projectRoot) {
69
- const filePath = path.join(projectRoot, 'web-src', 'src', 'index.js')
70
- const content = readTemplate('web-src-index.js')
71
-
72
- if (!fs.existsSync(filePath)) {
73
- fs.mkdirSync(path.dirname(filePath), { recursive: true })
74
- fs.writeFileSync(filePath, content, 'utf8')
75
- return { changed: true, reason: 'written', path: filePath }
76
- }
77
-
78
- const existing = fs.readFileSync(filePath, 'utf8')
79
- if (existing.includes(WEB_BOOTSTRAP_MARKER)) {
80
- const changed = existing !== content
81
- if (changed) {
82
- fs.writeFileSync(filePath, content, 'utf8')
83
- }
84
- return { changed, reason: changed ? 'updated-managed' : 'unchanged-managed', path: filePath }
85
- }
86
-
87
- if (existing.includes('configuration-management/web')) {
88
- fs.writeFileSync(filePath, content, 'utf8')
89
- return { changed: true, reason: 'migrated-stale-bootstrap', path: filePath }
90
- }
91
-
92
- return { changed: false, reason: 'skipped-custom-file', path: filePath }
93
- }
94
-
95
38
  function alreadyLinked (content) {
96
39
  return content.includes('configuration-management/actions/configurations/ext.config.yaml')
97
40
  }
@@ -176,38 +119,6 @@ function setupAppConfig (projectRoot) {
176
119
  return { changed: true, reason, detail: INCLUDE_REL }
177
120
  }
178
121
 
179
- function setupWebSrc (projectRoot) {
180
- const webSrcDir = path.join(projectRoot, 'web-src')
181
- const results = []
182
-
183
- const indexJs = writeWebSrcIndex(projectRoot)
184
- results.push(indexJs)
185
-
186
- const indexHtml = writeIfMissingOrManaged(
187
- path.join(webSrcDir, 'index.html'),
188
- readTemplate('web-src-index.html'),
189
- 'configuration-management'
190
- )
191
- results.push(indexHtml)
192
-
193
- const excRuntime = writeIfMissingOrManaged(
194
- path.join(webSrcDir, 'src', 'exc-runtime.js'),
195
- readTemplate('exc-runtime.js'),
196
- 'Module Runtime: Needs to be within an iframe'
197
- )
198
- results.push(excRuntime)
199
-
200
- const configPath = path.join(webSrcDir, 'src', 'config.json')
201
- if (!fs.existsSync(configPath)) {
202
- fs.mkdirSync(path.dirname(configPath), { recursive: true })
203
- fs.writeFileSync(configPath, '{}\n', 'utf8')
204
- results.push({ changed: true, reason: 'created-config-json', path: configPath })
205
- }
206
-
207
- const changed = results.some((r) => r.changed)
208
- return { changed, results }
209
- }
210
-
211
122
  function main () {
212
123
  if (process.env.CONFIGURATION_MANAGEMENT_SKIP_SETUP === '1') {
213
124
  return
@@ -228,18 +139,10 @@ function main () {
228
139
  `[configuration-management] Updated app.config.yaml (${app.reason}):\n` +
229
140
  ` $include: ${app.detail}`
230
141
  )
142
+ return
231
143
  }
232
144
 
233
- const web = setupWebSrc(projectRoot)
234
- for (const r of web.results || []) {
235
- if (r.changed) {
236
- console.log(`[configuration-management] Wrote ${r.path}`)
237
- }
238
- }
239
-
240
- if (!app.changed && !web.changed) {
241
- console.log('[configuration-management] Project already configured.')
242
- }
145
+ console.log('[configuration-management] app.config.yaml already configured.')
243
146
  }
244
147
 
245
148
  if (require.main === module) {
@@ -254,7 +157,6 @@ if (require.main === module) {
254
157
  module.exports = {
255
158
  patchAppConfig,
256
159
  setupAppConfig,
257
- setupWebSrc,
258
160
  INCLUDE_REL,
259
161
  EXTENSION_POINT
260
162
  }
@@ -0,0 +1,294 @@
1
+ /* web/src/styles/index.css */
2
+ :root {
3
+ --sm-color-bg: #f7f8fa;
4
+ --sm-color-surface: #ffffff;
5
+ --sm-color-surface-muted: #f3f4f6;
6
+ --sm-color-surface-subtle: #fafbfc;
7
+ --sm-color-border: #e5e7eb;
8
+ --sm-color-border-strong: #d1d5db;
9
+ --sm-color-text: #111827;
10
+ --sm-color-text-muted: #6b7280;
11
+ --sm-color-text-inverse: #ffffff;
12
+ --sm-color-accent: #1473e6;
13
+ --sm-color-accent-hover: #0f5fc4;
14
+ --sm-color-accent-soft: #e8f1fc;
15
+ --sm-color-success: #22863a;
16
+ --sm-color-success-hover: #1a6e2f;
17
+ --sm-color-success-soft: #ecfdf5;
18
+ --sm-color-warning: #b58105;
19
+ --sm-color-warning-hover: #946c04;
20
+ --sm-color-warning-soft: #fff7ed;
21
+ --sm-color-warning-border: #fde68a;
22
+ --sm-color-warning-text: #92400e;
23
+ --sm-color-warning-tint: #fef3c7;
24
+ --sm-color-danger: #c0392b;
25
+ --sm-color-danger-hover: #a32d20;
26
+ --sm-color-danger-soft: #fef2f2;
27
+ --sm-color-danger-tint: #fee2e2;
28
+ --sm-color-accent-tint: #dbeafe;
29
+ --sm-color-neutral-soft: #eef2f7;
30
+ --sm-color-neutral-text: #374151;
31
+ --sm-color-text-strong: #1f2937;
32
+ --sm-color-text-soft: #475569;
33
+ --sm-color-surface-panel: #f9fafb;
34
+ --sm-color-overlay: rgba(15, 23, 42, 0.45);
35
+ --sm-radius-sm: 4px;
36
+ --sm-radius-md: 8px;
37
+ --sm-radius-lg: 10px;
38
+ --sm-radius-xl: 12px;
39
+ --sm-radius-2xl: 14px;
40
+ --sm-radius-pill: 999px;
41
+ --sm-space-1: 4px;
42
+ --sm-space-2: 8px;
43
+ --sm-space-3: 12px;
44
+ --sm-space-4: 16px;
45
+ --sm-space-5: 20px;
46
+ --sm-space-6: 24px;
47
+ --sm-shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.03);
48
+ --sm-shadow-sm: 0 1px 4px rgba(15, 23, 42, 0.04);
49
+ --sm-shadow-md: 0 1px 3px rgba(15, 23, 42, 0.12), 0 1px 1px rgba(15, 23, 42, 0.06);
50
+ --sm-shadow-pill: 0 1px 3px rgba(15, 23, 42, 0.10), 0 1px 1px rgba(15, 23, 42, 0.06);
51
+ --sm-shadow-floating: 0 4px 14px rgba(15, 23, 42, 0.08);
52
+ --sm-shadow-dropdown: 0 12px 28px rgba(15, 23, 42, 0.16), 0 2px 4px rgba(15, 23, 42, 0.06);
53
+ --sm-shadow-modal: 0 24px 60px rgba(15, 23, 42, 0.25), 0 2px 8px rgba(15, 23, 42, 0.08);
54
+ --sm-shadow-inset: inset 0 1px 2px rgba(15, 23, 42, 0.04);
55
+ --sm-font-family:
56
+ adobe-clean,
57
+ "Source Sans Pro",
58
+ -apple-system,
59
+ BlinkMacSystemFont,
60
+ "Segoe UI",
61
+ Roboto,
62
+ sans-serif;
63
+ --sm-font-mono:
64
+ ui-monospace,
65
+ SFMono-Regular,
66
+ Menlo,
67
+ Consolas,
68
+ monospace;
69
+ --sm-font-size-xs: 11px;
70
+ --sm-font-size-sm: 12px;
71
+ --sm-font-size-md: 13px;
72
+ --sm-font-size-lg: 14px;
73
+ --sm-font-weight-regular: 400;
74
+ --sm-font-weight-medium: 500;
75
+ --sm-font-weight-semibold:600;
76
+ --sm-font-weight-bold: 700;
77
+ --sm-control-height-sm: 28px;
78
+ --sm-control-height-md: 32px;
79
+ --sm-control-height-lg: 40px;
80
+ --sm-control-padding-x: 16px;
81
+ --sm-z-nav: 30;
82
+ --sm-z-sticky: 20;
83
+ --sm-z-modal: 100;
84
+ --spectrum-accent-color-900: var(--sm-color-accent);
85
+ --spectrum-accent-color-1000: var(--sm-color-accent-hover);
86
+ color-scheme: light;
87
+ }
88
+ html,
89
+ body,
90
+ #root {
91
+ margin: 0;
92
+ min-height: 100%;
93
+ background: var(--sm-color-bg);
94
+ color: var(--sm-color-text);
95
+ font-family: var(--sm-font-family);
96
+ }
97
+ .sm-provider {
98
+ background: var(--sm-color-bg);
99
+ min-height: 100vh;
100
+ }
101
+ .sm-card {
102
+ background: var(--sm-color-surface);
103
+ border: 1px solid var(--sm-color-border);
104
+ border-radius: var(--sm-radius-lg);
105
+ box-shadow: var(--sm-shadow-xs);
106
+ padding: var(--sm-space-5);
107
+ }
108
+ .sm-card--flush {
109
+ padding: 0;
110
+ }
111
+ .sm-pill {
112
+ display: inline-flex;
113
+ align-items: center;
114
+ gap: var(--sm-space-1);
115
+ padding: 2px var(--sm-space-2);
116
+ border-radius: var(--sm-radius-pill);
117
+ background: var(--sm-color-neutral-soft);
118
+ color: var(--sm-color-neutral-text);
119
+ font-size: var(--sm-font-size-xs);
120
+ font-weight: var(--sm-font-weight-semibold);
121
+ line-height: 16px;
122
+ letter-spacing: 0.2px;
123
+ white-space: nowrap;
124
+ }
125
+ .sm-pill--accent {
126
+ background: var(--sm-color-accent-soft);
127
+ color: var(--sm-color-accent);
128
+ }
129
+ .sm-pill--success {
130
+ background: var(--sm-color-success-soft);
131
+ color: var(--sm-color-success);
132
+ }
133
+ .sm-pill--warning {
134
+ background: var(--sm-color-warning-soft);
135
+ color: var(--sm-color-warning);
136
+ }
137
+ .sm-pill--danger {
138
+ background: var(--sm-color-danger-soft);
139
+ color: var(--sm-color-danger);
140
+ }
141
+ .sm-tab-bar {
142
+ position: sticky;
143
+ top: 0;
144
+ z-index: var(--sm-z-nav);
145
+ background: var(--sm-color-surface);
146
+ border-bottom: 1px solid var(--sm-color-border);
147
+ padding: 10px var(--sm-space-4);
148
+ box-shadow: var(--sm-shadow-sm);
149
+ box-sizing: border-box;
150
+ max-width: 100%;
151
+ }
152
+ .sm-tab-bar__track {
153
+ display: inline-flex;
154
+ padding: var(--sm-space-1);
155
+ background: var(--sm-color-surface-muted);
156
+ border: 1px solid var(--sm-color-border);
157
+ border-radius: var(--sm-radius-pill);
158
+ box-shadow: var(--sm-shadow-inset);
159
+ gap: 2px;
160
+ font-family: var(--sm-font-family);
161
+ }
162
+ .sm-tab {
163
+ display: inline-flex;
164
+ align-items: center;
165
+ gap: var(--sm-space-2);
166
+ padding: var(--sm-space-2) var(--sm-control-padding-x);
167
+ border: 0;
168
+ border-radius: var(--sm-radius-pill);
169
+ background: transparent;
170
+ color: var(--sm-color-neutral-text);
171
+ font-size: var(--sm-font-size-md);
172
+ font-weight: var(--sm-font-weight-semibold);
173
+ letter-spacing: 0.1px;
174
+ cursor: pointer;
175
+ transition:
176
+ background 140ms ease,
177
+ color 140ms ease,
178
+ box-shadow 140ms ease;
179
+ }
180
+ .sm-tab:hover {
181
+ background: var(--sm-color-surface);
182
+ color: var(--sm-color-text);
183
+ }
184
+ .sm-tab.is-active {
185
+ background: var(--sm-color-surface);
186
+ color: var(--sm-color-accent);
187
+ font-weight: var(--sm-font-weight-bold);
188
+ box-shadow: var(--sm-shadow-pill);
189
+ cursor: default;
190
+ }
191
+ .sm-tab__icon {
192
+ display: inline-flex;
193
+ opacity: 0.75;
194
+ }
195
+ .sm-tab.is-active .sm-tab__icon {
196
+ opacity: 1;
197
+ }
198
+ .sm-textarea textarea {
199
+ height: 160px !important;
200
+ max-height: 160px !important;
201
+ min-height: 160px !important;
202
+ overflow-y: auto !important;
203
+ resize: none !important;
204
+ font-family: var(--sm-font-mono);
205
+ font-size: var(--sm-font-size-sm);
206
+ }
207
+ .sm-note {
208
+ margin-top: var(--sm-space-3);
209
+ padding: var(--sm-space-3);
210
+ border-radius: var(--sm-radius-md);
211
+ background: var(--sm-color-surface-muted);
212
+ border: 1px solid var(--sm-color-border);
213
+ color: var(--sm-color-text);
214
+ font-size: var(--sm-font-size-md);
215
+ white-space: pre-line;
216
+ font-family: var(--sm-font-mono);
217
+ }
218
+ .sm-note--warning {
219
+ background: var(--sm-color-warning-soft);
220
+ border-color: var(--sm-color-warning-border);
221
+ color: var(--sm-color-warning-text);
222
+ font-family: var(--sm-font-family);
223
+ }
224
+ @keyframes sm-pulse {
225
+ 0%, 100% {
226
+ opacity: 1;
227
+ }
228
+ 50% {
229
+ opacity: 0.3;
230
+ }
231
+ }
232
+ @keyframes sm-indeterminate {
233
+ 0% {
234
+ left: -40%;
235
+ width: 40%;
236
+ }
237
+ 50% {
238
+ left: 30%;
239
+ width: 40%;
240
+ }
241
+ 100% {
242
+ left: 100%;
243
+ width: 40%;
244
+ }
245
+ }
246
+ @keyframes sm-fade-in {
247
+ from {
248
+ opacity: 0;
249
+ }
250
+ to {
251
+ opacity: 1;
252
+ }
253
+ }
254
+ @keyframes sm-pop-in {
255
+ from {
256
+ opacity: 0;
257
+ transform: translateY(8px) scale(0.98);
258
+ }
259
+ to {
260
+ opacity: 1;
261
+ transform: translateY(0) scale(1);
262
+ }
263
+ }
264
+ .SideNav {
265
+ list-style-type: none;
266
+ margin: 0;
267
+ padding: 0;
268
+ outline: none;
269
+ height: 100%;
270
+ }
271
+ .SideNav-item {
272
+ list-style-type: none;
273
+ margin: var(--spectrum-global-dimension-size-50) 0;
274
+ }
275
+ .SideNav-itemLink {
276
+ position: relative;
277
+ display: inline-flex;
278
+ align-items: center;
279
+ box-sizing: border-box;
280
+ width: 100%;
281
+ padding: var(--sm-space-2) var(--sm-space-3);
282
+ border-radius: var(--sm-radius-sm);
283
+ font-size: var(--sm-font-size-lg);
284
+ font-weight: var(--sm-font-weight-regular);
285
+ text-decoration: none;
286
+ word-break: break-word;
287
+ cursor: pointer;
288
+ background: transparent;
289
+ color: var(--sm-color-text);
290
+ }
291
+ .SideNav-itemLink.is-selected {
292
+ color: var(--sm-color-accent);
293
+ background: var(--sm-color-accent-soft);
294
+ }
package/web/index.js CHANGED
@@ -3,4 +3,5 @@ Copyright 2025 Adobe. All rights reserved.
3
3
  Licensed under the Apache License, Version 2.0
4
4
  */
5
5
 
6
+ import './dist/index.css'
6
7
  export * from './dist/index.js'
package/web/src/index.js CHANGED
@@ -5,6 +5,8 @@ you may not use this file except in compliance with the License. You may obtain
5
5
  of the License at http://www.apache.org/licenses/LICENSE-2.0
6
6
  */
7
7
 
8
+ import './styles/index.css'
9
+
8
10
  import App from './components/App'
9
11
  import { MainPage } from './components/MainPage'
10
12
  import ExtensionRegistration from './components/ExtensionRegistration'
package/web/styles.css ADDED
@@ -0,0 +1,326 @@
1
+ /*
2
+ Copyright 2025 Adobe. All rights reserved.
3
+ This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License. You may obtain a copy
5
+ of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ */
7
+
8
+ /* =========================================================================
9
+ sync-management — single source of truth for the UI theme.
10
+
11
+ To re-skin the app, change values under :root. Components consume these
12
+ tokens either directly via CSS classes (.sm-*) or via the JS facade in
13
+ `web-src/src/theme.js` which re-exports them as `var(--sm-*)` strings.
14
+
15
+ Token naming:
16
+ --sm-color-* colors
17
+ --sm-radius-* border radii
18
+ --sm-space-* spacing scale
19
+ --sm-shadow-* elevation
20
+ --sm-font-* typography
21
+ --sm-control-* interactive control sizing
22
+ ========================================================================= */
23
+
24
+ :root {
25
+ /* ---- Colors --------------------------------------------------------- */
26
+ --sm-color-bg: #f7f8fa;
27
+ --sm-color-surface: #ffffff;
28
+ --sm-color-surface-muted: #f3f4f6;
29
+ --sm-color-surface-subtle: #fafbfc;
30
+ --sm-color-border: #e5e7eb;
31
+ --sm-color-border-strong: #d1d5db;
32
+ --sm-color-text: #111827;
33
+ --sm-color-text-muted: #6b7280;
34
+ --sm-color-text-inverse: #ffffff;
35
+
36
+ --sm-color-accent: #1473e6;
37
+ --sm-color-accent-hover: #0f5fc4;
38
+ --sm-color-accent-soft: #e8f1fc;
39
+
40
+ --sm-color-success: #22863a;
41
+ --sm-color-success-hover: #1a6e2f;
42
+ --sm-color-success-soft: #ecfdf5;
43
+ --sm-color-warning: #b58105;
44
+ --sm-color-warning-hover: #946c04;
45
+ --sm-color-warning-soft: #fff7ed;
46
+ --sm-color-warning-border: #fde68a;
47
+ --sm-color-warning-text: #92400e;
48
+ --sm-color-warning-tint: #fef3c7;
49
+ --sm-color-danger: #c0392b;
50
+ --sm-color-danger-hover: #a32d20;
51
+ --sm-color-danger-soft: #fef2f2;
52
+ --sm-color-danger-tint: #fee2e2;
53
+ --sm-color-accent-tint: #dbeafe;
54
+
55
+ --sm-color-neutral-soft: #eef2f7;
56
+ --sm-color-neutral-text: #374151;
57
+
58
+ /* Surfaces used by the modal scaffolding (header text, body text, panel). */
59
+ --sm-color-text-strong: #1f2937;
60
+ --sm-color-text-soft: #475569;
61
+ --sm-color-surface-panel: #f9fafb;
62
+
63
+ /* Modal / overlay scrim */
64
+ --sm-color-overlay: rgba(15, 23, 42, 0.45);
65
+
66
+ /* ---- Radii ---------------------------------------------------------- */
67
+ --sm-radius-sm: 4px;
68
+ --sm-radius-md: 8px;
69
+ --sm-radius-lg: 10px;
70
+ --sm-radius-xl: 12px;
71
+ --sm-radius-2xl: 14px;
72
+ --sm-radius-pill: 999px;
73
+
74
+ /* ---- Spacing -------------------------------------------------------- */
75
+ --sm-space-1: 4px;
76
+ --sm-space-2: 8px;
77
+ --sm-space-3: 12px;
78
+ --sm-space-4: 16px;
79
+ --sm-space-5: 20px;
80
+ --sm-space-6: 24px;
81
+
82
+ /* ---- Shadows -------------------------------------------------------- */
83
+ --sm-shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.03);
84
+ --sm-shadow-sm: 0 1px 4px rgba(15, 23, 42, 0.04);
85
+ --sm-shadow-md: 0 1px 3px rgba(15, 23, 42, 0.12), 0 1px 1px rgba(15, 23, 42, 0.06);
86
+ --sm-shadow-pill: 0 1px 3px rgba(15, 23, 42, 0.10), 0 1px 1px rgba(15, 23, 42, 0.06);
87
+ --sm-shadow-floating: 0 4px 14px rgba(15, 23, 42, 0.08);
88
+ --sm-shadow-dropdown: 0 12px 28px rgba(15, 23, 42, 0.16), 0 2px 4px rgba(15, 23, 42, 0.06);
89
+ --sm-shadow-modal: 0 24px 60px rgba(15, 23, 42, 0.25), 0 2px 8px rgba(15, 23, 42, 0.08);
90
+ --sm-shadow-inset: inset 0 1px 2px rgba(15, 23, 42, 0.04);
91
+
92
+ /* ---- Typography ----------------------------------------------------- */
93
+ --sm-font-family: adobe-clean, 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
94
+ --sm-font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
95
+ --sm-font-size-xs: 11px;
96
+ --sm-font-size-sm: 12px;
97
+ --sm-font-size-md: 13px;
98
+ --sm-font-size-lg: 14px;
99
+ --sm-font-weight-regular: 400;
100
+ --sm-font-weight-medium: 500;
101
+ --sm-font-weight-semibold:600;
102
+ --sm-font-weight-bold: 700;
103
+
104
+ /* ---- Control sizing ------------------------------------------------- */
105
+ --sm-control-height-sm: 28px;
106
+ --sm-control-height-md: 32px;
107
+ --sm-control-height-lg: 40px;
108
+ --sm-control-padding-x: 16px;
109
+
110
+ /* ---- Z-index -------------------------------------------------------- */
111
+ --sm-z-nav: 30;
112
+ --sm-z-sticky: 20;
113
+ --sm-z-modal: 100;
114
+
115
+ /* =====================================================================
116
+ Spectrum token overrides — re-skin React-Spectrum widgets without
117
+ forking the theme. Keep these in sync with the --sm-* tokens above
118
+ so default Buttons / TextField / Picker pick up our accent automatically.
119
+ ===================================================================== */
120
+ --spectrum-accent-color-900: var(--sm-color-accent);
121
+ --spectrum-accent-color-1000: var(--sm-color-accent-hover);
122
+ /* Text colours are left to Spectrum so secondary/quiet buttons keep
123
+ their proper contrast on both light and dark surfaces. */
124
+
125
+ color-scheme: light;
126
+ }
127
+
128
+ /* =========================================================================
129
+ Base
130
+ ========================================================================= */
131
+ html,
132
+ body,
133
+ #root {
134
+ margin: 0;
135
+ min-height: 100%;
136
+ background: var(--sm-color-bg);
137
+ color: var(--sm-color-text);
138
+ font-family: var(--sm-font-family);
139
+ }
140
+
141
+ /* React-Spectrum's <Provider> wraps its tree in a div. We mark it with
142
+ `UNSAFE_className="sm-provider"` and set its background here so the page
143
+ bg fills the whole iframe — but we only paint the wrapper, NOT any
144
+ descendants. Painting descendants stomps on inputs / buttons / pickers. */
145
+ .sm-provider {
146
+ background: var(--sm-color-bg);
147
+ min-height: 100vh;
148
+ }
149
+
150
+ /* =========================================================================
151
+ Cards
152
+ ========================================================================= */
153
+ .sm-card {
154
+ background: var(--sm-color-surface);
155
+ border: 1px solid var(--sm-color-border);
156
+ border-radius: var(--sm-radius-lg);
157
+ box-shadow: var(--sm-shadow-xs);
158
+ padding: var(--sm-space-5);
159
+ }
160
+ .sm-card--flush { padding: 0; }
161
+
162
+ /* =========================================================================
163
+ Pills
164
+ ========================================================================= */
165
+ .sm-pill {
166
+ display: inline-flex;
167
+ align-items: center;
168
+ gap: var(--sm-space-1);
169
+ padding: 2px var(--sm-space-2);
170
+ border-radius: var(--sm-radius-pill);
171
+ background: var(--sm-color-neutral-soft);
172
+ color: var(--sm-color-neutral-text);
173
+ font-size: var(--sm-font-size-xs);
174
+ font-weight: var(--sm-font-weight-semibold);
175
+ line-height: 16px;
176
+ letter-spacing: 0.2px;
177
+ white-space: nowrap;
178
+ }
179
+ .sm-pill--accent { background: var(--sm-color-accent-soft); color: var(--sm-color-accent); }
180
+ .sm-pill--success { background: var(--sm-color-success-soft); color: var(--sm-color-success); }
181
+ .sm-pill--warning { background: var(--sm-color-warning-soft); color: var(--sm-color-warning); }
182
+ .sm-pill--danger { background: var(--sm-color-danger-soft); color: var(--sm-color-danger); }
183
+
184
+ /* =========================================================================
185
+ Tab bar (used by AppSectionNav)
186
+ ========================================================================= */
187
+ .sm-tab-bar {
188
+ position: sticky;
189
+ top: 0;
190
+ z-index: var(--sm-z-nav);
191
+ background: var(--sm-color-surface);
192
+ border-bottom: 1px solid var(--sm-color-border);
193
+ padding: 10px var(--sm-space-4);
194
+ box-shadow: var(--sm-shadow-sm);
195
+ box-sizing: border-box;
196
+ max-width: 100%;
197
+ }
198
+ .sm-tab-bar__track {
199
+ display: inline-flex;
200
+ padding: var(--sm-space-1);
201
+ background: var(--sm-color-surface-muted);
202
+ border: 1px solid var(--sm-color-border);
203
+ border-radius: var(--sm-radius-pill);
204
+ box-shadow: var(--sm-shadow-inset);
205
+ gap: 2px;
206
+ font-family: var(--sm-font-family);
207
+ }
208
+ .sm-tab {
209
+ display: inline-flex;
210
+ align-items: center;
211
+ gap: var(--sm-space-2);
212
+ padding: var(--sm-space-2) var(--sm-control-padding-x);
213
+ border: 0;
214
+ border-radius: var(--sm-radius-pill);
215
+ background: transparent;
216
+ color: var(--sm-color-neutral-text);
217
+ font-size: var(--sm-font-size-md);
218
+ font-weight: var(--sm-font-weight-semibold);
219
+ letter-spacing: 0.1px;
220
+ cursor: pointer;
221
+ transition: background 140ms ease, color 140ms ease, box-shadow 140ms ease;
222
+ }
223
+ .sm-tab:hover {
224
+ background: var(--sm-color-surface);
225
+ color: var(--sm-color-text);
226
+ }
227
+ .sm-tab.is-active {
228
+ background: var(--sm-color-surface);
229
+ color: var(--sm-color-accent);
230
+ font-weight: var(--sm-font-weight-bold);
231
+ box-shadow: var(--sm-shadow-pill);
232
+ cursor: default;
233
+ }
234
+ .sm-tab__icon { display: inline-flex; opacity: 0.75; }
235
+ .sm-tab.is-active .sm-tab__icon { opacity: 1; }
236
+
237
+ /* =========================================================================
238
+ Spectrum textareas inside the system-config field renderer
239
+ ========================================================================= */
240
+ .sm-textarea textarea {
241
+ height: 160px !important;
242
+ max-height: 160px !important;
243
+ min-height: 160px !important;
244
+ overflow-y: auto !important;
245
+ resize: none !important;
246
+ font-family: var(--sm-font-mono);
247
+ font-size: var(--sm-font-size-sm);
248
+ }
249
+
250
+ /* =========================================================================
251
+ Note banner (used by ComingSoon, info callouts, etc.)
252
+ ========================================================================= */
253
+ .sm-note {
254
+ margin-top: var(--sm-space-3);
255
+ padding: var(--sm-space-3);
256
+ border-radius: var(--sm-radius-md);
257
+ background: var(--sm-color-surface-muted);
258
+ border: 1px solid var(--sm-color-border);
259
+ color: var(--sm-color-text);
260
+ font-size: var(--sm-font-size-md);
261
+ white-space: pre-line;
262
+ font-family: var(--sm-font-mono);
263
+ }
264
+ .sm-note--warning {
265
+ background: var(--sm-color-warning-soft);
266
+ border-color: var(--sm-color-warning-border);
267
+ color: var(--sm-color-warning-text);
268
+ font-family: var(--sm-font-family);
269
+ }
270
+
271
+ /* =========================================================================
272
+ Animations (used by progress / status indicators)
273
+ ========================================================================= */
274
+ @keyframes sm-pulse {
275
+ 0%, 100% { opacity: 1; }
276
+ 50% { opacity: 0.3; }
277
+ }
278
+ @keyframes sm-indeterminate {
279
+ 0% { left: -40%; width: 40%; }
280
+ 50% { left: 30%; width: 40%; }
281
+ 100% { left: 100%; width: 40%; }
282
+ }
283
+ @keyframes sm-fade-in {
284
+ from { opacity: 0; }
285
+ to { opacity: 1; }
286
+ }
287
+ @keyframes sm-pop-in {
288
+ from { opacity: 0; transform: translateY(8px) scale(0.98); }
289
+ to { opacity: 1; transform: translateY(0) scale(1); }
290
+ }
291
+
292
+ /* =========================================================================
293
+ Legacy SideNav classes (kept for backwards compat with any remaining
294
+ menu markup; safe to delete once nothing references them).
295
+ ========================================================================= */
296
+ .SideNav {
297
+ list-style-type: none;
298
+ margin: 0;
299
+ padding: 0;
300
+ outline: none;
301
+ height: 100%;
302
+ }
303
+ .SideNav-item {
304
+ list-style-type: none;
305
+ margin: var(--spectrum-global-dimension-size-50) 0;
306
+ }
307
+ .SideNav-itemLink {
308
+ position: relative;
309
+ display: inline-flex;
310
+ align-items: center;
311
+ box-sizing: border-box;
312
+ width: 100%;
313
+ padding: var(--sm-space-2) var(--sm-space-3);
314
+ border-radius: var(--sm-radius-sm);
315
+ font-size: var(--sm-font-size-lg);
316
+ font-weight: var(--sm-font-weight-regular);
317
+ text-decoration: none;
318
+ word-break: break-word;
319
+ cursor: pointer;
320
+ background: transparent;
321
+ color: var(--sm-color-text);
322
+ }
323
+ .SideNav-itemLink.is-selected {
324
+ color: var(--sm-color-accent);
325
+ background: var(--sm-color-accent-soft);
326
+ }
@@ -1,14 +0,0 @@
1
- /*
2
- Copyright 2025 Adobe. All rights reserved.
3
- This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
- you may not use this file except in compliance with the License. You may obtain a copy
5
- of the License at http://www.apache.org/licenses/LICENSE-2.0
6
-
7
- Unless required by applicable law or agreed to in writing, software distributed under
8
- the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
- OF ANY KIND, either express or implied. See the License for the specific language
10
- governing permissions and limitations under the License.
11
- */
12
-
13
- /* eslint-disable-next-line */
14
- (function(e,t){if(t.location===t.parent.location)throw new Error("Module Runtime: Needs to be within an iframe!");var o=function(e){var t=new URL(e.location.href).searchParams.get("_mr");return t||!e.EXC_US_HMR?t:e.sessionStorage.getItem("unifiedShellMRScript")}(t);if(!o)throw new Error("Module Runtime: Missing script!");if("https:"!==(o=new URL(decodeURIComponent(o))).protocol)throw new Error("Module Runtime: Must be HTTPS!");if(!/^(exc-unifiedcontent\.)?experience(-qa|-stage|-cdn|-cdn-stage)?\.adobe\.(com|net)$/.test(o.hostname)&&!/localhost\.corp\.adobe\.com$/.test(o.hostname))throw new Error("Module Runtime: Invalid domain!");if(!/\.js$/.test(o.pathname))throw new Error("Module Runtime: Must be a JavaScript file!");t.EXC_US_HMR&&t.sessionStorage.setItem("unifiedShellMRScript",o.toString());var n=e.createElement("script");n.async=1,n.src=o.toString(),n.onload=n.onreadystatechange=function(){n.readyState&&!/loaded|complete/.test(n.readyState)||(n.onload=n.onreadystatechange=null,n=void 0,"EXC_MR_READY"in t&&t.EXC_MR_READY())},e.head.appendChild(n)})(document,window);
@@ -1,16 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
6
- <meta name="theme-color" content="#1473e6">
7
- <meta http-equiv="X-UA-Compatible" content="ie=edge">
8
- <link rel="icon" type="image/svg+xml" href="./favicon.svg">
9
- <title>Sync Management</title>
10
- </head>
11
- <body>
12
- <noscript>You need to enable JavaScript to run this app.</noscript>
13
- <div id="root"></div>
14
- <script src="./src/index.js" async="true" type="module"></script>
15
- </body>
16
- </html>
@@ -1,61 +0,0 @@
1
- /*
2
- Copyright 2025 Adobe. All rights reserved.
3
- This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
- you may not use this file except in compliance with the License. You may obtain a copy
5
- of the License at http://www.apache.org/licenses/LICENSE-2.0
6
- */
7
- // configuration-management: auto-generated bootstrap (updated on npm install)
8
-
9
- import 'core-js/stable'
10
- import 'regenerator-runtime/runtime'
11
-
12
- import React from 'react'
13
- import { createRoot } from 'react-dom/client'
14
-
15
- import Runtime, { init } from '@adobe/exc-app'
16
- import { ConfigurationManagementApp as App, configureWeb } from 'configuration-management/web'
17
- import actions from './config.json'
18
- import 'configuration-management/web/styles.css'
19
-
20
- configureWeb({ actionUrls: actions })
21
-
22
- window.React = React
23
-
24
- try {
25
- require('./exc-runtime')
26
- init(bootstrapInExcShell)
27
- } catch (e) {
28
- console.log('application not running in Adobe Experience Cloud Shell')
29
- bootstrapRaw()
30
- }
31
-
32
- function renderApp (runtime, ims) {
33
- createRoot(document.getElementById('root')).render(
34
- React.createElement(App, { runtime, ims })
35
- )
36
- }
37
-
38
- function bootstrapRaw () {
39
- renderApp({ on: () => {} }, {})
40
- }
41
-
42
- function bootstrapInExcShell () {
43
- const runtime = Runtime()
44
- runtime.favicon = './favicon.svg'
45
-
46
- runtime.on('ready', ({ imsOrg, imsToken, imsProfile }) => {
47
- runtime.done()
48
- renderApp(runtime, {
49
- profile: imsProfile,
50
- org: imsOrg,
51
- token: imsToken
52
- })
53
- })
54
-
55
- runtime.solution = {
56
- icon: 'AdobeExperienceCloud',
57
- title: 'Sync Management',
58
- shortTitle: 'Sync'
59
- }
60
- runtime.title = 'Sync Management'
61
- }