@selfhelp/shared 1.0.1 → 1.0.4

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.
@@ -1182,23 +1182,40 @@ interface IStyleWithSpacing extends IBaseStyle {
1182
1182
  }
1183
1183
 
1184
1184
  /**
1185
- * STYLE_REGISTRY — single source of truth for every supported user-facing
1186
- * style. Both the web and mobile renderers import this map and TypeScript
1187
- * forces them to provide an implementation for each key (see
1188
- * `createStyleImplMap` in `index.ts`).
1185
+ * Style registry — the runtime catalog of every CMS style the SelfHelp
1186
+ * ecosystem can render.
1189
1187
  *
1190
- * Adding a new style:
1188
+ * It has two halves:
1189
+ *
1190
+ * `BASE_STYLE_REGISTRY` — closed, compile-time-constant catalog of core
1191
+ * styles shipped by this package. Used to derive the `TStyleName`
1192
+ * union and to give renderers compile-time coverage of every core
1193
+ * style.
1194
+ *
1195
+ * `PLUGIN_STYLE_REGISTRY` — runtime-mutable map populated by plugin
1196
+ * packages through `extendStyleRegistry()` at boot. Plugin entries
1197
+ * are tagged with their `pluginId` so the renderer can show
1198
+ * "Open on web" fallbacks for backend-declared styles that the
1199
+ * current build does not bundle.
1200
+ *
1201
+ * Adding a *core* style:
1191
1202
  * 1. Add the per-style interface in `src/types/styles/<group>.ts`.
1192
1203
  * 2. Extend `TStyle` in `src/types/styles/unknown.ts`.
1193
- * 3. Add the entry below.
1204
+ * 3. Add the entry to `BASE_STYLE_REGISTRY` below.
1194
1205
  * 4. Both apps will fail to compile until they add an impl.
1206
+ *
1207
+ * Adding a *plugin* style:
1208
+ * The plugin's `definePlugin()` call goes through
1209
+ * `@selfhelp/shared/plugin-sdk`, which routes the entries to
1210
+ * `extendStyleRegistry()` internally. Do not edit this file for plugin
1211
+ * styles.
1195
1212
  */
1196
1213
 
