@open-webapp/calendar 0.2.0 → 0.2.1

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 CHANGED
@@ -178,6 +178,10 @@ Built-in copy (overridable only through the slots above):
178
178
  - `--chip-row-height` (fallback `44px`; host may set it to match its chip row for sticky headers)
179
179
  - `--rsvp-bar` (set internally per RSVP status; do not override)
180
180
 
181
+ ## 0.2.1 (patch)
182
+
183
+ Fixes only, no behavior contract change: `getState().loading` is now published while a sync pass is in flight; a selection-change (partial) pass no longer clears `deferred` set by an earlier full pass; `CalendarPane` tolerates controllers without `getState`/`hydrate`.
184
+
181
185
  ## Breaking changes in 0.2.0
182
186
 
183
187
  BREAKING (0.1.0 to 0.2.0):
@@ -178,10 +178,15 @@ export function createCalendarController(opts) {
178
178
  }
179
179
  async function runPass(only) {
180
180
  loadingCount++;
181
+ publish();
181
182
  try {
182
183
  const ids = sources.map((s) => s.id).filter((id) => !only || only[id]);
183
184
  const results = await Promise.all(ids.map((id) => refreshSource(id, only?.[id])));
184
- deferred = results.some(Boolean);
185
+ const any = results.some(Boolean);
186
+ if (!only)
187
+ deferred = any;
188
+ else if (any)
189
+ deferred = true;
185
190
  }
186
191
  catch {
187
192
  /* never throws */
@@ -106,7 +106,9 @@ export function CalendarPane(props) {
106
106
  const events = useMemo(() => controller.getEvents(), [controller, version]);
107
107
  const statuses = controller.getSourceStatus();
108
108
  const connected = props.connected ?? sources.length > 0;
109
- const ctrlState = controller.getState();
109
+ const ctrlState = typeof controller.getState === 'function'
110
+ ? controller.getState()
111
+ : { loading: false, error: false, deferred: false, lastSyncAt: null };
110
112
  const multi = sources.length >= 2;
111
113
  const needsScopeSources = sources.filter((s) => statuses[s.id] === 'needs-scope');
112
114
  const needsReauth = connected && (props.needsReauth ?? (sources.length > 0 && needsScopeSources.length === sources.length));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-webapp/calendar",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",