@ethlete/core 5.0.0-next.60 → 5.0.0-next.62
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/CHANGELOG.md +75 -0
- package/fesm2022/ethlete-core.mjs +972 -597
- package/fesm2022/ethlete-core.mjs.map +1 -1
- package/generators/generators.json +10 -0
- package/generators/migrate-create-destroy/create-destroy.js +317 -0
- package/generators/migrate-create-destroy/migration.js +46 -0
- package/generators/migrate-create-destroy/schema.json +26 -0
- package/generators/migrate-legacy-color-themes/legacy-color-themes.js +123 -0
- package/generators/migrate-legacy-color-themes/migration.js +93 -0
- package/generators/migrate-legacy-color-themes/schema.json +26 -0
- package/generators/migrate-to-v5/apply-replacements.js +14 -0
- package/generators/migrate-to-v5/color-naming.js +11 -57
- package/generators/migrate-to-v5/create-provider.js +56 -44
- package/generators/migrate-to-v5/migration-files.js +13 -0
- package/generators/migrate-to-v5/migration.js +31 -27
- package/generators/migrate-to-v5/removed-exports.js +101 -33
- package/generators/migrate-to-v5/router-state-service.js +118 -350
- package/generators/migrate-to-v5/schema.json +12 -0
- package/generators/migrate-to-v5/service-classes.js +108 -0
- package/generators/migrate-to-v5/viewport-service.js +195 -443
- package/generators/tailwind-4-color-theme/generator.js +71 -85
- package/migrations/legacy-color-themes.md +38 -0
- package/migrations/seo-directive-removed.md +2 -1
- package/migrations.json +15 -0
- package/package.json +11 -11
- package/types/ethlete-core.d.ts +300 -202
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,80 @@
|
|
|
1
1
|
# @ethlete/core
|
|
2
2
|
|
|
3
|
+
## 5.0.0-next.62
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- `AnimatedLifecycleDirective` gains a read-only `state` signal, and `state$` is now a read-only observable; read `state()` instead of `state$.value`.
|
|
8
|
+
- `OverlayRuntimeRef` no longer exposes the runtime's internal state mutators, and the runtime's style helpers and ref factory are no longer exported; the `OverlayRuntime` type is.
|
|
9
|
+
- Breaking: `ResizeMoveEvent` `dx`/`dy` are now `totalDx`/`totalDy`, and `resizeEnded` emits the final `ResizeMoveEvent` instead of `void`.
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- `*etAnimatedIf` narrows its `as` value like `@if`, and throws `ET9000` naming the missing `[etAnimatedLifecycle]` ancestor instead of a bare NG0201.
|
|
14
|
+
- `provideColorPalette` also takes one list per registered surface theme name plus a `default` list. The new `injectSurfaceColorPalette()` returns a signal of the list for the surface the caller sits on. `injectColorPalette()` returns the `default` list.
|
|
15
|
+
- Deprecate `createDestroy` in favour of `takeUntilDestroyed()` and add the hand-run `migrate-create-destroy` generator that rewrites the common pattern.
|
|
16
|
+
- Add the recommended assisted migration `legacy-color-themes`: `nx g @ethlete/core:migrate-legacy-color-themes` rewrites `provideColorThemes` into `provideColorThemesWithTailwind4` and lists the Tailwind 4 and surface theme setup that is left.
|
|
17
|
+
- Add `optionalBooleanAttribute`, a `booleanAttribute` that keeps `null` and `undefined`, for tri-state inputs.
|
|
18
|
+
- Adds `injectQueryParamAll` and an `injector` option on every router `inject*` helper; `injectQueryParam` now always returns the first value of a repeated param, and `KeyPressManager` is deprecated.
|
|
19
|
+
- Add `SurfaceTheme.semanticColorThemes`, which names the color theme serving `success`, `warning` or `error` on that surface, and `injectSemanticColorTheme(type)`, a signal of that theme for the nearest surface, else of the theme with that `type`.
|
|
20
|
+
- `OverlayRuntimeCloseSource` gains `'navigation'`, the source `@ethlete/components` overlays close with on a route change.
|
|
21
|
+
- Add a shared `et-visually-hidden` class and `mountVisuallyHidden()` to core, replacing 16 per-component copies of the clip rule in components.
|
|
22
|
+
- Add `colorTheme` to `SurfaceTheme`: an `[etProvideSurface]` that resolves the surface applies that color theme to its subtree, e.g. a darker `brand-on-light` on a light surface. An `[etProvideColor]` with a color on or above the surface element wins
|
|
23
|
+
- Unsaved changes: `confirm` is optional now - set it once with `provideUnsavedChangesConfirm()`, or use `provideUnsavedChangesAlertDialog()` for a ready-made dialog worded by `UNSAVED_CHANGES_LABELS`.
|
|
24
|
+
|
|
25
|
+
### Patch Changes
|
|
26
|
+
|
|
27
|
+
- `*etAnimatedIf` no longer replays the enter animation when a shown value is swapped for another truthy value.
|
|
28
|
+
- `signalAnimatedNumber` with `duration: 0` now jumps to the target instead of setting `NaN`, and a first frame stamped before `play()` no longer moves the value backwards. `*etRepeat` with a non-numeric count now renders nothing instead of keeping the previous views.
|
|
29
|
+
- `writeViewportSizeToCssVariables()` and `writeScrollbarSizeToCssVariables()` keep updating their CSS variables after the component that first called them is destroyed. Before, the writer stopped with that component and every later call was skipped.
|
|
30
|
+
- Deprecate `injectErrorTheme()`, `injectWarningTheme()` and `injectSuccessTheme()` in favor of `injectSemanticColorTheme(type)`, which follows the surface.
|
|
31
|
+
- Fixes unsaved-changes tracking of a `null` signal, `[etClickOutside]` misfires, cookies on `*.co.uk` hosts, 2D `nearest` scrolling and element swaps, and warns about missing breakpoint and color providers.
|
|
32
|
+
- `equal` no longer treats two Maps as equal when their keys differ but their values are `undefined`. `isSafeUrl`, `isSafeLinkUrl` and Markdown rendering no longer throw on an out-of-range character reference such as `�`. `getObjectProperty` follows chained array indexes like `a[0][1]`.
|
|
33
|
+
- `applyFaviconOverlay` loads the base icon with a CORS request, so an overlay now shows over a favicon served from a CORS-enabled CDN instead of being dropped on a tainted canvas.
|
|
34
|
+
- `injectUrl`, `injectRoute` and `injectRouterEvent` read the url before the first navigation through Angular's `Location`, so it no longer carries the base href or, under a hash location strategy, the `#`.
|
|
35
|
+
- `initials()` and the `initials` pipe take a whole character from each word, so a name starting outside the basic multilingual plane no longer yields half a surrogate pair, and a decomposed accent stays on its letter.
|
|
36
|
+
- The `legacy-color-themes` migration keeps the name a shorthand property or a local `export { provideColorThemes }` publishes, and also reports the Tailwind 3 helpers in a JavaScript Tailwind config.
|
|
37
|
+
- `createLogger` now goes quiet on a bare `?et-logger-quiet` query param, not only on one with a value. The JSDoc of `TitleConfig.prefixPart` and `suffixPart` no longer describes each other, and `UnsavedChangesTabConfig.title` no longer names the removed `etSeo` directive.
|
|
38
|
+
- A press on an anchored overlay's origin that closes it no longer swallows a later, unrelated click on that origin when the press ended without a click.
|
|
39
|
+
- The overlay ref's lifecycle observables now replay their event, so `mount(...).beforeOpened()` or a subscribe after `close()` still emits.
|
|
40
|
+
- `scrollToElement` with the `nearest` origin no longer hides the visible edge of an element larger than its container, and no longer scrolls toward an element that is not inside the container.
|
|
41
|
+
- A static provider override no longer erases a default with a key set to `undefined`, so `provideXDefaults({ size: undefined })` keeps the default size; `null` still overrides.
|
|
42
|
+
- The published typings no longer contain `@internal` members.
|
|
43
|
+
- An `Observable` returned from an unsaved-changes `confirm` is now unsubscribed when the session ends while it is open (`abandonAll()`, e.g. on logout), so it no longer keeps running - and a confirm dialog opened through it closes.
|
|
44
|
+
- Peer dependencies are ranges (`^22.1.0` for Angular, `^7.8.0` for RxJS, ...) instead of the workspace's exact versions. `migrate-to-v5` now reports every dropped 4.x export, such as `ObserveResizeDirective` and `LetDirective`, with its successor.
|
|
45
|
+
- `signalElementIntersection` now takes its first reading after render instead of before layout, and a `rootMargin` or `threshold` signal re-creates the observer when it changes.
|
|
46
|
+
- `htmlToMarkdown` and `markdownToHtml` keep the start number of an ordered list (`<ol start="3">` and `3.`) instead of renumbering from 1.
|
|
47
|
+
- Mark every migration with a `level`, so `et update` runs only the required ones.
|
|
48
|
+
- An overlay opened from inside another overlay that closes first (a dialog opened from a menu item) now returns focus to that overlay's own restore target instead of `<body>`.
|
|
49
|
+
|
|
50
|
+
## 5.0.0-next.61
|
|
51
|
+
|
|
52
|
+
### Minor Changes
|
|
53
|
+
|
|
54
|
+
- Breaking: `injectAppUpdates().check()` is now `check$()` and `fetchDeployedBuildFingerprint()` is now `fetchDeployedBuildFingerprint$()`; both return cold Observables instead of Promises.
|
|
55
|
+
- Markdown: `htmlToMarkdown` now backslash-escapes literal text (except code, rich-text editor tokens and `data-markdown-verbatim` spans) and drops links with unsafe URL schemes, which the rich-text editor's link tools also refuse.
|
|
56
|
+
- Markdown: `markdownToHtml` takes a `verbatim` pattern whose matches render as plain text. The rich-text editor and viewer pass their token codec's new `markdownPattern`, so `{{field:__x__}}` no longer loses its chip on reload.
|
|
57
|
+
- Rich text editor: an image upload that resolves to an unsafe URL reports `upload-failed`; core exports `isSafeUrl`.
|
|
58
|
+
|
|
59
|
+
### Patch Changes
|
|
60
|
+
|
|
61
|
+
- The `provideAppUpdates` check no longer logs CSP `style-src` violations under a nonce policy. It reads the entry scripts from the fetched HTML text instead of parsing it with `DOMParser`.
|
|
62
|
+
- An anchored overlay with `autoResize` now flips to the roomier side when its content grows after it opened, instead of staying squeezed on its first side.
|
|
63
|
+
- Drag gestures now also suppress text selection in Safari and WebKitGTK, which ignore the unprefixed `user-select`.
|
|
64
|
+
- `migrate-to-v5` takes a `projects`/`include` scope, migrates every usage it used to skip, and prints what to review by hand. `tailwind-4-color-theme` resolves imported spreads or warns.
|
|
65
|
+
- The `migrate-to-v5` generator no longer rewrites `.foo$` when it migrates `.foo` from `ViewportService` or `RouterStateService`.
|
|
66
|
+
- `fromNextFrame()` now cancels its animation frames on unsubscribe, so an animated lifecycle destroyed mid-transition (e.g. an open menu when its page goes away) leaves no frame pending; `nextFrame()` returns a cancel function.
|
|
67
|
+
- Fix a service-worker notification that the user dismissed natively keeping its click handler. Handlers of notifications no longer shown are now dropped when the next service-worker notification is shown.
|
|
68
|
+
- Overlay runtime: a component that throws during `mount` no longer leaves its host element, its overlay root or its injectors behind.
|
|
69
|
+
- Internal cleanup from the core lib scan; no behaviour change. Exported API no longer carries `@internal` tags.
|
|
70
|
+
- `scrollToElement` with the `nearest` origin now scrolls an element that starts exactly at a container edge into view.
|
|
71
|
+
- `applyStructuredDataBinding` escapes `<` in its JSON-LD, so a value holding `</script>` or `<!--` no longer corrupts or breaks the script in SSR output.
|
|
72
|
+
- The `migrate-to-v5` generator now migrates `ViewportService` and `RouterStateService` per class, leaves classes that do not inject them untouched, and handles aliased imports.
|
|
73
|
+
- The `migrate-to-v5` generator now renames `ProvideThemeDirective` to `ProvideColorDirective` in files that import it from `@ethlete/theming`. Before, it left the old name, and the cdk migration then imported that old name from `@ethlete/core`.
|
|
74
|
+
- `markdownToHtml` now renders a link with a scheme the link editor refuses (`file:`, `intent:`, `ftp:`, ...) as its text.
|
|
75
|
+
- The rich text editor keeps an image whose URL holds parentheses or spaces an image after a save and reload. `htmlToMarkdown` escapes brackets and backslashes in image alt text, so the alt text comes back exactly as written.
|
|
76
|
+
- `getScrollItemTarget` no longer rounds a half-visible item up to fully visible, so element-mode paging in a scrollable lands on that item instead of skipping it.
|
|
77
|
+
|
|
3
78
|
## 5.0.0-next.60
|
|
4
79
|
|
|
5
80
|
### Minor Changes
|