1197
1214
  interface IStyleRegistryEntry {
1198
1215
  /** Human description for docs / tooling. */
1199
1216
  description: string;
1200
1217
  /** UX category for grouping in tools / cookbook. */
1201
- category: 'auth' | 'layout' | 'typography' | 'media' | 'interactive' | 'forms' | 'composite';
1218
+ category: 'auth' | 'layout' | 'typography' | 'media' | 'interactive' | 'forms' | 'composite' | 'plugin';
1202
1219
  /**
1203
1220
  * Whether the style is intended for end-user pages. Mobile renders
1204
1221
  * only `frontendOnly: true` styles. Today every entry below is true;
@@ -1213,9 +1230,519 @@ interface IStyleRegistryEntry {
1213
1230
  canHaveChildren: boolean;
1214
1231
  }
1215
1232
  /**
1216
- * Single-source registry. Keys here drive `TStyleName` (declared in
1233
+ * Plugin-contributed registry entry. Same shape as the base entry plus
1234
+ * the owning `pluginId`, used by renderers to decide on fallbacks.
1235
+ */
1236
+ interface IPluginStyleRegistryEntry extends IStyleRegistryEntry {
1237
+ /** Plugin that registered this style (e.g. `sh2-shp-survey-js`). */
1238
+ pluginId: string;
1239
+ /** Source plugin package version, useful for diagnostics. */
1240
+ pluginVersion?: string;
1241
+ }
1242
+ /**
1243
+ * Compile-time core registry. Keys here drive `TStyleName` (declared in
1217
1244
  * `types/styles/unknown.ts`); both files must stay in sync.
1218
1245
  */
1246
+ declare const BASE_STYLE_REGISTRY: {
1247
+ readonly login: {
1248
+ readonly description: "User login form";
1249
+ readonly category: "auth";
1250
+ readonly frontendOnly: true;
1251
+ readonly canHaveChildren: false;
1252
+ };
1253
+ readonly register: {
1254
+ readonly description: "User registration form";
1255
+ readonly category: "auth";
1256
+ readonly frontendOnly: true;
1257
+ readonly canHaveChildren: false;
1258
+ };
1259
+ readonly validate: {
1260
+ readonly description: "Email/account validation flow";
1261
+ readonly category: "auth";
1262
+ readonly frontendOnly: true;
1263
+ readonly canHaveChildren: true;
1264
+ };
1265
+ readonly resetPassword: {
1266
+ readonly description: "Reset password form";
1267
+ readonly category: "auth";
1268
+ readonly frontendOnly: true;
1269
+ readonly canHaveChildren: false;
1270
+ };
1271
+ readonly twoFactorAuth: {
1272
+ readonly description: "Two-factor auth code form";
1273
+ readonly category: "auth";
1274
+ readonly frontendOnly: true;
1275
+ readonly canHaveChildren: false;
1276
+ };
1277
+ readonly profile: {
1278
+ readonly description: "User profile management";
1279
+ readonly category: "auth";
1280
+ readonly frontendOnly: true;
1281
+ readonly canHaveChildren: false;
1282
+ };
1283
+ readonly container: {
1284
+ readonly description: "Mantine Container with responsive max-width";
1285
+ readonly category: "layout";
1286
+ readonly frontendOnly: true;
1287
+ readonly canHaveChildren: true;
1288
+ };
1289
+ readonly box: {
1290
+ readonly description: "Generic Mantine Box wrapper";
1291
+ readonly category: "layout";
1292
+ readonly frontendOnly: true;
1293
+ readonly canHaveChildren: true;
1294
+ };
1295
+ readonly flex: {
1296
+ readonly description: "Mantine Flex layout";
1297
+ readonly category: "layout";
1298
+ readonly frontendOnly: true;
1299
+ readonly canHaveChildren: true;
1300
+ };
1301
+ readonly group: {
1302
+ readonly description: "Mantine Group horizontal layout";
1303
+ readonly category: "layout";
1304
+ readonly frontendOnly: true;
1305
+ readonly canHaveChildren: true;
1306
+ };
1307
+ readonly stack: {
1308
+ readonly description: "Mantine Stack vertical layout";
1309
+ readonly category: "layout";
1310
+ readonly frontendOnly: true;
1311
+ readonly canHaveChildren: true;
1312
+ };
1313
+ readonly 'simple-grid': {
1314
+ readonly description: "Mantine SimpleGrid";
1315
+ readonly category: "layout";
1316
+ readonly frontendOnly: true;
1317
+ readonly canHaveChildren: true;
1318
+ };
1319
+ readonly grid: {
1320
+ readonly description: "Mantine Grid";
1321
+ readonly category: "layout";
1322
+ readonly frontendOnly: true;
1323
+ readonly canHaveChildren: true;
1324
+ };
1325
+ readonly 'grid-column': {
1326
+ readonly description: "Mantine Grid.Col";
1327
+ readonly category: "layout";
1328
+ readonly frontendOnly: true;
1329
+ readonly canHaveChildren: true;
1330
+ };
1331
+ readonly space: {
1332
+ readonly description: "Mantine Space spacer";
1333
+ readonly category: "layout";
1334
+ readonly frontendOnly: true;
1335
+ readonly canHaveChildren: false;
1336
+ };
1337
+ readonly divider: {
1338
+ readonly description: "Mantine Divider";
1339
+ readonly category: "layout";
1340
+ readonly frontendOnly: true;
1341
+ readonly canHaveChildren: false;
1342
+ };
1343
+ readonly paper: {
1344
+ readonly description: "Mantine Paper surface";
1345
+ readonly category: "layout";
1346
+ readonly frontendOnly: true;
1347
+ readonly canHaveChildren: true;
1348
+ };
1349
+ readonly center: {
1350
+ readonly description: "Mantine Center alignment";
1351
+ readonly category: "layout";
1352
+ readonly frontendOnly: true;
1353
+ readonly canHaveChildren: true;
1354
+ };
1355
+ readonly 'scroll-area': {
1356
+ readonly description: "Mantine ScrollArea";
1357
+ readonly category: "layout";
1358
+ readonly frontendOnly: true;
1359
+ readonly canHaveChildren: true;
1360
+ };
1361
+ readonly card: {
1362
+ readonly description: "Mantine Card";
1363
+ readonly category: "layout";
1364
+ readonly frontendOnly: true;
1365
+ readonly canHaveChildren: true;
1366
+ };
1367
+ readonly 'card-segment': {
1368
+ readonly description: "Mantine Card.Section";
1369
+ readonly category: "layout";
1370
+ readonly frontendOnly: true;
1371
+ readonly canHaveChildren: true;
1372
+ };
1373
+ readonly 'aspect-ratio': {
1374
+ readonly description: "Mantine AspectRatio wrapper";
1375
+ readonly category: "layout";
1376
+ readonly frontendOnly: true;
1377
+ readonly canHaveChildren: true;
1378
+ };
1379
+ readonly 'background-image': {
1380
+ readonly description: "Mantine BackgroundImage";
1381
+ readonly category: "layout";
1382
+ readonly frontendOnly: true;
1383
+ readonly canHaveChildren: true;
1384
+ };
1385
+ readonly title: {
1386
+ readonly description: "Mantine Title";
1387
+ readonly category: "typography";
1388
+ readonly frontendOnly: true;
1389
+ readonly canHaveChildren: false;
1390
+ };
1391
+ readonly text: {
1392
+ readonly description: "Mantine Text";
1393
+ readonly category: "typography";
1394
+ readonly frontendOnly: true;
1395
+ readonly canHaveChildren: false;
1396
+ };
1397
+ readonly code: {
1398
+ readonly description: "Mantine Code (inline / block)";
1399
+ readonly category: "typography";
1400
+ readonly frontendOnly: true;
1401
+ readonly canHaveChildren: false;
1402
+ };
1403
+ readonly highlight: {
1404
+ readonly description: "Mantine Highlight";
1405
+ readonly category: "typography";
1406
+ readonly frontendOnly: true;
1407
+ readonly canHaveChildren: false;
1408
+ };
1409
+ readonly blockquote: {
1410
+ readonly description: "Mantine Blockquote";
1411
+ readonly category: "typography";
1412
+ readonly frontendOnly: true;
1413
+ readonly canHaveChildren: false;
1414
+ };
1415
+ readonly 'html-tag': {
1416
+ readonly description: "Generic HTML tag wrapper (web), maps to View on RN";
1417
+ readonly category: "typography";
1418
+ readonly frontendOnly: true;
1419
+ readonly canHaveChildren: true;
1420
+ };
1421
+ readonly kbd: {
1422
+ readonly description: "Mantine Kbd";
1423
+ readonly category: "typography";
1424
+ readonly frontendOnly: true;
1425
+ readonly canHaveChildren: false;
1426
+ };
1427
+ readonly typography: {
1428
+ readonly description: "Mantine Typography wrapper";
1429
+ readonly category: "typography";
1430
+ readonly frontendOnly: true;
1431
+ readonly canHaveChildren: true;
1432
+ };
1433
+ readonly fieldset: {
1434
+ readonly description: "Mantine Fieldset";
1435
+ readonly category: "typography";
1436
+ readonly frontendOnly: true;
1437
+ readonly canHaveChildren: true;
1438
+ };
1439
+ readonly spoiler: {
1440
+ readonly description: "Mantine Spoiler reveal";
1441
+ readonly category: "typography";
1442
+ readonly frontendOnly: true;
1443
+ readonly canHaveChildren: true;
1444
+ };
1445
+ readonly image: {
1446
+ readonly description: "Mantine Image / RN Image";
1447
+ readonly category: "media";
1448
+ readonly frontendOnly: true;
1449
+ readonly canHaveChildren: false;
1450
+ };
1451
+ readonly video: {
1452
+ readonly description: "HTML5 video / expo-video";
1453
+ readonly category: "media";
1454
+ readonly frontendOnly: true;
1455
+ readonly canHaveChildren: false;
1456
+ };
1457
+ readonly audio: {
1458
+ readonly description: "HTML5 audio / expo-audio";
1459
+ readonly category: "media";
1460
+ readonly frontendOnly: true;
1461
+ readonly canHaveChildren: false;
1462
+ };
1463
+ readonly figure: {
1464
+ readonly description: "Figure with caption";
1465
+ readonly category: "media";
1466
+ readonly frontendOnly: true;
1467
+ readonly canHaveChildren: true;
1468
+ };
1469
+ readonly carousel: {
1470
+ readonly description: "Embla on web, reanimated-carousel on RN";
1471
+ readonly category: "media";
1472
+ readonly frontendOnly: true;
1473
+ readonly canHaveChildren: true;
1474
+ };
1475
+ readonly button: {
1476
+ readonly description: "Mantine Button / HeroUI Button";
1477
+ readonly category: "interactive";
1478
+ readonly frontendOnly: true;
1479
+ readonly canHaveChildren: false;
1480
+ };
1481
+ readonly link: {
1482
+ readonly description: "Anchor / Pressable navigation";
1483
+ readonly category: "interactive";
1484
+ readonly frontendOnly: true;
1485
+ readonly canHaveChildren: false;
1486
+ };
1487
+ readonly 'action-icon': {
1488
+ readonly description: "Mantine ActionIcon";
1489
+ readonly category: "interactive";
1490
+ readonly frontendOnly: true;
1491
+ readonly canHaveChildren: false;
1492
+ };
1493
+ readonly alert: {
1494
+ readonly description: "Mantine Alert";
1495
+ readonly category: "interactive";
1496
+ readonly frontendOnly: true;
1497
+ readonly canHaveChildren: true;
1498
+ };
1499
+ readonly badge: {
1500
+ readonly description: "Mantine Badge";
1501
+ readonly category: "interactive";
1502
+ readonly frontendOnly: true;
1503
+ readonly canHaveChildren: false;
1504
+ };
1505
+ readonly avatar: {
1506
+ readonly description: "Mantine Avatar";
1507
+ readonly category: "interactive";
1508
+ readonly frontendOnly: true;
1509
+ readonly canHaveChildren: false;
1510
+ };
1511
+ readonly chip: {
1512
+ readonly description: "Mantine Chip";
1513
+ readonly category: "interactive";
1514
+ readonly frontendOnly: true;
1515
+ readonly canHaveChildren: false;
1516
+ };
1517
+ readonly indicator: {
1518
+ readonly description: "Mantine Indicator dot";
1519
+ readonly category: "interactive";
1520
+ readonly frontendOnly: true;
1521
+ readonly canHaveChildren: true;
1522
+ };
1523
+ readonly 'theme-icon': {
1524
+ readonly description: "Mantine ThemeIcon";
1525
+ readonly category: "interactive";
1526
+ readonly frontendOnly: true;
1527
+ readonly canHaveChildren: false;
1528
+ };
1529
+ readonly notification: {
1530
+ readonly description: "Mantine Notification";
1531
+ readonly category: "interactive";
1532
+ readonly frontendOnly: true;
1533
+ readonly canHaveChildren: false;
1534
+ };
1535
+ readonly 'form-log': {
1536
+ readonly description: "Append-only form (one row per submit)";
1537
+ readonly category: "forms";
1538
+ readonly frontendOnly: true;
1539
+ readonly canHaveChildren: true;
1540
+ };
1541
+ readonly 'form-record': {
1542
+ readonly description: "Per-user record form";
1543
+ readonly category: "forms";
1544
+ readonly frontendOnly: true;
1545
+ readonly canHaveChildren: true;
1546
+ };
1547
+ readonly input: {
1548
+ readonly description: "Plain HTML input";
1549
+ readonly category: "forms";
1550
+ readonly frontendOnly: true;
1551
+ readonly canHaveChildren: false;
1552
+ };
1553
+ readonly 'text-input': {
1554
+ readonly description: "Mantine TextInput";
1555
+ readonly category: "forms";
1556
+ readonly frontendOnly: true;
1557
+ readonly canHaveChildren: false;
1558
+ };
1559
+ readonly textarea: {
1560
+ readonly description: "Mantine Textarea";
1561
+ readonly category: "forms";
1562
+ readonly frontendOnly: true;
1563
+ readonly canHaveChildren: false;
1564
+ };
1565
+ readonly 'rich-text-editor': {
1566
+ readonly description: "Tiptap editor on web; READ-ONLY viewer on mobile v1";
1567
+ readonly category: "forms";
1568
+ readonly frontendOnly: true;
1569
+ readonly canHaveChildren: false;
1570
+ };
1571
+ readonly select: {
1572
+ readonly description: "HTML select / Mantine Select";
1573
+ readonly category: "forms";
1574
+ readonly frontendOnly: true;
1575
+ readonly canHaveChildren: false;
1576
+ };
1577
+ readonly radio: {
1578
+ readonly description: "Mantine Radio / RadioGroup";
1579
+ readonly category: "forms";
1580
+ readonly frontendOnly: true;
1581
+ readonly canHaveChildren: false;
1582
+ };
1583
+ readonly checkbox: {
1584
+ readonly description: "Mantine Checkbox";
1585
+ readonly category: "forms";
1586
+ readonly frontendOnly: true;
1587
+ readonly canHaveChildren: false;
1588
+ };
1589
+ readonly slider: {
1590
+ readonly description: "Mantine Slider";
1591
+ readonly category: "forms";
1592
+ readonly frontendOnly: true;
1593
+ readonly canHaveChildren: false;
1594
+ };
1595
+ readonly 'range-slider': {
1596
+ readonly description: "Mantine RangeSlider";
1597
+ readonly category: "forms";
1598
+ readonly frontendOnly: true;
1599
+ readonly canHaveChildren: false;
1600
+ };
1601
+ readonly datepicker: {
1602
+ readonly description: "Mantine DatePicker";
1603
+ readonly category: "forms";
1604
+ readonly frontendOnly: true;
1605
+ readonly canHaveChildren: false;
1606
+ };
1607
+ readonly switch: {
1608
+ readonly description: "Mantine Switch";
1609
+ readonly category: "forms";
1610
+ readonly frontendOnly: true;
1611
+ readonly canHaveChildren: false;
1612
+ };
1613
+ readonly combobox: {
1614
+ readonly description: "Mantine Combobox";
1615
+ readonly category: "forms";
1616
+ readonly frontendOnly: true;
1617
+ readonly canHaveChildren: false;
1618
+ };
1619
+ readonly 'color-input': {
1620
+ readonly description: "Mantine ColorInput";
1621
+ readonly category: "forms";
1622
+ readonly frontendOnly: true;
1623
+ readonly canHaveChildren: false;
1624
+ };
1625
+ readonly 'color-picker': {
1626
+ readonly description: "Mantine ColorPicker";
1627
+ readonly category: "forms";
1628
+ readonly frontendOnly: true;
1629
+ readonly canHaveChildren: false;
1630
+ };
1631
+ readonly 'file-input': {
1632
+ readonly description: "Mantine FileInput / DocumentPicker on RN";
1633
+ readonly category: "forms";
1634
+ readonly frontendOnly: true;
1635
+ readonly canHaveChildren: false;
1636
+ };
1637
+ readonly 'number-input': {
1638
+ readonly description: "Mantine NumberInput";
1639
+ readonly category: "forms";
1640
+ readonly frontendOnly: true;
1641
+ readonly canHaveChildren: false;
1642
+ };
1643
+ readonly 'segmented-control': {
1644
+ readonly description: "Mantine SegmentedControl";
1645
+ readonly category: "forms";
1646
+ readonly frontendOnly: true;
1647
+ readonly canHaveChildren: false;
1648
+ };
1649
+ readonly rating: {
1650
+ readonly description: "Mantine Rating";
1651
+ readonly category: "forms";
1652
+ readonly frontendOnly: true;
1653
+ readonly canHaveChildren: false;
1654
+ };
1655
+ readonly progress: {
1656
+ readonly description: "Mantine Progress";
1657
+ readonly category: "forms";
1658
+ readonly frontendOnly: true;
1659
+ readonly canHaveChildren: false;
1660
+ };
1661
+ readonly 'progress-root': {
1662
+ readonly description: "Mantine Progress.Root";
1663
+ readonly category: "forms";
1664
+ readonly frontendOnly: true;
1665
+ readonly canHaveChildren: true;
1666
+ };
1667
+ readonly 'progress-section': {
1668
+ readonly description: "Mantine Progress.Section";
1669
+ readonly category: "forms";
1670
+ readonly frontendOnly: true;
1671
+ readonly canHaveChildren: false;
1672
+ };
1673
+ readonly accordion: {
1674
+ readonly description: "Mantine Accordion";
1675
+ readonly category: "composite";
1676
+ readonly frontendOnly: true;
1677
+ readonly canHaveChildren: true;
1678
+ };
1679
+ readonly 'accordion-item': {
1680
+ readonly description: "Mantine Accordion.Item";
1681
+ readonly category: "composite";
1682
+ readonly frontendOnly: true;
1683
+ readonly canHaveChildren: true;
1684
+ };
1685
+ readonly tabs: {
1686
+ readonly description: "Mantine Tabs";
1687
+ readonly category: "composite";
1688
+ readonly frontendOnly: true;
1689
+ readonly canHaveChildren: true;
1690
+ };
1691
+ readonly tab: {
1692
+ readonly description: "Mantine Tabs.Tab + Tabs.Panel pair";
1693
+ readonly category: "composite";
1694
+ readonly frontendOnly: true;
1695
+ readonly canHaveChildren: true;
1696
+ };
1697
+ readonly timeline: {
1698
+ readonly description: "Mantine Timeline";
1699
+ readonly category: "composite";
1700
+ readonly frontendOnly: true;
1701
+ readonly canHaveChildren: true;
1702
+ };
1703
+ readonly list: {
1704
+ readonly description: "Mantine List";
1705
+ readonly category: "composite";
1706
+ readonly frontendOnly: true;
1707
+ readonly canHaveChildren: true;
1708
+ };
1709
+ readonly 'list-item': {
1710
+ readonly description: "Mantine List.Item";
1711
+ readonly category: "composite";
1712
+ readonly frontendOnly: true;
1713
+ readonly canHaveChildren: true;
1714
+ };
1715
+ readonly entryList: {
1716
+ readonly description: "Data-driven list of entries (form-log table)";
1717
+ readonly category: "composite";
1718
+ readonly frontendOnly: true;
1719
+ readonly canHaveChildren: true;
1720
+ };
1721
+ readonly entryRecord: {
1722
+ readonly description: "Single-record container";
1723
+ readonly category: "composite";
1724
+ readonly frontendOnly: true;
1725
+ readonly canHaveChildren: true;
1726
+ };
1727
+ readonly entryRecordDelete: {
1728
+ readonly description: "Inline delete confirmation for an entry";
1729
+ readonly category: "composite";
1730
+ readonly frontendOnly: true;
1731
+ readonly canHaveChildren: false;
1732
+ };
1733
+ readonly loop: {
1734
+ readonly description: "Loop / repeater over backend-provided rows";
1735
+ readonly category: "composite";
1736
+ readonly frontendOnly: true;
1737
+ readonly canHaveChildren: true;
1738
+ };
1739
+ };
1740
+ /**
1741
+ * Backward-compatible alias for the core registry. Pre-plugin code
1742
+ * imported `STYLE_REGISTRY`; that import still works and still resolves
1743
+ * to the closed core map. Plugin-aware code should call
1744
+ * `getMergedStyleRegistry()` to see plugin entries too.
1745
+ */
1219
1746
  declare const STYLE_REGISTRY: {
1220
1747
  readonly login: {
1221
1748
  readonly description: "User login form";
@@ -1710,34 +2237,48 @@ declare const STYLE_REGISTRY: {
1710
2237
  readonly canHaveChildren: true;
1711
2238
  };
1712
2239
  };
1713
- type TStyleRegistryKey = keyof typeof STYLE_REGISTRY;
2240
+ type TStyleRegistryKey = keyof typeof BASE_STYLE_REGISTRY;
1714
2241
  /**
1715
- * Compile-time guard: every key in the registry must be a valid TStyleName,
1716
- * and every TStyleName must be a registry key.
2242
+ * Compile-time guard: every key in the core registry must be a valid
2243
+ * core TStyleName, and every core TStyleName must be a core registry
2244
+ * key. Plugin styles intentionally bypass this check (they live in
2245
+ * `PLUGIN_STYLE_REGISTRY`).
1717
2246
  */
1718
2247
  type _AssertRegistryMatchesStyleName = TStyleName extends TStyleRegistryKey ? TStyleRegistryKey extends TStyleName ? true : never : never;
1719
-
1720
2248
  /**
1721
- * Helper for renderers: produces a typed map shape that requires every
1722
- * registry key to be implemented. Pass this to your dispatcher and let
1723
- * TypeScript enforce 100% style coverage.
2249
+ * Register additional CMS styles contributed by a plugin. Called from
2250
+ * `definePlugin()` inside `@selfhelp/shared/plugin-sdk`; plugins should
2251
+ * not call this directly.
1724
2252
  *
1725
- * type IStyleImpls = TStyleImplMap<React.FC<{ style: TStyle }>>;
1726
- *
1727
- * `keyof TStyleImplMap<...>` is exactly the union of style names.
2253
+ * Rules:
2254
+ * - Plugin style names must not collide with `BASE_STYLE_REGISTRY`.
2255
+ * - Plugin style names must not collide with any other plugin's
2256
+ * already-registered styles.
2257
+ * - Returns a disposer that removes the entries (used by uninstall
2258
+ * and tests).
1728
2259
  */
1729
- type TStyleImplMap<TImpl> = {
1730
- readonly [K in TStyleName]: TImpl;
1731
- };
2260
+ declare function extendStyleRegistry(entries: Record<string, IStyleRegistryEntry>, options: {
2261
+ pluginId: string;
2262
+ pluginVersion?: string;
2263
+ }): () => void;
1732
2264
  /**
1733
- * Get an entry from the registry safely. Returns undefined if the
1734
- * style_name isn't registered (the renderer should fall back to
1735
- * UnknownStyle).
2265
+ * Live merged registry: core entries plus plugin-contributed entries.
2266
+ * Plugin entries override nothing — collisions throw in
2267
+ * `extendStyleRegistry` — so this map is safe to consume directly.
1736
2268
  */
1737
- declare function getRegistryEntry(name: string): (typeof STYLE_REGISTRY)[TStyleName] | undefined;
2269
+ declare function getMergedStyleRegistry(): Record<string, IStyleRegistryEntry | IPluginStyleRegistryEntry>;
1738
2270
  /**
1739
- * Type guard to narrow a string to TStyleName.
2271
+ * Return only the plugin half of the registry. Useful for the renderer
2272
+ * to decide which styles need a fallback ("Open on web" on mobile) and
2273
+ * which `pluginId` they belong to.
2274
+ */
2275
+ declare function getPluginStyleRegistry(): Record<string, IPluginStyleRegistryEntry>;
2276
+ /**
2277
+ * Test-only helper: wipe every plugin contribution. Not exported from
2278
+ * the package root; available through the plugin SDK testing module.
2279
+ *
2280
+ * @internal
1740
2281
  */
1741
- declare function isKnownStyleName(name: string): name is TStyleName;
2282
+ declare function _resetPluginStyleRegistry(): void;
1742
2283
 
1743
- export { type INumberInputStyle as $, type IEntryListStyle as A, type IEntryRecordDeleteStyle as B, type IEntryRecordStyle as C, type IFieldsetStyle as D, type IFigureStyle as E, type IFileInputStyle as F, type IFlexStyle as G, type IFormLogStyle as H, type IContentField as I, type IFormRecordStyle as J, type IFormStyle as K, type IGridColumnStyle as L, type IGridStyle as M, type IGroupStyle as N, type IHighlightStyle as O, type IHtmlTagStyle as P, type IImageStyle as Q, type IIndicatorStyle as R, type IInputStyle as S, type TStyleName as T, type IKbdStyle as U, type ILinkStyle as V, type IListItemStyle as W, type IListStyle as X, type ILoginStyle as Y, type ILoopStyle as Z, type INotificationStyle as _, type IAccordionItemStyle as a, type TMantineTextFontWeight as a$, type IPaperStyle as a0, type IProfileStyle as a1, type IProgressRootStyle as a2, type IProgressSectionStyle as a3, type IProgressStyle as a4, type IRadioStyle as a5, type IRangeSliderStyle as a6, type IRatingStyle as a7, type IRegisterStyle as a8, type IResetPasswordStyle as a9, type TMantineAccordionChevronPosition as aA, type TMantineAccordionDisableChevronRotation as aB, type TMantineAccordionLoop as aC, type TMantineAccordionMultiple as aD, type TMantineBorder as aE, type TMantineCardShadow as aF, type TMantineCheckboxLabelPosition as aG, type TMantineCols as aH, type TMantineDividerVariant as aI, type TMantineGap as aJ, type TMantineGridOffset as aK, type TMantineGridOrder as aL, type TMantineHeight as aM, type TMantineIconSize as aN, type TMantineImageFit as aO, type TMantineLineClamp as aP, type TMantineListCenter as aQ, type TMantineListStyleType as aR, type TMantineListType as aS, type TMantineListWithPadding as aT, type TMantinePaperShadow as aU, type TMantineProgressTransition as aV, type TMantineScrollAreaSize as aW, type TMantineScrollAreaType as aX, type TMantineTextAlign as aY, type TMantineTextDecoration as aZ, type TMantineTextFontStyle as a_, type IRichTextEditorStyle as aa, type IScrollAreaStyle as ab, type ISegmentedControlStyle as ac, type ISelectStyle as ad, type ISimpleGridStyle as ae, type ISliderStyle as af, type ISpaceStyle as ag, type ISpoilerStyle as ah, type IStackStyle as ai, type IStyleRegistryEntry as aj, type IStyleWithSpacing as ak, type ISwitchStyle as al, type ITabStyle as am, type ITabsStyle as an, type ITextInputStyle as ao, type ITextStyle as ap, type ITextareaStyle as aq, type IThemeIconStyle as ar, type ITimelineStyle as as, type ITitleStyle as at, type ITwoFactorAuthStyle as au, type ITypographyStyle as av, type IUnknownStyle as aw, type IValidateStyle as ax, type IVideoStyle as ay, STYLE_REGISTRY as az, type IAccordionStyle as b, type TMantineTextInherit as b0, type TMantineTextInputVariant as b1, type TMantineTextSpan as b2, type TMantineTextTransform as b3, type TMantineTextTruncate as b4, type TMantineTextVariant as b5, type TMantineTextareaAutosize as b6, type TMantineTextareaResize as b7, type TMantineTextareaVariant as b8, type TMantineTimelineAlign as b9, type TMantineTitleLineClamp as ba, type TMantineTitleTextWrap as bb, type TMantineTranslatable as bc, type TMantineUseInputWrapper as bd, type TMantineWidth as be, type TStyle as bf, type TStyleImplMap as bg, type TStyleRegistryKey as bh, type _AssertRegistryMatchesStyleName as bi, getRegistryEntry as bj, isKnownStyleName as bk, type IActionIconStyle as c, type IAlertStyle as d, type IAspectRatioStyle as e, type IAudioStyle as f, type IAvatarStyle as g, type IBackgroundImageStyle as h, type IBadgeStyle as i, type IBaseStyle as j, type IBlockquoteStyle as k, type IBoxStyle as l, type IButtonStyle as m, type ICardSegmentStyle as n, type ICardStyle as o, type ICarouselStyle as p, type ICenterStyle as q, type ICheckboxStyle as r, type IChipStyle as s, type ICodeStyle as t, type IColorInputStyle as u, type IColorPickerStyle as v, type IComboboxStyle as w, type IContainerStyle as x, type IDatePickerStyle as y, type IDividerStyle as z };
2284
+ export { type IImageStyle as $, type ICodeStyle as A, BASE_STYLE_REGISTRY as B, type IColorInputStyle as C, type IColorPickerStyle as D, type IComboboxStyle as E, type IContainerStyle as F, type IDatePickerStyle as G, type IDividerStyle as H, type IStyleRegistryEntry as I, type IEntryListStyle as J, type IEntryRecordDeleteStyle as K, type IEntryRecordStyle as L, type IFieldsetStyle as M, type IFigureStyle as N, type IFileInputStyle as O, type IFlexStyle as P, type IFormLogStyle as Q, type IFormRecordStyle as R, STYLE_REGISTRY as S, type TStyleName as T, type IFormStyle as U, type IGridColumnStyle as V, type IGridStyle as W, type IGroupStyle as X, type IHighlightStyle as Y, type IHtmlTagStyle as Z, type _AssertRegistryMatchesStyleName as _, type IPluginStyleRegistryEntry as a, type TMantineListWithPadding as a$, type IIndicatorStyle as a0, type IInputStyle as a1, type IKbdStyle as a2, type ILinkStyle as a3, type IListItemStyle as a4, type IListStyle as a5, type ILoginStyle as a6, type ILoopStyle as a7, type INotificationStyle as a8, type INumberInputStyle as a9, type IThemeIconStyle as aA, type ITimelineStyle as aB, type ITitleStyle as aC, type ITwoFactorAuthStyle as aD, type ITypographyStyle as aE, type IUnknownStyle as aF, type IValidateStyle as aG, type IVideoStyle as aH, type TMantineAccordionChevronPosition as aI, type TMantineAccordionDisableChevronRotation as aJ, type TMantineAccordionLoop as aK, type TMantineAccordionMultiple as aL, type TMantineBorder as aM, type TMantineCardShadow as aN, type TMantineCheckboxLabelPosition as aO, type TMantineCols as aP, type TMantineDividerVariant as aQ, type TMantineGap as aR, type TMantineGridOffset as aS, type TMantineGridOrder as aT, type TMantineHeight as aU, type TMantineIconSize as aV, type TMantineImageFit as aW, type TMantineLineClamp as aX, type TMantineListCenter as aY, type TMantineListStyleType as aZ, type TMantineListType as a_, type IPaperStyle as aa, type IProfileStyle as ab, type IProgressRootStyle as ac, type IProgressSectionStyle as ad, type IProgressStyle as ae, type IRadioStyle as af, type IRangeSliderStyle as ag, type IRatingStyle as ah, type IRegisterStyle as ai, type IResetPasswordStyle as aj, type IRichTextEditorStyle as ak, type IScrollAreaStyle as al, type ISegmentedControlStyle as am, type ISelectStyle as an, type ISimpleGridStyle as ao, type ISliderStyle as ap, type ISpaceStyle as aq, type ISpoilerStyle as ar, type IStackStyle as as, type IStyleWithSpacing as at, type ISwitchStyle as au, type ITabStyle as av, type ITabsStyle as aw, type ITextInputStyle as ax, type ITextStyle as ay, type ITextareaStyle as az, type TStyleRegistryKey as b, type TMantinePaperShadow as b0, type TMantineProgressTransition as b1, type TMantineScrollAreaSize as b2, type TMantineScrollAreaType as b3, type TMantineTextAlign as b4, type TMantineTextDecoration as b5, type TMantineTextFontStyle as b6, type TMantineTextFontWeight as b7, type TMantineTextInherit as b8, type TMantineTextInputVariant as b9, type TMantineTextSpan as ba, type TMantineTextTransform as bb, type TMantineTextTruncate as bc, type TMantineTextVariant as bd, type TMantineTextareaAutosize as be, type TMantineTextareaResize as bf, type TMantineTextareaVariant as bg, type TMantineTimelineAlign as bh, type TMantineTitleLineClamp as bi, type TMantineTitleTextWrap as bj, type TMantineTranslatable as bk, type TMantineUseInputWrapper as bl, type TMantineWidth as bm, type TStyle as bn, _resetPluginStyleRegistry as c, getPluginStyleRegistry as d, extendStyleRegistry as e, type IContentField as f, getMergedStyleRegistry as g, type IAccordionItemStyle as h, type IAccordionStyle as i, type IActionIconStyle as j, type IAlertStyle as k, type IAspectRatioStyle as l, type IAudioStyle as m, type IAvatarStyle as n, type IBackgroundImageStyle as o, type IBadgeStyle as p, type IBaseStyle as q, type IBlockquoteStyle as r, type IBoxStyle as s, type IButtonStyle as t, type ICardSegmentStyle as u, type ICardStyle as v, type ICarouselStyle as w, type ICenterStyle as x, type ICheckboxStyle as y, type IChipStyle as z };