@ohhwells/bridge 0.1.71 → 0.1.72
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/dist/index.cjs +64 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +64 -12
- package/dist/index.js.map +1 -1
- package/dist/social-glyphs.cjs +61 -0
- package/dist/social-glyphs.cjs.map +1 -0
- package/dist/social-glyphs.js +31 -0
- package/dist/social-glyphs.js.map +1 -0
- package/package.json +7 -2
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/social-glyphs.ts
|
|
21
|
+
var social_glyphs_exports = {};
|
|
22
|
+
__export(social_glyphs_exports, {
|
|
23
|
+
SOCIAL_GLYPH_FALLBACK: () => SOCIAL_GLYPH_FALLBACK,
|
|
24
|
+
socialGlyphBody: () => socialGlyphBody,
|
|
25
|
+
socialGlyphMarkup: () => socialGlyphMarkup,
|
|
26
|
+
socialGlyphPlatforms: () => socialGlyphPlatforms
|
|
27
|
+
});
|
|
28
|
+
module.exports = __toCommonJS(social_glyphs_exports);
|
|
29
|
+
|
|
30
|
+
// src/lib/social-glyphs.ts
|
|
31
|
+
var GLYPH_BODIES = {
|
|
32
|
+
facebook: "<path d='M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z' />",
|
|
33
|
+
instagram: "<rect width='20' height='20' x='2' y='2' rx='5' ry='5' /><path d='M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z' /><line x1='17.5' x2='17.51' y1='6.5' y2='6.5' />",
|
|
34
|
+
youtube: "<path d='M2.5 17a24.12 24.12 0 0 1 0-10 2 2 0 0 1 1.4-1.4 49.56 49.56 0 0 1 16.2 0A2 2 0 0 1 21.5 7a24.12 24.12 0 0 1 0 10 2 2 0 0 1-1.4 1.4 49.55 49.55 0 0 1-16.2 0A2 2 0 0 1 2.5 17' /><path d='m10 15 5-3-5-3z' />",
|
|
35
|
+
linkedin: "<path d='M16 8a6 6 0 0 1 6 6v7h-4v-7a2 2 0 0 0-2-2 2 2 0 0 0-2 2v7h-4v-7a6 6 0 0 1 6-6z' /><rect width='4' height='12' x='2' y='9' /><circle cx='4' cy='4' r='2' />",
|
|
36
|
+
twitter: "<path d='M22 4s-.7 2.1-2 3.4c1.6 10-9.4 17.3-18 11.6 2.2.1 4.4-.6 6-2C3 15.5.5 9.6 3 5c2.2 2.6 5.6 4.1 9 4-.9-4.2 4-6.6 7-3.8 1.1 0 3-1.2 3-1.2z' />"
|
|
37
|
+
};
|
|
38
|
+
var GLYPH_ALIASES = {
|
|
39
|
+
"x": GLYPH_BODIES.twitter,
|
|
40
|
+
"yt": GLYPH_BODIES.youtube,
|
|
41
|
+
"linked-in": GLYPH_BODIES.linkedin
|
|
42
|
+
};
|
|
43
|
+
var SOCIAL_GLYPH_FALLBACK = "<circle cx='12' cy='12' r='10' /><path d='M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20' /><path d='M2 12h20' />";
|
|
44
|
+
function socialGlyphBody(platform) {
|
|
45
|
+
const key = platform.trim().toLowerCase();
|
|
46
|
+
return GLYPH_BODIES[key] ?? GLYPH_ALIASES[key] ?? SOCIAL_GLYPH_FALLBACK;
|
|
47
|
+
}
|
|
48
|
+
function socialGlyphMarkup(platform) {
|
|
49
|
+
return "<svg xmlns='http://www.w3.org/2000/svg' width='1em' height='1em' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' aria-hidden='true'>" + socialGlyphBody(platform) + "</svg>";
|
|
50
|
+
}
|
|
51
|
+
function socialGlyphPlatforms() {
|
|
52
|
+
return Object.keys(GLYPH_BODIES);
|
|
53
|
+
}
|
|
54
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
55
|
+
0 && (module.exports = {
|
|
56
|
+
SOCIAL_GLYPH_FALLBACK,
|
|
57
|
+
socialGlyphBody,
|
|
58
|
+
socialGlyphMarkup,
|
|
59
|
+
socialGlyphPlatforms
|
|
60
|
+
});
|
|
61
|
+
//# sourceMappingURL=social-glyphs.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/social-glyphs.ts","../src/lib/social-glyphs.ts"],"sourcesContent":["/**\n * Server-safe entry for the social marks.\n *\n * The package's main entry is a client module — it carries a \"use client\" banner and React hooks —\n * so a template rendering its footer on the server received a client reference instead of a\n * function. These helpers are plain strings and nothing else, so they ship separately and can be\n * called anywhere: at build time, on the server, in the browser.\n */\nexport { socialGlyphBody, socialGlyphMarkup, socialGlyphPlatforms, SOCIAL_GLYPH_FALLBACK } from './lib/social-glyphs'\nexport type { SocialPlatform } from './lib/social-glyphs'\n","/**\n * Brand marks for social rows, drawn once for the whole product.\n *\n * They live here because the bridge is the one thing installed in every template and updated by a\n * single publish. While each side kept its own copy — the editor from one icon package, a template\n * from another or from an outside service — the mark that shipped with a template and the mark the\n * editor inserted came from different sets and looked nothing alike (OHH-762). Anything reading\n * from here cannot drift.\n *\n * Outlines in the lucide hand (ISC licensed): a 24 unit box, strokes on `currentColor`, so a mark\n * takes the colour and size of the words beside it.\n */\n\nconst GLYPH_BODIES = {\n facebook: \"<path d='M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z' />\",\n instagram: \"<rect width='20' height='20' x='2' y='2' rx='5' ry='5' /><path d='M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z' /><line x1='17.5' x2='17.51' y1='6.5' y2='6.5' />\",\n youtube: \"<path d='M2.5 17a24.12 24.12 0 0 1 0-10 2 2 0 0 1 1.4-1.4 49.56 49.56 0 0 1 16.2 0A2 2 0 0 1 21.5 7a24.12 24.12 0 0 1 0 10 2 2 0 0 1-1.4 1.4 49.55 49.55 0 0 1-16.2 0A2 2 0 0 1 2.5 17' /><path d='m10 15 5-3-5-3z' />\",\n linkedin: \"<path d='M16 8a6 6 0 0 1 6 6v7h-4v-7a2 2 0 0 0-2-2 2 2 0 0 0-2 2v7h-4v-7a6 6 0 0 1 6-6z' /><rect width='4' height='12' x='2' y='9' /><circle cx='4' cy='4' r='2' />\",\n twitter: \"<path d='M22 4s-.7 2.1-2 3.4c1.6 10-9.4 17.3-18 11.6 2.2.1 4.4-.6 6-2C3 15.5.5 9.6 3 5c2.2 2.6 5.6 4.1 9 4-.9-4.2 4-6.6 7-3.8 1.1 0 3-1.2 3-1.2z' />\",\n} as const\n\n/** Same mark under the names a template or an owner might use. */\nconst GLYPH_ALIASES: Record<string, string> = {\n 'x': GLYPH_BODIES.twitter,\n 'yt': GLYPH_BODIES.youtube,\n 'linked-in': GLYPH_BODIES.linkedin,\n}\n\n/** Drawn for a platform we ship no mark for — a link is still a link. */\nexport const SOCIAL_GLYPH_FALLBACK =\n \"<circle cx='12' cy='12' r='10' /><path d='M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20' /><path d='M2 12h20' />\"\n\nexport type SocialPlatform = keyof typeof GLYPH_BODIES\n\n/** The body of the mark — paths only, so a caller can wrap it in its own sized svg. */\nexport function socialGlyphBody(platform: string): string {\n const key = platform.trim().toLowerCase()\n\n return (GLYPH_BODIES as Record<string, string>)[key] ?? GLYPH_ALIASES[key] ?? SOCIAL_GLYPH_FALLBACK\n}\n\n/** A complete mark, ready to drop into an icon slot. Size comes from the surrounding font size. */\nexport function socialGlyphMarkup(platform: string): string {\n return (\n \"<svg xmlns='http://www.w3.org/2000/svg' width='1em' height='1em' viewBox='0 0 24 24' \" +\n \"fill='none' stroke='currentColor' stroke-width='1.5' stroke-linecap='round' \" +\n \"stroke-linejoin='round' aria-hidden='true'>\" +\n socialGlyphBody(platform) +\n \"</svg>\"\n )\n}\n\n/** Platforms this set draws, for a picker or a template listing what it supports. */\nexport function socialGlyphPlatforms(): string[] {\n return Object.keys(GLYPH_BODIES)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACaA,IAAM,eAAe;AAAA,EACnB,UAAU;AAAA,EACV,WAAW;AAAA,EACX,SAAS;AAAA,EACT,UAAU;AAAA,EACV,SAAS;AACX;AAGA,IAAM,gBAAwC;AAAA,EAC5C,KAAK,aAAa;AAAA,EAClB,MAAM,aAAa;AAAA,EACnB,aAAa,aAAa;AAC5B;AAGO,IAAM,wBACX;AAKK,SAAS,gBAAgB,UAA0B;AACxD,QAAM,MAAM,SAAS,KAAK,EAAE,YAAY;AAExC,SAAQ,aAAwC,GAAG,KAAK,cAAc,GAAG,KAAK;AAChF;AAGO,SAAS,kBAAkB,UAA0B;AAC1D,SACE,iNAGA,gBAAgB,QAAQ,IACxB;AAEJ;AAGO,SAAS,uBAAiC;AAC/C,SAAO,OAAO,KAAK,YAAY;AACjC;","names":[]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// src/lib/social-glyphs.ts
|
|
2
|
+
var GLYPH_BODIES = {
|
|
3
|
+
facebook: "<path d='M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z' />",
|
|
4
|
+
instagram: "<rect width='20' height='20' x='2' y='2' rx='5' ry='5' /><path d='M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z' /><line x1='17.5' x2='17.51' y1='6.5' y2='6.5' />",
|
|
5
|
+
youtube: "<path d='M2.5 17a24.12 24.12 0 0 1 0-10 2 2 0 0 1 1.4-1.4 49.56 49.56 0 0 1 16.2 0A2 2 0 0 1 21.5 7a24.12 24.12 0 0 1 0 10 2 2 0 0 1-1.4 1.4 49.55 49.55 0 0 1-16.2 0A2 2 0 0 1 2.5 17' /><path d='m10 15 5-3-5-3z' />",
|
|
6
|
+
linkedin: "<path d='M16 8a6 6 0 0 1 6 6v7h-4v-7a2 2 0 0 0-2-2 2 2 0 0 0-2 2v7h-4v-7a6 6 0 0 1 6-6z' /><rect width='4' height='12' x='2' y='9' /><circle cx='4' cy='4' r='2' />",
|
|
7
|
+
twitter: "<path d='M22 4s-.7 2.1-2 3.4c1.6 10-9.4 17.3-18 11.6 2.2.1 4.4-.6 6-2C3 15.5.5 9.6 3 5c2.2 2.6 5.6 4.1 9 4-.9-4.2 4-6.6 7-3.8 1.1 0 3-1.2 3-1.2z' />"
|
|
8
|
+
};
|
|
9
|
+
var GLYPH_ALIASES = {
|
|
10
|
+
"x": GLYPH_BODIES.twitter,
|
|
11
|
+
"yt": GLYPH_BODIES.youtube,
|
|
12
|
+
"linked-in": GLYPH_BODIES.linkedin
|
|
13
|
+
};
|
|
14
|
+
var SOCIAL_GLYPH_FALLBACK = "<circle cx='12' cy='12' r='10' /><path d='M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20' /><path d='M2 12h20' />";
|
|
15
|
+
function socialGlyphBody(platform) {
|
|
16
|
+
const key = platform.trim().toLowerCase();
|
|
17
|
+
return GLYPH_BODIES[key] ?? GLYPH_ALIASES[key] ?? SOCIAL_GLYPH_FALLBACK;
|
|
18
|
+
}
|
|
19
|
+
function socialGlyphMarkup(platform) {
|
|
20
|
+
return "<svg xmlns='http://www.w3.org/2000/svg' width='1em' height='1em' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' aria-hidden='true'>" + socialGlyphBody(platform) + "</svg>";
|
|
21
|
+
}
|
|
22
|
+
function socialGlyphPlatforms() {
|
|
23
|
+
return Object.keys(GLYPH_BODIES);
|
|
24
|
+
}
|
|
25
|
+
export {
|
|
26
|
+
SOCIAL_GLYPH_FALLBACK,
|
|
27
|
+
socialGlyphBody,
|
|
28
|
+
socialGlyphMarkup,
|
|
29
|
+
socialGlyphPlatforms
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=social-glyphs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/social-glyphs.ts"],"sourcesContent":["/**\n * Brand marks for social rows, drawn once for the whole product.\n *\n * They live here because the bridge is the one thing installed in every template and updated by a\n * single publish. While each side kept its own copy — the editor from one icon package, a template\n * from another or from an outside service — the mark that shipped with a template and the mark the\n * editor inserted came from different sets and looked nothing alike (OHH-762). Anything reading\n * from here cannot drift.\n *\n * Outlines in the lucide hand (ISC licensed): a 24 unit box, strokes on `currentColor`, so a mark\n * takes the colour and size of the words beside it.\n */\n\nconst GLYPH_BODIES = {\n facebook: \"<path d='M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z' />\",\n instagram: \"<rect width='20' height='20' x='2' y='2' rx='5' ry='5' /><path d='M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z' /><line x1='17.5' x2='17.51' y1='6.5' y2='6.5' />\",\n youtube: \"<path d='M2.5 17a24.12 24.12 0 0 1 0-10 2 2 0 0 1 1.4-1.4 49.56 49.56 0 0 1 16.2 0A2 2 0 0 1 21.5 7a24.12 24.12 0 0 1 0 10 2 2 0 0 1-1.4 1.4 49.55 49.55 0 0 1-16.2 0A2 2 0 0 1 2.5 17' /><path d='m10 15 5-3-5-3z' />\",\n linkedin: \"<path d='M16 8a6 6 0 0 1 6 6v7h-4v-7a2 2 0 0 0-2-2 2 2 0 0 0-2 2v7h-4v-7a6 6 0 0 1 6-6z' /><rect width='4' height='12' x='2' y='9' /><circle cx='4' cy='4' r='2' />\",\n twitter: \"<path d='M22 4s-.7 2.1-2 3.4c1.6 10-9.4 17.3-18 11.6 2.2.1 4.4-.6 6-2C3 15.5.5 9.6 3 5c2.2 2.6 5.6 4.1 9 4-.9-4.2 4-6.6 7-3.8 1.1 0 3-1.2 3-1.2z' />\",\n} as const\n\n/** Same mark under the names a template or an owner might use. */\nconst GLYPH_ALIASES: Record<string, string> = {\n 'x': GLYPH_BODIES.twitter,\n 'yt': GLYPH_BODIES.youtube,\n 'linked-in': GLYPH_BODIES.linkedin,\n}\n\n/** Drawn for a platform we ship no mark for — a link is still a link. */\nexport const SOCIAL_GLYPH_FALLBACK =\n \"<circle cx='12' cy='12' r='10' /><path d='M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20' /><path d='M2 12h20' />\"\n\nexport type SocialPlatform = keyof typeof GLYPH_BODIES\n\n/** The body of the mark — paths only, so a caller can wrap it in its own sized svg. */\nexport function socialGlyphBody(platform: string): string {\n const key = platform.trim().toLowerCase()\n\n return (GLYPH_BODIES as Record<string, string>)[key] ?? GLYPH_ALIASES[key] ?? SOCIAL_GLYPH_FALLBACK\n}\n\n/** A complete mark, ready to drop into an icon slot. Size comes from the surrounding font size. */\nexport function socialGlyphMarkup(platform: string): string {\n return (\n \"<svg xmlns='http://www.w3.org/2000/svg' width='1em' height='1em' viewBox='0 0 24 24' \" +\n \"fill='none' stroke='currentColor' stroke-width='1.5' stroke-linecap='round' \" +\n \"stroke-linejoin='round' aria-hidden='true'>\" +\n socialGlyphBody(platform) +\n \"</svg>\"\n )\n}\n\n/** Platforms this set draws, for a picker or a template listing what it supports. */\nexport function socialGlyphPlatforms(): string[] {\n return Object.keys(GLYPH_BODIES)\n}\n"],"mappings":";AAaA,IAAM,eAAe;AAAA,EACnB,UAAU;AAAA,EACV,WAAW;AAAA,EACX,SAAS;AAAA,EACT,UAAU;AAAA,EACV,SAAS;AACX;AAGA,IAAM,gBAAwC;AAAA,EAC5C,KAAK,aAAa;AAAA,EAClB,MAAM,aAAa;AAAA,EACnB,aAAa,aAAa;AAC5B;AAGO,IAAM,wBACX;AAKK,SAAS,gBAAgB,UAA0B;AACxD,QAAM,MAAM,SAAS,KAAK,EAAE,YAAY;AAExC,SAAQ,aAAwC,GAAG,KAAK,cAAc,GAAG,KAAK;AAChF;AAGO,SAAS,kBAAkB,UAA0B;AAC1D,SACE,iNAGA,gBAAgB,QAAQ,IACxB;AAEJ;AAGO,SAAS,uBAAiC;AAC/C,SAAO,OAAO,KAAK,YAAY;AACjC;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ohhwells/bridge",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.72",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -12,7 +12,12 @@
|
|
|
12
12
|
"import": "./dist/index.js",
|
|
13
13
|
"require": "./dist/index.cjs"
|
|
14
14
|
},
|
|
15
|
-
"./styles": "./dist/styles.css"
|
|
15
|
+
"./styles": "./dist/styles.css",
|
|
16
|
+
"./social-glyphs": {
|
|
17
|
+
"types": "./dist/social-glyphs.d.ts",
|
|
18
|
+
"import": "./dist/social-glyphs.js",
|
|
19
|
+
"require": "./dist/social-glyphs.cjs"
|
|
20
|
+
}
|
|
16
21
|
},
|
|
17
22
|
"files": [
|
|
18
23
|
"dist"
|