@onlyworlds/sdk 4.122.0 → 4.123.0
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/AGENTS.md +1 -1
- package/CHANGELOG.md +19 -0
- package/SCHEMA.md +1 -1
- package/dist/{chunk-2FAAOQVM.js → chunk-F2OJWWDO.js} +2 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.js +18 -18
- package/dist/waymark.css +8 -4
- package/dist/waymark.d.ts +1 -1
- package/dist/waymark.js +7 -2
- package/package.json +1 -1
package/AGENTS.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# For AI agents using @onlyworlds/sdk
|
|
2
2
|
|
|
3
|
-
**Current as of**: SDK **4.x** · schema-dist **v0.33.0-dist.
|
|
3
|
+
**Current as of**: SDK **4.x** · schema-dist **v0.33.0-dist.101** (canonical 00.33.00).
|
|
4
4
|
This line is asserted by `codegen:check` in CI — if the pin moves and this file is not
|
|
5
5
|
re-read against it, the check fails rather than letting this document rot quietly.
|
|
6
6
|
|
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,25 @@ earlier history lives in git log only.
|
|
|
5
5
|
|
|
6
6
|
## [Unreleased]
|
|
7
7
|
|
|
8
|
+
## [4.123.0] - 2026-10-31
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- **`tool: 'onlyworlds'` is the site itself.** `openersFor` (and `mountWaymark`'s `tool`) gives the site's own row "You are here" when the surface names itself `onlyworlds`, before "Needs a connection", as a tool's own row already did; the site passes it, so on onlyworlds.com its own row reads as where the reader is, not as a door. Three cases in the shared openers fixture (57 now).
|
|
13
|
+
|
|
14
|
+
### Changed
|
|
15
|
+
|
|
16
|
+
- **The Waymark's web rows open in a new tab** (`target="_blank"`, `rel="noopener"`), so the page the reader came from stays open. A row whose link opens an app on the device (any scheme but `http:` and `https:`) is handed to the device as before.
|
|
17
|
+
- **The surface's own row is drawn grey**, as where the reader already is (its own class, `ow-waymark__row--here`, beside the cannot-open grey). It stays a button that closes the fan-out.
|
|
18
|
+
- **The mark is smaller**: its globe is `0.7em`, as tall as the name's capitals and centred on them, never under 16 px (`max(16px, 0.7em)`), where it was `1em`. Its 44 px tap area is unchanged.
|
|
19
|
+
- **The schema pin moves to schema-dist serial 101** (`v0.33.0-dist.101`): a sentence on the strand page (a surface that only reads may draw the filled slots alone); no schema file moved, the strand fixture unchanged.
|
|
20
|
+
|
|
21
|
+
## [4.122.1] - 2026-10-31
|
|
22
|
+
|
|
23
|
+
### Fixed
|
|
24
|
+
|
|
25
|
+
- **Every value a call puts in a request path is sent as one escaped segment.** `get`, `upsert`, `patch`, `delete`, `editLinks`, `adopt`, `hide`, `unhide`, `draught`, `list` and `create` put the element type, id, link field or Character id into the path as given, so an id carrying a `/`, `?` or `#` asked a different route (`get('character', 'abc/hidden')` asked `GET /character/abc/hidden/`). They now escape each one, as the file, review and proposal routes already escaped the id; the type is escaped on those routes too. On a real id (the API declares every element id a UUID) nothing on the wire changes. A test reads every request path in the client's source and fails on one that interpolates a value unescaped.
|
|
26
|
+
|
|
8
27
|
## [4.122.0] - 2026-10-31
|
|
9
28
|
|
|
10
29
|
### Added
|
package/SCHEMA.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# OnlyWorlds Schema Reference
|
|
2
2
|
|
|
3
|
-
**Source**: https://github.com/OnlyWorlds/schema-dist @ **v0.33.0-dist.
|
|
3
|
+
**Source**: https://github.com/OnlyWorlds/schema-dist @ **v0.33.0-dist.101** — canonical schema **00.33.00**, published 2026-10-31.
|
|
4
4
|
|
|
5
5
|
GENERATED from the canonical schema YAML — do not hand-edit (regenerate: `python codegen/generate_types.py`).
|
|
6
6
|
Written for both humans and AI agents reading this package locally.
|
|
@@ -1274,7 +1274,8 @@ function openersFor(tools, kind, address, surface) {
|
|
|
1274
1274
|
const fill = (template) => template.replace(PLACEHOLDER, (_, n) => values[n]);
|
|
1275
1275
|
const offline = (href) => !online && WEB.test(href);
|
|
1276
1276
|
const site = kind === "element" ? page : elementAddress({ form: "human", world });
|
|
1277
|
-
const
|
|
1277
|
+
const siteState = tool === "onlyworlds" ? "You are here" : offline(site) ? OFFLINE : null;
|
|
1278
|
+
const rows = [{ id: "onlyworlds", name: "onlyworlds.com", href: site, state: siteState }];
|
|
1278
1279
|
for (const r of tools) {
|
|
1279
1280
|
if (r === null || typeof r !== "object" || typeof r.id !== "string" || typeof r.name !== "string") {
|
|
1280
1281
|
fail("each tools row is an object with an id and a name");
|
package/dist/index.d.ts
CHANGED
|
@@ -5719,7 +5719,7 @@ interface OwTool {
|
|
|
5719
5719
|
type OwOpenerKind = 'world' | 'element';
|
|
5720
5720
|
/** What the surface drawing the menu knows of itself and its reader. The function guesses none of it. */
|
|
5721
5721
|
interface OwOpenerSurface {
|
|
5722
|
-
/** The client name of the surface's own tool, when it is a listed tool; its row says "You are here". */
|
|
5722
|
+
/** The client name of the surface's own tool, when it is a listed tool; its row says "You are here". `onlyworlds` is the site itself: the site's own row says it. */
|
|
5723
5723
|
tool?: string | null;
|
|
5724
5724
|
/** `member` (a seat in the world, a guest included) or `public` (the signed-out reader). Required. */
|
|
5725
5725
|
audience: 'member' | 'public';
|
|
@@ -5747,7 +5747,8 @@ interface OwOpener {
|
|
|
5747
5747
|
/**
|
|
5748
5748
|
* The rows of the Open with menu for a world (`kind: 'world'`) or one element of it (`'element'`), in
|
|
5749
5749
|
* order: first the site's own row (id `onlyworlds`, name `onlyworlds.com`, the world's or the element's
|
|
5750
|
-
* page on www.onlyworlds.com, for every audience, its one word "
|
|
5750
|
+
* page on www.onlyworlds.com, for every audience, its one word "You are here" when `surface.tool` is
|
|
5751
|
+
* `onlyworlds` (the site itself), else "Needs a connection" when offline), then
|
|
5751
5752
|
* one row per `tools` row, in the list's order, that is `listed` and has a door for this kind. `tools`
|
|
5752
5753
|
* is the tools list's rows, `TOOLS` or the list as served; `address` is a reading from `parseOwLink` or
|
|
5753
5754
|
* what `elementAddress` takes, with the world's id. A lens and a moment on it ride on no href.
|
package/dist/index.js
CHANGED
|
@@ -37,7 +37,7 @@ import {
|
|
|
37
37
|
trimWhiteSpace,
|
|
38
38
|
typeWord,
|
|
39
39
|
unknownKey
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-F2OJWWDO.js";
|
|
41
41
|
|
|
42
42
|
// src/v2/keyed-id.ts
|
|
43
43
|
var KEYED_IDS = "0199b6a0-6f0e-7c2a-9d1e-3b5c7a8e4f21";
|
|
@@ -858,7 +858,7 @@ var OwV2Client = class {
|
|
|
858
858
|
...params.filter,
|
|
859
859
|
as: params.viewAs
|
|
860
860
|
}, new Set(Object.keys(params.filter ?? {})));
|
|
861
|
-
return this.request("GET", `/${type}/`, { query, worldRead: true, ...withSignal(params.signal) });
|
|
861
|
+
return this.request("GET", `/${encodeURIComponent(type)}/`, { query, worldRead: true, ...withSignal(params.signal) });
|
|
862
862
|
}
|
|
863
863
|
async draught(characterId, policy = {}) {
|
|
864
864
|
only("draught", policy, ["components", "mode", "asOf", "undated", "since", "budget", "depth", "compact", "lens"]);
|
|
@@ -876,7 +876,7 @@ var OwV2Client = class {
|
|
|
876
876
|
compact: policy.compact,
|
|
877
877
|
lens: policy.lens
|
|
878
878
|
});
|
|
879
|
-
return this.request("GET", `/character/${characterId}/context`, { query, worldRead: true });
|
|
879
|
+
return this.request("GET", `/character/${encodeURIComponent(characterId)}/context`, { query, worldRead: true });
|
|
880
880
|
}
|
|
881
881
|
/**
|
|
882
882
|
* Cursor-walk every page of a type. Politeness: uses config pageSize. On a client with `world`
|
|
@@ -903,7 +903,7 @@ var OwV2Client = class {
|
|
|
903
903
|
async get(type, id, opts = {}) {
|
|
904
904
|
only("get", opts, ["expand", "fields", "viewAs", "signal"]);
|
|
905
905
|
const query = buildQuery({ expand: opts.expand?.join(","), fields: opts.fields?.join(","), as: opts.viewAs });
|
|
906
|
-
return this.request("GET", `/${type}/${id}/`, { query, worldRead: true, ...withSignal(opts.signal) });
|
|
906
|
+
return this.request("GET", `/${encodeURIComponent(type)}/${encodeURIComponent(id)}/`, { query, worldRead: true, ...withSignal(opts.signal) });
|
|
907
907
|
}
|
|
908
908
|
/**
|
|
909
909
|
* POST /{type}/ -- create one element, minting an id on the client when you leave id out.
|
|
@@ -922,7 +922,7 @@ var OwV2Client = class {
|
|
|
922
922
|
if (body.id === void 0 || body.id === null || body.id === "") {
|
|
923
923
|
body.id = opts.idempotencyKey ? keyedId(opts.idempotencyKey, 0) : mintUuid();
|
|
924
924
|
}
|
|
925
|
-
return this.request("POST", `/${type}/`, {
|
|
925
|
+
return this.request("POST", `/${encodeURIComponent(type)}/`, {
|
|
926
926
|
write: true,
|
|
927
927
|
elementWrite: true,
|
|
928
928
|
body,
|
|
@@ -938,7 +938,7 @@ var OwV2Client = class {
|
|
|
938
938
|
*/
|
|
939
939
|
async upsert(type, id, element) {
|
|
940
940
|
refuseKnownOf(element, "upsert");
|
|
941
|
-
return this.request("PUT", `/${type}/${id}/`, { write: true, elementWrite: true, proposable: true, body: sanitizePayload(element) });
|
|
941
|
+
return this.request("PUT", `/${encodeURIComponent(type)}/${encodeURIComponent(id)}/`, { write: true, elementWrite: true, proposable: true, body: sanitizePayload(element) });
|
|
942
942
|
}
|
|
943
943
|
/**
|
|
944
944
|
* PATCH /{type}/{id}/ -- partial update. DESTRUCTIVE on sent fields: arrays
|
|
@@ -958,7 +958,7 @@ var OwV2Client = class {
|
|
|
958
958
|
async patch(type, id, partial, opts = {}) {
|
|
959
959
|
only("patch", opts, ["ifMatch"]);
|
|
960
960
|
refuseKnownOf(partial, "patch");
|
|
961
|
-
return this.request("PATCH", `/${type}/${id}/`, { write: true, elementWrite: true, proposable: true, body: sanitizePayload(partial), ifMatch: opts.ifMatch });
|
|
961
|
+
return this.request("PATCH", `/${encodeURIComponent(type)}/${encodeURIComponent(id)}/`, { write: true, elementWrite: true, proposable: true, body: sanitizePayload(partial), ifMatch: opts.ifMatch });
|
|
962
962
|
}
|
|
963
963
|
/**
|
|
964
964
|
* DELETE /{type}/{id}/ -- idempotent (204 on absent). Server writes a
|
|
@@ -972,7 +972,7 @@ var OwV2Client = class {
|
|
|
972
972
|
*/
|
|
973
973
|
async delete(type, id, opts = {}) {
|
|
974
974
|
only("delete", opts, ["ifMatch"]);
|
|
975
|
-
await this.request("DELETE", `/${type}/${id}/`, { write: true, elementWrite: true, allowEmpty: true, ifMatch: opts.ifMatch });
|
|
975
|
+
await this.request("DELETE", `/${encodeURIComponent(type)}/${encodeURIComponent(id)}/`, { write: true, elementWrite: true, allowEmpty: true, ifMatch: opts.ifMatch });
|
|
976
976
|
}
|
|
977
977
|
/**
|
|
978
978
|
* POST /{type}/{id}/links/{field} with {add, remove} -- atomic link merge.
|
|
@@ -985,7 +985,7 @@ var OwV2Client = class {
|
|
|
985
985
|
async editLinks(type, id, field, edit, opts = {}) {
|
|
986
986
|
only("editLinks", opts, ["ifMatch"]);
|
|
987
987
|
only("editLinks", edit, ["add", "remove"], "The edit is { add?: string[], remove?: string[] }.");
|
|
988
|
-
return this.request("POST", `/${type}/${id}/links/${field}`, { write: true, elementWrite: true, proposable: true, body: edit, ifMatch: opts.ifMatch });
|
|
988
|
+
return this.request("POST", `/${encodeURIComponent(type)}/${encodeURIComponent(id)}/links/${encodeURIComponent(field)}`, { write: true, elementWrite: true, proposable: true, body: edit, ifMatch: opts.ifMatch });
|
|
989
989
|
}
|
|
990
990
|
/**
|
|
991
991
|
* POST /{type}/{id}/adopt with {member} -- change who made an element.
|
|
@@ -1001,7 +1001,7 @@ var OwV2Client = class {
|
|
|
1001
1001
|
*/
|
|
1002
1002
|
async adopt(type, id, member) {
|
|
1003
1003
|
if (typeof member !== "string" || member === "") throw new TypeError('adopt: member must be a membership id or "owner"');
|
|
1004
|
-
return this.request("POST", `/${type}/${id}/adopt`, { write: true, elementWrite: true, body: { member } });
|
|
1004
|
+
return this.request("POST", `/${encodeURIComponent(type)}/${encodeURIComponent(id)}/adopt`, { write: true, elementWrite: true, body: { member } });
|
|
1005
1005
|
}
|
|
1006
1006
|
// -- Bulk ----------------------------------------------------------------
|
|
1007
1007
|
/**
|
|
@@ -1241,7 +1241,7 @@ var OwV2Client = class {
|
|
|
1241
1241
|
* are not in its body, its `change_seq` or /changes.
|
|
1242
1242
|
*/
|
|
1243
1243
|
async listFiles(type, id) {
|
|
1244
|
-
const page = await this.request("GET", `/${type}/${encodeURIComponent(id)}/files`);
|
|
1244
|
+
const page = await this.request("GET", `/${encodeURIComponent(type)}/${encodeURIComponent(id)}/files`);
|
|
1245
1245
|
return page.data ?? [];
|
|
1246
1246
|
}
|
|
1247
1247
|
/**
|
|
@@ -1281,7 +1281,7 @@ var OwV2Client = class {
|
|
|
1281
1281
|
const kind = req.kind ?? requireFileKind(name);
|
|
1282
1282
|
const body = { name, kind, size };
|
|
1283
1283
|
if (req.label !== void 0) body.label = req.label;
|
|
1284
|
-
return this.request("POST", `/${type}/${encodeURIComponent(id)}/files`, { body, write: true });
|
|
1284
|
+
return this.request("POST", `/${encodeURIComponent(type)}/${encodeURIComponent(id)}/files`, { body, write: true });
|
|
1285
1285
|
}
|
|
1286
1286
|
/**
|
|
1287
1287
|
* Attach one file to an element: a ticket from the API (createFileTicket), then the bytes
|
|
@@ -1360,7 +1360,7 @@ var OwV2Client = class {
|
|
|
1360
1360
|
* key that may read the element.
|
|
1361
1361
|
*/
|
|
1362
1362
|
async fileDownloadLink(type, id, fileId) {
|
|
1363
|
-
return this.request("GET", `/${type}/${encodeURIComponent(id)}/files/${encodeURIComponent(fileId)}/download`);
|
|
1363
|
+
return this.request("GET", `/${encodeURIComponent(type)}/${encodeURIComponent(id)}/files/${encodeURIComponent(fileId)}/download`);
|
|
1364
1364
|
}
|
|
1365
1365
|
/**
|
|
1366
1366
|
* DELETE /{type}/{id}/files/{fileId} -- remove a file for real: it leaves the lists and
|
|
@@ -1370,7 +1370,7 @@ var OwV2Client = class {
|
|
|
1370
1370
|
* Deleting an element removes its files too.
|
|
1371
1371
|
*/
|
|
1372
1372
|
async removeFile(type, id, fileId) {
|
|
1373
|
-
await this.request("DELETE", `/${type}/${encodeURIComponent(id)}/files/${encodeURIComponent(fileId)}`);
|
|
1373
|
+
await this.request("DELETE", `/${encodeURIComponent(type)}/${encodeURIComponent(id)}/files/${encodeURIComponent(fileId)}`);
|
|
1374
1374
|
}
|
|
1375
1375
|
// -- Joining a world by link ----------------------------------
|
|
1376
1376
|
/**
|
|
@@ -1714,11 +1714,11 @@ var OwV2Client = class {
|
|
|
1714
1714
|
* lists, search, counts and the link arrays that name it. 204, no body. No Idempotency-Key.
|
|
1715
1715
|
*/
|
|
1716
1716
|
async hide(type, id) {
|
|
1717
|
-
await this.request("PUT", `/${type}/${id}/hidden`, { body: {}, allowEmpty: true });
|
|
1717
|
+
await this.request("PUT", `/${encodeURIComponent(type)}/${encodeURIComponent(id)}/hidden`, { body: {}, allowEmpty: true });
|
|
1718
1718
|
}
|
|
1719
1719
|
/** DELETE /{type}/{id}/hidden -- clear the mark; an element that is not hidden stays as it is. 204. */
|
|
1720
1720
|
async unhide(type, id) {
|
|
1721
|
-
await this.request("DELETE", `/${type}/${id}/hidden`, { allowEmpty: true });
|
|
1721
|
+
await this.request("DELETE", `/${encodeURIComponent(type)}/${encodeURIComponent(id)}/hidden`, { allowEmpty: true });
|
|
1722
1722
|
}
|
|
1723
1723
|
/**
|
|
1724
1724
|
* GET /world/hidden -- every hidden element of the world, newest first: `{type, id, set_at,
|
|
@@ -1856,7 +1856,7 @@ var OwV2Client = class {
|
|
|
1856
1856
|
}
|
|
1857
1857
|
const body = { decision: opts.decision };
|
|
1858
1858
|
if (opts.reason !== void 0) body.reason = opts.reason;
|
|
1859
|
-
const path = `/${type}/${encodeURIComponent(id)}/review`;
|
|
1859
|
+
const path = `/${encodeURIComponent(type)}/${encodeURIComponent(id)}/review`;
|
|
1860
1860
|
const answer = await this.request("POST", path, { elementWrite: true, body });
|
|
1861
1861
|
const settled = opts.decision === "accept" ? "element" : "deleted";
|
|
1862
1862
|
if (answer === null || typeof answer !== "object" || !(settled in answer)) {
|
|
@@ -2173,7 +2173,7 @@ var HeadPollState = class {
|
|
|
2173
2173
|
var READ_ONLY_FIELDS = ["world", "type", "created_at", "updated_at", "change_seq", "known_of"];
|
|
2174
2174
|
var WORLD_READ_ONLY_FIELDS = ["id", "slug", "public_page", "public_read", "agent_narrator_rule", "agent_writes_proposed", "origin", "counts"];
|
|
2175
2175
|
function proposalsPath(type, id) {
|
|
2176
|
-
return `/${type}/${encodeURIComponent(id)}/proposals`;
|
|
2176
|
+
return `/${encodeURIComponent(type)}/${encodeURIComponent(id)}/proposals`;
|
|
2177
2177
|
}
|
|
2178
2178
|
async function proposedFromResponse(res, method, path) {
|
|
2179
2179
|
const body = await readJsonBody(res);
|
package/dist/waymark.css
CHANGED
|
@@ -89,10 +89,12 @@
|
|
|
89
89
|
height: max(44px, 100%);
|
|
90
90
|
transform: translate(-50%, -50%);
|
|
91
91
|
}
|
|
92
|
+
/* 0.7em: the ink as tall as the name's capitals and centred on them; never under 16px, where the
|
|
93
|
+
globe's lines blur (a name under 23px). */
|
|
92
94
|
.ow-waymark__mark .ow-waymark__glyph {
|
|
93
95
|
display: block;
|
|
94
|
-
width:
|
|
95
|
-
height:
|
|
96
|
+
width: max(16px, 0.7em);
|
|
97
|
+
height: max(16px, 0.7em);
|
|
96
98
|
}
|
|
97
99
|
.ow-waymark__mark:hover {
|
|
98
100
|
background: var(--ow-waymark-hover-tile);
|
|
@@ -249,9 +251,11 @@
|
|
|
249
251
|
.ow-waymark__row[aria-expanded='true'] .ow-waymark__chevron {
|
|
250
252
|
transform: rotate(180deg);
|
|
251
253
|
}
|
|
252
|
-
/* Grey says the row cannot open now,
|
|
254
|
+
/* Grey says the row cannot open now, or that it is where the reader already is. */
|
|
253
255
|
.ow-waymark__row--cannot .ow-waymark__label,
|
|
254
|
-
.ow-waymark__row--cannot .ow-waymark__icon
|
|
256
|
+
.ow-waymark__row--cannot .ow-waymark__icon,
|
|
257
|
+
.ow-waymark__row--here .ow-waymark__label,
|
|
258
|
+
.ow-waymark__row--here .ow-waymark__icon {
|
|
255
259
|
color: var(--ow-waymark-muted);
|
|
256
260
|
}
|
|
257
261
|
.ow-waymark__row--lens {
|
package/dist/waymark.d.ts
CHANGED
|
@@ -49,7 +49,7 @@ interface OwWaymarkOptions {
|
|
|
49
49
|
} | null;
|
|
50
50
|
/** `member`, `guest` or `public`. The public face shows the name line without the last door, the rows that need nothing first, and Copy link. */
|
|
51
51
|
reader: OwWaymarkReader;
|
|
52
|
-
/** The client name of the surface's own tool; its row says "You are here". */
|
|
52
|
+
/** The client name of the surface's own tool; its row says "You are here". The site passes `onlyworlds`. */
|
|
53
53
|
tool?: string | null;
|
|
54
54
|
/** Whether the reader is signed in; null when the surface cannot know, and then no row says so. */
|
|
55
55
|
signedIn?: boolean | null;
|
package/dist/waymark.js
CHANGED
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
openersFor,
|
|
7
7
|
refuseUnknownOptions,
|
|
8
8
|
typeWord
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-F2OJWWDO.js";
|
|
10
10
|
|
|
11
11
|
// src/waymark/glyphs.ts
|
|
12
12
|
var MARK_PATH = "M48.8 0.0 43.8 0.4 39.0 1.2 36.0 2.0 33.2 2.9 29.3 4.5 24.8 6.8 20.6 9.5 17.0 12.4 13.6 15.7 10.4 19.4 7.8 23.1 5.8 26.6 4.5 29.3 3.3 32.1 1.8 36.8 0.8 41.2 0.1 46.3 0.0 51.1 0.4 56.2 1.2 61.0 2.0 63.9 2.9 66.8 4.5 70.7 6.8 75.2 9.5 79.4 12.4 82.9 15.7 86.3 19.4 89.5 23.1 92.1 26.6 94.2 29.3 95.5 32.1 96.7 36.8 98.2 41.2 99.2 46.3 99.8 51.1 100.0 56.2 99.6 61.0 98.8 63.9 98.0 66.8 97.1 70.7 95.5 75.2 93.2 79.4 90.4 82.9 87.6 86.3 84.3 89.5 80.5 92.1 76.9 94.2 73.4 95.5 70.7 96.7 67.9 98.2 63.2 99.2 58.7 99.8 53.7 100.0 48.8 99.6 43.8 98.6 38.4 97.1 33.2 95.5 29.3 93.2 24.8 90.4 20.6 87.6 17.0 84.3 13.6 80.5 10.4 76.9 7.8 73.4 5.8 70.7 4.5 67.9 3.3 63.2 1.8 58.7 0.8 53.7 0.1ZM77.5 80.7 74.1 83.4 70.7 85.7 67.0 87.5 64.5 88.6 64.1 88.7 65.7 86.3 67.1 83.9 68.7 80.7 69.9 77.6 72.7 78.5 73.0 78.4ZM22.5 80.7 25.6 79.0 27.3 78.3 30.0 77.6 31.3 80.7 32.8 83.9 34.2 86.3 35.9 88.7 32.9 87.5 29.3 85.7 25.8 83.4ZM51.2 74.5 55.1 74.7 59.9 75.2 64.2 76.0 67.5 76.9 66.0 80.5 64.2 84.0 62.0 87.4 59.6 90.1 55.1 90.9 52.2 91.2 51.2 91.1ZM48.7 74.5 48.8 91.1 47.7 91.2 44.9 90.9 40.3 90.1 38.2 87.8 36.3 85.0 34.2 81.2 32.5 77.0 35.8 76.0 40.5 75.2 44.5 74.7ZM91.1 51.2 91.1 52.9 90.8 56.3 90.1 59.7 89.3 62.5 88.5 64.8 87.2 67.7 85.7 70.7 83.9 73.4 82.0 75.9 79.4 78.9 76.3 77.2 73.8 76.1 76.2 68.8 77.8 62.7 78.7 56.8 79.0 51.2ZM55.8 51.2 67.7 51.2 67.6 55.1 67.2 59.0 66.7 61.5 65.7 65.0 61.0 64.2 55.7 63.6ZM32.5 51.2 44.5 51.2 44.4 63.6 39.7 64.1 34.5 65.0 33.5 61.3 32.9 58.1 32.5 54.2ZM8.8 51.2 21.0 51.2 21.0 53.3 21.4 56.6 22.7 64.0 23.8 68.4 25.0 72.1 26.6 75.9 23.7 77.2 20.6 78.9 18.5 76.7 16.5 74.1 14.8 71.5 13.4 69.1 12.1 66.3 11.0 63.6 10.1 60.5 9.4 57.3 8.9 53.5 8.8 51.3ZM36.2 27.0 39.5 27.5 44.5 28.2 44.4 48.8 32.4 48.7 32.8 44.5 33.6 39.1 35.0 32.0ZM63.9 26.9 65.2 32.1 66.6 39.2 67.4 44.8 67.7 48.7 55.8 48.8 55.7 28.1 60.5 27.5ZM74.8 23.4 76.9 22.5 79.4 21.1 82.0 24.0 84.8 27.8 86.2 30.3 87.5 32.9 88.6 35.4 89.5 38.1 90.3 41.2 90.8 44.0 91.1 47.0 91.1 48.8 79.0 48.7 78.7 44.6 78.0 39.3 76.5 31.2 74.7 23.5ZM25.5 23.5 25.5 23.7 24.5 26.8 23.7 30.2 22.4 36.6 21.5 42.5 21.1 48.7 8.8 48.8 8.8 47.0 9.2 43.7 9.8 40.8 10.5 38.1 11.5 35.2 12.4 32.9 13.8 30.2 15.2 27.8 17.9 24.0 20.6 21.1 23.1 22.5ZM64.1 11.3 67.0 12.4 70.7 14.3 74.1 16.5 77.5 19.3 75.6 20.3 73.2 21.5 70.0 22.6 68.7 19.2 67.1 16.1 65.7 13.6ZM35.9 11.3 34.2 13.6 32.8 16.1 31.3 19.2 30.0 22.5 27.9 21.9 26.4 21.3 22.5 19.3 25.8 16.5 29.3 14.3 32.9 12.4 35.4 11.4ZM51.2 8.8 52.2 8.8 55.1 9.0 59.6 9.9 61.7 12.2 64.2 16.0 66.0 19.5 67.6 23.3 64.3 24.3 59.4 25.2 56.2 25.6 51.2 25.5ZM48.8 8.8 48.7 25.5 44.2 25.6 40.6 25.2 36.4 24.5 32.4 23.2 33.9 19.5 35.7 16.0 38.2 12.2 40.3 9.9 44.9 9.0 47.7 8.8Z";
|
|
@@ -55,6 +55,7 @@ var COPIED = "Link copied";
|
|
|
55
55
|
var NOT_COPIED = "Could not copy the link.";
|
|
56
56
|
var HERE = "You are here";
|
|
57
57
|
var OFFLINE = "Needs a connection";
|
|
58
|
+
var WEB_LINK = /^https?:/i;
|
|
58
59
|
var mounted = 0;
|
|
59
60
|
var fail = (what) => {
|
|
60
61
|
throw new TypeError(`mountWaymark: ${what}`);
|
|
@@ -234,7 +235,7 @@ function mountWaymark(target, options) {
|
|
|
234
235
|
};
|
|
235
236
|
const openWith = section("Open with");
|
|
236
237
|
const rowNode = (r) => {
|
|
237
|
-
const cls = `ow-waymark__row${cannotOpen(r.state) ? " ow-waymark__row--cannot" : ""}`;
|
|
238
|
+
const cls = `ow-waymark__row${cannotOpen(r.state) ? " ow-waymark__row--cannot" : r.state === HERE ? " ow-waymark__row--here" : ""}`;
|
|
238
239
|
let a;
|
|
239
240
|
if (r.state === HERE) {
|
|
240
241
|
a = el("button", cls);
|
|
@@ -248,6 +249,10 @@ function mountWaymark(target, options) {
|
|
|
248
249
|
} else {
|
|
249
250
|
a = el("a", cls);
|
|
250
251
|
a.href = r.href;
|
|
252
|
+
if (WEB_LINK.test(r.href)) {
|
|
253
|
+
a.target = "_blank";
|
|
254
|
+
a.rel = "noopener";
|
|
255
|
+
}
|
|
251
256
|
}
|
|
252
257
|
a.setAttribute("role", "menuitem");
|
|
253
258
|
a.dataset.opener = r.id;
|