@owlmeans/web-wl 0.1.18-rc.4 → 0.1.18-rc.41
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 +9 -9
- package/agent-meta/manifest.json +2 -2
- package/agent-meta/skills/web-wl/SKILL.md +54 -11
- package/build/entrypoints.d.ts +4 -0
- package/build/entrypoints.d.ts.map +1 -0
- package/build/entrypoints.js +4 -0
- package/build/entrypoints.js.map +1 -0
- package/build/index.d.ts +1 -1
- package/build/index.d.ts.map +1 -1
- package/build/index.js +1 -1
- package/build/index.js.map +1 -1
- package/build/service.js +1 -1
- package/build/service.js.map +1 -1
- package/package.json +5 -5
- package/src/entrypoints.ts +5 -0
- package/src/index.ts +1 -1
- package/src/service.ts +1 -1
- package/src/modules.ts +0 -8
package/README.md
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
# @owlmeans/web-wl
|
|
2
2
|
|
|
3
|
-
Web whitelabel — service factory,
|
|
3
|
+
Web whitelabel — service factory, local protocol bindings, and React components for managing whitelabel content in browser apps.
|
|
4
4
|
|
|
5
5
|
## Overview
|
|
6
6
|
|
|
7
7
|
- `makeWlService(alias?)` — web-side whitelabel service factory
|
|
8
|
-
- `
|
|
8
|
+
- `entrypoints` — web-side bindings for the shared whitelabel protocol
|
|
9
9
|
- Components for displaying whitelabel content
|
|
10
10
|
- `DEFAULT_ALIAS` — `'wl-web-serivce'`
|
|
11
11
|
|
|
12
12
|
## Installation
|
|
13
13
|
|
|
14
14
|
```bash
|
|
15
|
-
bun add @owlmeans/web-wl
|
|
15
|
+
bun add @owlmeans/web-wl@^0.1.18-rc.41
|
|
16
16
|
```
|
|
17
17
|
|
|
18
18
|
## Usage
|
|
19
19
|
|
|
20
|
-
Register the service and
|
|
20
|
+
Register the service and local bindings:
|
|
21
21
|
|
|
22
22
|
```typescript
|
|
23
|
-
import { makeWlService,
|
|
23
|
+
import { makeWlService, entrypoints as wlEntrypoints } from '@owlmeans/web-wl'
|
|
24
24
|
|
|
25
25
|
context.registerService(makeWlService())
|
|
26
|
-
const
|
|
26
|
+
const clientBindings = [...baseEntrypoints, ...wlEntrypoints, ...appBindings]
|
|
27
27
|
```
|
|
28
28
|
|
|
29
29
|
Downstream variants (e.g., `@owlmeans/web-wl-manager`) extend this with manager-store helpers like `setupWlManagerStore<C, T>(context)`.
|
|
@@ -34,9 +34,9 @@ Downstream variants (e.g., `@owlmeans/web-wl-manager`) extend this with manager-
|
|
|
34
34
|
|
|
35
35
|
Creates the web whitelabel service. `alias` defaults to `DEFAULT_ALIAS` (`'wl-web-serivce'`).
|
|
36
36
|
|
|
37
|
-
### `
|
|
37
|
+
### `entrypoints`
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
Local browser bindings for `wledEntrypoints.provide`; they do not redeclare the shared protocol.
|
|
40
40
|
|
|
41
41
|
### Components
|
|
42
42
|
|
|
@@ -61,7 +61,7 @@ This package ships embedded agent skills under `agent-meta/`. After installing y
|
|
|
61
61
|
your project's skill store (`.agents/skills/`):
|
|
62
62
|
|
|
63
63
|
```sh
|
|
64
|
-
npx @owlmeans/agent-skills
|
|
64
|
+
npx @owlmeans/agent-skills@^0.1.18-rc.41
|
|
65
65
|
```
|
|
66
66
|
|
|
67
67
|
The embedded files are version-matched to this package release. Do not edit them
|
package/agent-meta/manifest.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 2,
|
|
3
3
|
"package": "@owlmeans/web-wl",
|
|
4
|
-
"version": "0.1.18-rc.
|
|
5
|
-
"generatedAt": "2026-
|
|
4
|
+
"version": "0.1.18-rc.41",
|
|
5
|
+
"generatedAt": "2026-09-28T02:06:37.891Z",
|
|
6
6
|
"canonicalRepo": "https://github.com/owlmeans/common",
|
|
7
7
|
"entries": [
|
|
8
8
|
{
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: web-wl
|
|
3
|
-
description: How to use @owlmeans/web-wl —
|
|
3
|
+
description: How to use @owlmeans/web-wl — the browser half of the white-label contract — the bound WL_PROVIDE entrypoint, the caching WlWebService that loads an organization's white-label set, and the WlLogo component. Auto-invoked when reading white-label data in a web app or rendering a customer's branding.
|
|
4
4
|
user-invocable: false
|
|
5
5
|
---
|
|
6
6
|
<!-- AUTO-GENERATED — do not edit. Regenerate via sync-agent-meta. -->
|
|
@@ -8,29 +8,72 @@ user-invocable: false
|
|
|
8
8
|
# @owlmeans/web-wl
|
|
9
9
|
|
|
10
10
|
**Layer:** Web (React)
|
|
11
|
-
**Install:** `"@owlmeans/web-wl": "^0.1.18-rc.
|
|
11
|
+
**Install:** `"@owlmeans/web-wl": "^0.1.18-rc.41"` in `dependencies`
|
|
12
|
+
|
|
13
|
+
Reads what `@owlmeans/server-wl` serves. One service call per organization entity, cached inside the
|
|
14
|
+
service, plus a component for the one piece of branding almost every app needs.
|
|
12
15
|
|
|
13
16
|
## Key Exports
|
|
14
17
|
|
|
15
18
|
| Export | Description |
|
|
16
19
|
|--------|-------------|
|
|
17
|
-
| `
|
|
18
|
-
| `makeWlService()` |
|
|
19
|
-
| `
|
|
20
|
-
|
|
|
20
|
+
| `entrypoints` | The `WL_PROVIDE` protocol bound for the browser. Spread it into the app's entrypoint list or `call()` misses |
|
|
21
|
+
| `makeWlService(alias?)` | The service factory. Defaults to `DEFAULT_ALIAS` |
|
|
22
|
+
| `DEFAULT_ALIAS` | `'wl-web-serivce'` — spelled exactly that way. Always register and look the service up through this constant rather than a literal |
|
|
23
|
+
| `WlWebService` | `load<T>(entityId, resource?) => Promise<ProvidedWLSet<T>>` and `extract<T>(key, set) => ProvidedWL<T>`. The `resource` argument is accepted and ignored — the whole set always comes back |
|
|
24
|
+
| `ProvidedWLSet<T>` | The whole answer: `{ [providerAlias]: ProvidedWL<T> }` |
|
|
25
|
+
| `WlLogo` | `<WlLogo entityId={…} defImg={…} />` — both props optional. Renders the `wl-logo` section's `brand.wideLogo`, else `defImg`, else nothing; with no `entityId` it never loads and only `defImg` can show. It reads the section by the literal name `wl-logo`, so the backend must register its media provider under exactly that alias |
|
|
26
|
+
| `Config`, `Context` | This package's `AppConfig`/`AppContext` from `@owlmeans/web-client`, narrowed for its own service |
|
|
27
|
+
|
|
28
|
+
The component prop interfaces are **not** exported — the entry point re-exports the component only.
|
|
29
|
+
Type a wrapper with `ComponentProps<typeof WlLogo>` rather than importing a props name.
|
|
21
30
|
|
|
22
|
-
##
|
|
31
|
+
## Wiring
|
|
23
32
|
|
|
24
33
|
```typescript
|
|
25
|
-
import {
|
|
34
|
+
import { entrypoints as wlEntrypoints, makeWlService } from '@owlmeans/web-wl'
|
|
26
35
|
|
|
27
36
|
context.registerService(makeWlService())
|
|
28
|
-
const
|
|
37
|
+
const entrypoints = [...baseEntrypoints, ...wlEntrypoints, ...managerEntrypoints]
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Reading a white-label set
|
|
41
|
+
|
|
42
|
+
```typescript
|
|
43
|
+
import { DEFAULT_ALIAS } from '@owlmeans/web-wl'
|
|
44
|
+
import type { WlWebService } from '@owlmeans/web-wl'
|
|
45
|
+
import type { CustomStyles } from '@owlmeans/wled'
|
|
46
|
+
|
|
47
|
+
const wl = context.service<WlWebService>(DEFAULT_ALIAS)
|
|
48
|
+
const set = await wl.load(entityId)
|
|
49
|
+
const styles = wl.extract<CustomStyles>('wl-styles', set)
|
|
50
|
+
if (styles.exists === true) {
|
|
51
|
+
applyTheme(styles.colors, styles.font)
|
|
52
|
+
}
|
|
29
53
|
```
|
|
30
54
|
|
|
31
|
-
|
|
55
|
+
The key is the **provider service alias the backend registered**, the same string that appears in
|
|
56
|
+
that server's `cfg.wlProviders`. It is not a `WL_TYPE_*` constant — those name the `type` field
|
|
57
|
+
inside a section, which is how a reader confirms the shape it got.
|
|
58
|
+
|
|
59
|
+
The value `load` sends as the `entity` param is the argument it was given, unchanged; what the server
|
|
60
|
+
accepts there is the server's rule, not this package's.
|
|
61
|
+
|
|
62
|
+
`load` memoises per `entityId` in a cache created inside `makeWlService`, so the memo lives exactly as
|
|
63
|
+
long as that service instance and two services made under different aliases keep independent caches.
|
|
64
|
+
The entry is written only after the call resolves and there is no in-flight promise memo, so
|
|
65
|
+
concurrent callers — two `WlLogo`s mounting in the same tick — each issue their own request; the
|
|
66
|
+
cache only dedups calls made after one has returned. Nothing invalidates it either, so a screen that
|
|
67
|
+
has just written new branding must reload the page (or read the write's own response) rather than
|
|
68
|
+
expecting `load` to see the change.
|
|
32
69
|
|
|
33
70
|
## Depends On
|
|
34
71
|
|
|
35
|
-
- `@owlmeans/wled`, `@owlmeans/client
|
|
72
|
+
- `@owlmeans/wled`, `@owlmeans/client`, `@owlmeans/client-entrypoint`, `@owlmeans/context`
|
|
73
|
+
- `@owlmeans/web-client` — supplies the `AppConfig`/`AppContext` this package's `Config`/`Context`
|
|
74
|
+
extend. It is imported by the published types but missing from the manifest, so a consumer has to
|
|
75
|
+
install it explicitly or the declarations do not resolve
|
|
36
76
|
- `react` (peer)
|
|
77
|
+
|
|
78
|
+
The server counterpart is `@owlmeans/server-wl`. Editing screens for white-label records live in
|
|
79
|
+
downstream manager packages, not here.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entrypoints.d.ts","sourceRoot":"","sources":["../src/entrypoints.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,WAAW;;gBAAkC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entrypoints.js","sourceRoot":"","sources":["../src/entrypoints.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAA;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAEhD,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,CAAA"}
|
package/build/index.d.ts
CHANGED
package/build/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,mBAAmB,YAAY,CAAA;AAC/B,cAAc,aAAa,CAAA;AAC3B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,mBAAmB,YAAY,CAAA;AAC/B,cAAc,aAAa,CAAA;AAC3B,cAAc,kBAAkB,CAAA;AAChC,cAAc,cAAc,CAAA;AAC5B,cAAc,uBAAuB,CAAA"}
|
package/build/index.js
CHANGED
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,cAAc,aAAa,CAAA;AAC3B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,cAAc,aAAa,CAAA;AAC3B,cAAc,kBAAkB,CAAA;AAChC,cAAc,cAAc,CAAA;AAC5B,cAAc,uBAAuB,CAAA"}
|
package/build/service.js
CHANGED
|
@@ -10,7 +10,7 @@ export const makeWlService = (alias = DEFAULT_ALIAS) => {
|
|
|
10
10
|
}
|
|
11
11
|
const context = service.assertCtx();
|
|
12
12
|
const module = context.entrypoint(WL_PROVIDE);
|
|
13
|
-
const
|
|
13
|
+
const wlSet = await module.call({ params: { entity: entityId } });
|
|
14
14
|
return cache[entityId] = wlSet;
|
|
15
15
|
},
|
|
16
16
|
extract: (key, set) => set[key]
|
package/build/service.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.js","sourceRoot":"","sources":["../src/service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAE3C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAG3C,MAAM,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AE,EAAE,CAAC,CAAA;YAEjE,OAAO,KAAK,CAAC,QAAQ,CAAC,GAAG,KAA2B,CAAA;QACtD,CAAC;QAED,OAAO,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC;KAChC,CAAC,CAAA;IAEF,OAAO,OAAO,CAAA;AAChB,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@owlmeans/web-wl",
|
|
3
|
-
"version": "0.1.18-rc.
|
|
3
|
+
"version": "0.1.18-rc.41",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -21,10 +21,10 @@
|
|
|
21
21
|
}
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@owlmeans/client": "^0.1.18-rc.
|
|
25
|
-
"@owlmeans/client-entrypoint": "^0.1.18-rc.
|
|
26
|
-
"@owlmeans/context": "^0.1.18-rc.
|
|
27
|
-
"@owlmeans/wled": "^0.1.18-rc.
|
|
24
|
+
"@owlmeans/client": "^0.1.18-rc.44",
|
|
25
|
+
"@owlmeans/client-entrypoint": "^0.1.18-rc.40",
|
|
26
|
+
"@owlmeans/context": "^0.1.18-rc.32",
|
|
27
|
+
"@owlmeans/wled": "^0.1.18-rc.34"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
30
|
"react": "*"
|
package/src/index.ts
CHANGED
package/src/service.ts
CHANGED
|
@@ -17,7 +17,7 @@ export const makeWlService = (alias: string = DEFAULT_ALIAS): WlWebService => {
|
|
|
17
17
|
const context = service.assertCtx<Config, Context>()
|
|
18
18
|
|
|
19
19
|
const module = context.entrypoint<ClientEntrypoint<ProvidedWLSet>>(WL_PROVIDE)
|
|
20
|
-
const
|
|
20
|
+
const wlSet = await module.call({ params: { entity: entityId } })
|
|
21
21
|
|
|
22
22
|
return cache[entityId] = wlSet as ProvidedWLSet<any>
|
|
23
23
|
},
|
package/src/modules.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { elevate } from '@owlmeans/client-entrypoint'
|
|
3
|
-
import type { ClientEntrypoint } from '@owlmeans/client-entrypoint'
|
|
4
|
-
import { WL_PROVIDE, modules as wlModules } from '@owlmeans/wled'
|
|
5
|
-
|
|
6
|
-
elevate(wlModules, WL_PROVIDE)
|
|
7
|
-
|
|
8
|
-
export const modules = wlModules as ClientEntrypoint<unknown>[]
|