@flux-ui/application 3.0.0-next.75 → 3.1.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@flux-ui/application",
3
3
  "description": "Contains components to create applications with Flux UI.",
4
- "version": "3.0.0-next.75",
4
+ "version": "3.1.0",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "funding": "https://github.com/sponsors/basmilius",
@@ -51,9 +51,9 @@
51
51
  "typings": "./dist/index.d.ts",
52
52
  "sideEffects": false,
53
53
  "dependencies": {
54
- "@flux-ui/components": "3.0.0-next.75",
55
- "@flux-ui/internals": "3.0.0-next.75",
56
- "@flux-ui/types": "3.0.0-next.75",
54
+ "@flux-ui/components": "3.1.0",
55
+ "@flux-ui/internals": "3.1.0",
56
+ "@flux-ui/types": "3.1.0",
57
57
  "clsx": "^2.1.1"
58
58
  },
59
59
  "peerDependencies": {
@@ -135,6 +135,18 @@
135
135
  contextStack.value = contextStack.value.filter(entry => entry.id !== id);
136
136
  }
137
137
 
138
+ function updateContext(id: symbol, info: Omit<FluxApplicationContextInfo, 'id'>): void {
139
+ const index = contextStack.value.findIndex(entry => entry.id === id);
140
+
141
+ if (index === -1) {
142
+ return;
143
+ }
144
+
145
+ const stack = [...contextStack.value];
146
+ stack[index] = {id, ...info};
147
+ contextStack.value = stack;
148
+ }
149
+
138
150
  watch(() => route.fullPath, () => {
139
151
  viewIndex.value = totalLevels.value - 1;
140
152
 
@@ -180,6 +192,7 @@
180
192
  goToMain,
181
193
  goToParent,
182
194
  pushContext,
183
- removeContext
195
+ removeContext,
196
+ updateContext
184
197
  });
185
198
  </script>
@@ -15,8 +15,7 @@ export default function (info: () => Omit<FluxApplicationContextInfo, 'id'>): vo
15
15
  });
16
16
 
17
17
  watch(info, next => {
18
- injection.removeContext(id);
19
- injection.pushContext({id, ...next});
18
+ injection.updateContext(id, next);
20
19
  });
21
20
 
22
21
  onBeforeUnmount(() => {
@@ -45,7 +45,7 @@
45
45
  background: var(--overlay);
46
46
  backdrop-filter: blur(3px) saturate(180%);
47
47
  transition: var(--application-duration) var(--swift-out);
48
- transition-property: background, backdrop-filter, opacity;
48
+ transition-property: background, backdrop-filter, opacity, visibility;
49
49
  z-index: 1900;
50
50
  }
51
51
 
@@ -71,6 +71,7 @@
71
71
  }
72
72
 
73
73
  .application:has(> .applicationMenu[data-collapsed]) .applicationMenuBackdrop {
74
+ visibility: hidden;
74
75
  pointer-events: none;
75
76
  opacity: 0;
76
77
  }
@@ -230,62 +230,6 @@
230
230
  }
231
231
  }
232
232
 
233
- .applicationMenuContextPill {
234
- position: relative;
235
- display: flex;
236
- flex-flow: row nowrap;
237
- gap: 9px;
238
- align-items: center;
239
- margin: -3px -6px 6px;
240
- padding: 9px 12px;
241
- cursor: pointer;
242
- color: var(--foreground-secondary);
243
- background: transparent;
244
- border: 1px solid var(--application-menu-surface-stroke);
245
- border-radius: var(--radius);
246
- transition: background 200ms var(--swift-out);
247
-
248
- @include mixin.hover {
249
- background: var(--gray-200);
250
- }
251
-
252
- &:active {
253
- background: var(--gray-300);
254
- }
255
-
256
- @include mixin.focus-ring;
257
- }
258
-
259
- .applicationMenuContextPillContent {
260
- display: flex;
261
- flex: 1 1 auto;
262
- flex-flow: column;
263
- min-width: 0;
264
-
265
- :global(strong) {
266
- font-weight: 500;
267
- font-size: 14px;
268
- line-height: 1.2;
269
- white-space: nowrap;
270
- overflow: hidden;
271
- color: var(--foreground-prominent);
272
- text-overflow: ellipsis;
273
- transition: var(--application-duration) var(--swift-out);
274
- transition-property: filter, opacity, translate;
275
- }
276
-
277
- :global(span) {
278
- font-size: 12px;
279
- line-height: 1.2;
280
- white-space: nowrap;
281
- overflow: hidden;
282
- color: var(--foreground-secondary);
283
- text-overflow: ellipsis;
284
- transition: var(--application-duration) var(--swift-out);
285
- transition-property: filter, opacity, translate;
286
- }
287
- }
288
-
289
233
  .applicationMenuPromo {
290
234
  display: flex;
291
235
  padding: 12px;
package/src/data/index.ts CHANGED
@@ -29,6 +29,7 @@ export type FluxApplicationInjection = {
29
29
  goToParent(): void;
30
30
  pushContext(info: FluxApplicationContextInfo): void;
31
31
  removeContext(id: symbol): void;
32
+ updateContext(id: symbol, info: Omit<FluxApplicationContextInfo, 'id'>): void;
32
33
  };
33
34
 
34
35
  export type FluxApplicationLayout =