@goodandready/dsh-goal 0.2.3 → 0.2.5
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/lib/client.js +66 -4
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -11,6 +11,10 @@ window.__ModuleLoader__.load({
|
|
|
11
11
|
const { useState, useEffect, useRef, useCallback, useMemo } = React;
|
|
12
12
|
|
|
13
13
|
const NS = 'dsh-goal';
|
|
14
|
+
// Plugins page row seat (DSH 0.1.6-alpha.2): key = '<package name>#<row id>'.
|
|
15
|
+
const PKG = '@goodandready/dsh-goal';
|
|
16
|
+
const ROW_ID = 'dsh-goal';
|
|
17
|
+
const ROW_CONFIG_KEY = PKG + '#' + ROW_ID;
|
|
14
18
|
|
|
15
19
|
// Safe loading of core primitives
|
|
16
20
|
|
|
@@ -3490,11 +3494,18 @@ window.__ModuleLoader__.load({
|
|
|
3490
3494
|
|
|
3491
3495
|
const Chevron = (Primitives && Primitives.IconChevronDownOutline14) || IconChevronDown;
|
|
3492
3496
|
|
|
3497
|
+
// Row seat (plugins.row.config): the host page draws title/icon/crumb and the
|
|
3498
|
+
// padding, so the summary is a one-liner and the page drops our card chrome.
|
|
3499
|
+
if (props && props.view === 'summary') {
|
|
3500
|
+
return React.createElement('span', { className: 'dsh-goal-sub' }, t('cardSubtitle') || 'Goal tracking with checkpoints and subgoals');
|
|
3501
|
+
}
|
|
3502
|
+
const page = !!(props && props.view === 'page');
|
|
3503
|
+
|
|
3493
3504
|
return React.createElement(
|
|
3494
3505
|
|
|
3495
|
-
'li',
|
|
3506
|
+
page ? 'div' : 'li',
|
|
3496
3507
|
|
|
3497
|
-
{ className: 'dsh-goal-card' },
|
|
3508
|
+
{ className: page ? 'dsh-goal-page' : 'dsh-goal-card' },
|
|
3498
3509
|
|
|
3499
3510
|
React.createElement(
|
|
3500
3511
|
|
|
@@ -3504,9 +3515,11 @@ window.__ModuleLoader__.load({
|
|
|
3504
3515
|
|
|
3505
3516
|
className: 'dsh-goal-card-head',
|
|
3506
3517
|
|
|
3518
|
+
style: page ? { display: 'none' } : undefined,
|
|
3519
|
+
|
|
3507
3520
|
onClick: () => setIsOpen(!isOpen),
|
|
3508
3521
|
|
|
3509
|
-
'aria-expanded': isOpen,
|
|
3522
|
+
'aria-expanded': page ? true : isOpen,
|
|
3510
3523
|
|
|
3511
3524
|
},
|
|
3512
3525
|
|
|
@@ -4352,7 +4365,56 @@ window.__ModuleLoader__.load({
|
|
|
4352
4365
|
|
|
4353
4366
|
);
|
|
4354
4367
|
|
|
4355
|
-
// 2. Register settings card
|
|
4368
|
+
// 2. Register settings card.
|
|
4369
|
+
// List seat (plugins.item): the seat the Plugins page renders as the plugin's own
|
|
4370
|
+
// page with its configuration. The label is a static string on purpose — it is
|
|
4371
|
+
// resolved while the page renders, and a locale lookup there would take the whole
|
|
4372
|
+
// client batch down with it.
|
|
4373
|
+
registerSlotSafe(
|
|
4374
|
+
|
|
4375
|
+
'plugins.item',
|
|
4376
|
+
|
|
4377
|
+
{
|
|
4378
|
+
|
|
4379
|
+
name: 'plugins.item',
|
|
4380
|
+
|
|
4381
|
+
id: ROW_ID,
|
|
4382
|
+
|
|
4383
|
+
order: 60,
|
|
4384
|
+
|
|
4385
|
+
label: () => 'Goal',
|
|
4386
|
+
|
|
4387
|
+
locale: NS,
|
|
4388
|
+
|
|
4389
|
+
inject: () => ({ ctx, scope: settingsScope }),
|
|
4390
|
+
|
|
4391
|
+
},
|
|
4392
|
+
|
|
4393
|
+
GoalSettingsCard,
|
|
4394
|
+
|
|
4395
|
+
);
|
|
4396
|
+
|
|
4397
|
+
// Row seat and the legacy seat kept as fallbacks.
|
|
4398
|
+
|
|
4399
|
+
registerSlotSafe(
|
|
4400
|
+
|
|
4401
|
+
'plugins.row.config',
|
|
4402
|
+
|
|
4403
|
+
{
|
|
4404
|
+
|
|
4405
|
+
name: 'plugins.row.config',
|
|
4406
|
+
|
|
4407
|
+
key: ROW_CONFIG_KEY,
|
|
4408
|
+
|
|
4409
|
+
locale: NS,
|
|
4410
|
+
|
|
4411
|
+
inject: () => ({ ctx, scope: settingsScope }),
|
|
4412
|
+
|
|
4413
|
+
},
|
|
4414
|
+
|
|
4415
|
+
GoalSettingsCard,
|
|
4416
|
+
|
|
4417
|
+
);
|
|
4356
4418
|
|
|
4357
4419
|
registerSlotSafe(
|
|
4358
4420
|
|
package/package.json
CHANGED