You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Pull Request
## 🤨 Rationale
Updates dependencies manually to address build issues revealed by #2482#2481#2480.
Found that just updating dependencies by rebuilding the lock fails the
build which means the [repo is in a bad
state](#1479 (comment))
and that should be addressed quickly.
## 👩💻 Implementation
- Update major deps and rebuild lock
- Found that the now [deprecated tiptap link
validate](https://tiptap.dev/docs/editor/extensions/marks/link#validate-deprecated)
function is expected to still function with [backwards
compat](ueberdosis/tiptap#5812) however there
seems to be a regression as it [fails our build by allowing autolinking
of unexpected
protocols](https://github.com/ni/nimble/actions/runs/12110590706/job/33761233944#step:17:613).
- Switched from tiptap link validate to
[shouldAutoLink](https://tiptap.dev/docs/editor/extensions/marks/link#shouldautolink)
as described by docs. That seems to not fail the build.
- Pushed the min semver range version up for all the tiptap /
prosemirror packages as otherwise it seems to[ fail build when type
checking libraries](ueberdosis/tiptap#5867).
**NOTE**: It seems to be transitive dependency type issues that will
fail builds, I think it's possible that minimal upgrades done by
renovate may hit issues in app updates. If an app adopting latest these
changes fails to build it may need to rebuild the lock files in a clean
workspace to align transitive deps on latest versions and avoid library
type check issues.
- Updates to [prettier
3.4](https://prettier.io/blog/2024/11/26/3.4.0.html) resulting in lots
of changes.
## 🧪 Testing
Rely on CI.
## ✅ Checklist
- [x] I have updated the project documentation to reflect my changes or
determined no changes are needed.
Copy file name to clipboardexpand all lines: packages/nimble-components/CONTRIBUTING.md
+44-44
Original file line number
Diff line number
Diff line change
@@ -81,15 +81,15 @@ Before building a new component, 3 specification documents need to be created:
81
81
82
82
If a component is not ready for general use, it should be marked as "incubating" to indicate that status to clients. A component could be in this state if any of the following are true:
83
83
84
-
-It is still in development.
85
-
-It is missing important features like interaction design, visual design, or accessibility.
84
+
- It is still in development.
85
+
- It is missing important features like interaction design, visual design, or accessibility.
86
86
87
87
Incubating contributions may compromise on the above capabilities but they still must abide by other repository requirements. For example:
88
88
89
-
-Start development with a spec describing the high level plan and what's in or out of scope
@@ -187,17 +187,17 @@ Component CSS should follow the patterns described in [CSS Guidelines](/packages
187
187
188
188
It is common in web development to represent variations of control states using css classes. While it is possible to apply custom styles to web components based on user-added CSS classes, i.e. `:host(.my-class)`, it is not allowed in nimble for the following reasons:
189
189
190
-
-The `class` attribute is a user-configured attribute. For native HTML elements it would be surprising if setting a class, i.e. `<div class="my-class">`, caused the element to have a new style that the user did not define in their stylesheet. However, other attributes are expected to have element defined behavior, i.e. `<div hidden>`.
191
-
-Classes set in the `class` attribute are not as well-typed across frameworks. Users have to contort a bit to use exported enums for CSS class strings while attributes and attribute values are well-typed in wrappers.
192
-
-Binding to updates in the `class` attribute is more difficult / not an expected pattern. This makes it difficult to forward configured properties to inner elements. Alternatively, binding to attributes and forwarding bound attribute values in templates is a well supported pattern.
190
+
- The `class` attribute is a user-configured attribute. For native HTML elements it would be surprising if setting a class, i.e. `<div class="my-class">`, caused the element to have a new style that the user did not define in their stylesheet. However, other attributes are expected to have element defined behavior, i.e. `<div hidden>`.
191
+
- Classes set in the `class` attribute are not as well-typed across frameworks. Users have to contort a bit to use exported enums for CSS class strings while attributes and attribute values are well-typed in wrappers.
192
+
- Binding to updates in the `class` attribute is more difficult / not an expected pattern. This makes it difficult to forward configured properties to inner elements. Alternatively, binding to attributes and forwarding bound attribute values in templates is a well supported pattern.
193
193
194
194
##### Attribute naming convention
195
195
196
-
-Do not use attribute names that conflict with native attribute names:
197
-
-Avoid any names in the [MDN HTML attribute reference list](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes#attribute_list) (unless the attribute is trying to match that behavior exactly).
198
-
-Do a best effort search in relevant working groups for new attributes that may be coming to avoid, i.e. https://github.com/openui and https://github.com/whatwg.
199
-
-Avoid any names that are [reserved words](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#reserved_words) in JavaScript.
200
-
-Use lower-kebab-case for attributes and enum values that are part of a component's public API.
196
+
- Do not use attribute names that conflict with native attribute names:
197
+
- Avoid any names in the [MDN HTML attribute reference list](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes#attribute_list) (unless the attribute is trying to match that behavior exactly).
198
+
- Do a best effort search in relevant working groups for new attributes that may be coming to avoid, i.e. https://github.com/openui and https://github.com/whatwg.
199
+
- Avoid any names that are [reserved words](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#reserved_words) in JavaScript.
200
+
- Use lower-kebab-case for attributes and enum values that are part of a component's public API.
201
201
202
202
```ts
203
203
@attr({ attribute: 'error-text' })
@@ -206,19 +206,19 @@ It is common in web development to represent variations of control states using
206
206
207
207
##### Attributecommonnamepatterns
208
208
209
-
-Forattributesthatcontrolthevisibilityofapart, useeitherthebooleanattribute`<part>-visible`or`<part>-hidden`, i.e. `icon-visible`or`icon-hidden`.
209
+
-Forattributesthatcontrolthevisibilityofapart, useeitherthebooleanattribute`<part>-visible`or`<part>-hidden`, i.e. `icon-visible`or`icon-hidden`.
-Whenapplicable, thedefaultvalueforanattributethatisallowedtobeunconfiguredshouldbefirstintheenumobject, have a descriptive enum name, such as `default`, `none`, etc, based on the context, and be the enum value `undefined`.
220
-
- Boolean attributes must always default to `false`. Otherwise, the configuration in HTML becomes meaningless, as both `<element></element>` and `<element bool-attr></element>` result in `bool-attr` being set to `true`.
221
-
- States representing the following ideas should use those names: `success`, `error`, `warning`, `information`.
219
+
-Whenapplicable, thedefaultvalueforanattributethatisallowedtobeunconfiguredshouldbefirstintheenumobject, have a descriptive enum name, such as `default`, `none`, etc, based on the context, and be the enum value `undefined`.
220
+
- Boolean attributes must always default to `false`. Otherwise, the configuration in HTML becomes meaningless, as both `<element></element>` and `<element bool-attr></element>` result in `bool-attr` being set to `true`.
221
+
- States representing the following ideas should use those names: `success`, `error`, `warning`, `information`.
222
222
223
223
Avoid shorthands, i.e. `warn`, `info` and avoid alternatives, i.e. `pass`, `fail`, `invalid`.
224
224
@@ -270,8 +270,8 @@ Components can also consider exposing an API that checks the validity of the com
- from a component method when it shouldn't be called in the component's current state, like `show()` on a dialog that is already open.
275
275
276
276
#### Comments
277
277
@@ -281,8 +281,8 @@ At a minimum all classes should have a block comment and ultimately all parts of
281
281
282
282
Accessibility is a requirement for all new components. For the Nimble design system, this means
283
283
284
-
- Focus states are defined for every element and work on all browsers.
285
-
- Colors have sufficient contrast across all themes.
284
+
- Focus states are defined for every element and work on all browsers.
285
+
- Colors have sufficient contrast across all themes.
286
286
287
287
This is a collaborative effort between development and design. Designers will do their due diligence to make sure that designs promote accessiblity, and developers must ensure that each design is implemented and tested across browsers and themes.
288
288
@@ -359,11 +359,11 @@ Consider whether or not the `delegatesFocus` shadow DOM option should be set to
359
359
360
360
Some guidelines to follow when deciding whether or not to set `delegatesFocus`:
361
361
362
-
-For a component built on top of a fast-foundation component, check the fast-foundation component's README.md to see if the component was built with the expectation that focus will be delegated.
363
-
-Non-interactive elements should keep `delegatesFocus` with the default `false` value.
364
-
-Interactive controls that contain no focusable components in the shadow root should keep `delegatesFocus` with the default `false` value.
365
-
-Interactive controls that contain focusable components in the shadow root should set `delegatesFocus` to `true`.
366
-
-Refer to [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Element/attachShadow#parameters) or [this table](https://github.com/TakayoshiKochi/tabindex-focus-navigation-explainer/blob/master/TabindexFocusNavigationExplainer.md#proposed-solution) for more information.
362
+
- For a component built on top of a fast-foundation component, check the fast-foundation component's README.md to see if the component was built with the expectation that focus will be delegated.
363
+
- Non-interactive elements should keep `delegatesFocus` with the default `false` value.
364
+
- Interactive controls that contain no focusable components in the shadow root should keep `delegatesFocus` with the default `false` value.
365
+
- Interactive controls that contain focusable components in the shadow root should set `delegatesFocus` to `true`.
366
+
- Refer to [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Element/attachShadow#parameters) or [this table](https://github.com/TakayoshiKochi/tabindex-focus-navigation-explainer/blob/master/TabindexFocusNavigationExplainer.md#proposed-solution) for more information.
367
367
368
368
If it is determined that the component should delegate focus, it can be configured as shown below:
369
369
@@ -423,26 +423,26 @@ The following commands can be run from the `nimble` directory:
423
423
424
424
### Development commands
425
425
426
-
-`npm run tdd:watch -w @ni/nimble-components`: Starts a process for building the components and running the test suite on file changes.
426
+
-`npm run tdd:watch -w @ni/nimble-components`: Starts a process for building the components and running the test suite on file changes.
427
427
428
428
This command runs headlessly. See [Debugging commands](#debugging-commands) if you need to see the browser or set breakpoints while running.
429
429
430
-
-`npm run tdd -w @ni/nimble-components`: Similar to the corresponding `tdd:watch` command but only runs once. Useful for infrastructure changes which do not trigger the watch command.
430
+
-`npm run tdd -w @ni/nimble-components`: Similar to the corresponding `tdd:watch` command but only runs once. Useful for infrastructure changes which do not trigger the watch command.
431
431
432
432
### Debugging commands
433
433
434
-
-`npm run test-chrome:debugger -w @ni/nimble-components`: When run opens a Chrome window that can be used for interactive debugging. Using dev tools set breakpoints in tests and refresh the page, etc.
434
+
-`npm run test-chrome:debugger -w @ni/nimble-components`: When run opens a Chrome window that can be used for interactive debugging. Using dev tools set breakpoints in tests and refresh the page, etc.
435
435
436
436
You can also take the page url and open it in a different browser to test interactively.
437
437
438
-
-`npm run test-webkit:debugger -w @ni/nimble-components`: Similar to `test-chrome:debugger` but for WebKit. Can be run on Windows.
438
+
-`npm run test-webkit:debugger -w @ni/nimble-components`: Similar to `test-chrome:debugger` but for WebKit. Can be run on Windows.
439
439
440
440
### Test utilities
441
441
442
442
Test utilities located in [`/src/testing`](/packages/nimble-components/src/testing) may be used for testing:
443
443
444
-
-performed inside the `@ni/nimble-components` package or
445
-
-by other packages in the monorepo or users consuming the built package
444
+
- performed inside the `@ni/nimble-components` package or
445
+
- by other packages in the monorepo or users consuming the built package
446
446
447
447
Test utilties located in [`/src/utilities/tests`](/packages/nimble-components/src/utilities/tests) are just for tests in the `@ni/nimble-components` package and are not shared externally.
448
448
@@ -471,22 +471,22 @@ Most user-visible strings displayed by Nimble components are provided by the cli
471
471
472
472
The current label providers:
473
473
474
-
-`nimble-label-provider-core`: Used for labels for all components without a dedicated label provider
475
-
-`nimble-label-provider-rich-text`: Used for labels for the rich text components
476
-
-`nimble-label-provider-table`: Used for labels for the table (and table sub-components / column types)
474
+
-`nimble-label-provider-core`: Used for labels for all components without a dedicated label provider
475
+
-`nimble-label-provider-rich-text`: Used for labels for the rich text components
476
+
-`nimble-label-provider-table`: Used for labels for the table (and table sub-components / column types)
477
477
478
478
The expected format for label token names is:
479
479
480
-
-element/type(s) to which the token applies, e.g. `number-field` or `table`
481
-
-This may not be an exact element name, if this label applies to multiple elements or will be used in multiple contexts
482
-
-component part/category (optional), e.g. `column-header`
483
-
-specific functionality or sub-part, e.g. `decrement`
484
-
-the suffix `label` (will be omitted from the label-provider properties/attributes)
480
+
- element/type(s) to which the token applies, e.g. `number-field` or `table`
481
+
- This may not be an exact element name, if this label applies to multiple elements or will be used in multiple contexts
482
+
- component part/category (optional), e.g. `column-header`
483
+
- specific functionality or sub-part, e.g. `decrement`
484
+
- the suffix `label` (will be omitted from the label-provider properties/attributes)
485
485
486
486
Components using localized labels should document them in Storybook. To add a "Localizable Labels" section:
487
487
488
-
-Their story `Args` should extend `LabelUserArgs`
489
-
-Call `addLabelUseMetadata()` and pass their declared metadata object, the applicable label provider tag, and the label tokens that they're using
488
+
- Their story `Args` should extend `LabelUserArgs`
489
+
- Call `addLabelUseMetadata()` and pass their declared metadata object, the applicable label provider tag, and the label tokens that they're using
Copy file name to clipboardexpand all lines: packages/nimble-components/README.md
+7-7
Original file line number
Diff line number
Diff line change
@@ -110,13 +110,13 @@ Most user-visible strings displayed by Nimble components are provided by the cli
110
110
111
111
The current label providers:
112
112
113
-
- `nimble-label-provider-core`: Used for labels for all components without a dedicated label provider
114
-
- `nimble-label-provider-rich-text`: Used for labels for the rich text components
115
-
- `nimble-label-provider-table`: Used for labels for the table (and table sub-components / column types)
113
+
- `nimble-label-provider-core`: Used for labels for all components without a dedicated label provider
114
+
- `nimble-label-provider-rich-text`: Used for labels for the rich text components
115
+
- `nimble-label-provider-table`: Used for labels for the table (and table sub-components / column types)
116
116
117
117
If a client is localized, it should:
118
118
119
-
- Add the `label-provider` element(s) as children of their root theme provider:
119
+
- Add the `label-provider` element(s) as children of their root theme provider:
120
120
```html
121
121
<body>
122
122
<nimble-theme-providertheme="light">
@@ -127,14 +127,14 @@ If a client is localized, it should:
127
127
</nimble-theme-provider>
128
128
</body>
129
129
```
130
-
- For each label token on the label provider API, localize the English string, and set the corresponding HTML attribute or JS property on the label provider to the localized values. A list of all label tokens for each label provider (and their corresponding attribute/property names and English strings) can be found in the [Tokens/Label Providers section of Storybook](http://nimble.ni.dev/storybook/?path=/docs/tokens-label-providers--docs).
130
+
- For each label token on the label provider API, localize the English string, and set the corresponding HTML attribute or JS property on the label provider to the localized values. A list of all label tokens for each label provider (and their corresponding attribute/property names and English strings) can be found in the [Tokens/Label Providers section of Storybook](http://nimble.ni.dev/storybook/?path=/docs/tokens-label-providers--docs).
131
131
132
132
## Content Security Policy
133
133
134
134
When using Nimble in an environment with a [Content Security Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy) enabled, the following are known required settings beyond "common" settings (such as the [OWASP Basic non-Strict CSP Policy](https://cheatsheetseries.owasp.org/cheatsheets/Content_Security_Policy_Cheat_Sheet.html#basic-non-strict-csp-policy)) for using Nimble:
135
135
136
-
- `style-src 'unsafe-inline'` is [needed to support style patterns in the FAST library](https://github.com/microsoft/fast/issues/4510) leveraged by Nimble.
137
-
- `worker-src blob:` is needed to support controls that leverage Web Workers (for example the Wafer Map).
136
+
- `style-src 'unsafe-inline'` is [needed to support style patterns in the FAST library](https://github.com/microsoft/fast/issues/4510) leveraged by Nimble.
137
+
- `worker-src blob:` is needed to support controls that leverage Web Workers (for example the Wafer Map).
0 commit comments