saasufy-components 9.4.0 → 9.5.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/README.md CHANGED
@@ -413,6 +413,7 @@ In addition to the slots shown above, the `collection-viewer` also supports the
413
413
  - `collection-page-offset`: Indicates the current page offset in the collection's data. It’s like telling the viewer which page of data you want to display initially.
414
414
  - `collection-get-count`: If this attribute is present, the component will get the record count of the target view. The count can be rendered into the template by prefixing the model name with a dollar sign and accessing the `count` property like this: `{{$MyModelName.count}}`.
415
415
  - `collection-disable-realtime`: If this attribute is present, the underlying collection will not listen for changes nor update in realtime. Fields of records that are in view may still update in realtime.
416
+ - `realtime-fields`: An optional comma-separated list of field names that should update in realtime. If not specified, all fields update in realtime. This can be used to limit realtime updates to only the fields that need it, improving performance.
416
417
  - `auto-reset-page-offset`: If this attribute is present, the `collection-page-offset` will be reset to zero whenever the view params change.
417
418
  - `type-alias`: Allows you to provide an alternative name for your `Model` to use when injecting values inside the template. This is useful for situations where you may have multiple `collection-viewer` elements and/or `model-viewer` elements of the same type nested inside each other and want to avoid `Model` name clashes in the nested template definitions. For example, if the `type-alias` in the snippet above was set to `SubChat`, then `{{Chat.message}}` would become `{{SubChat.message}}`.
418
419
  - `hide-error-logs`: A flag which, when present, suppresses error logs from being printed to the console.
@@ -626,6 +627,7 @@ In the example above, the name of the first element can be accessed with `{{Cate
626
627
  - `collection-page-offset`: Indicates the current page offset in the collection's data. It’s like telling the viewer which page of data you want to display initially.
627
628
  - `collection-get-count`: If this attribute is present, the component will get the record count of the target view. The count can be rendered into the template by prefixing the model name with a dollar sign and accessing the `count` property like this: `{{$MyModelName.count}}`.
628
629
  - `type-alias`: Allows you to provide an alternative name for your `Model` to use when injecting values inside the template. This is useful for situations where you may have multiple `collection-viewer` elements and/or `model-viewer` elements of the same type nested inside each other and want to avoid `Model` name clashes in the nested template definitions. For example, if the `type-alias` in the snippet above was set to `SubChat`, then `{{Chat.message}}` would become `{{SubChat.message}}`.
630
+ - `realtime-fields`: An optional comma-separated list of field names that should update in realtime. If not specified, all fields update in realtime. This can be used to limit realtime updates to only the fields that need it, improving performance.
629
631
  - `hide-error-logs`: A flag which, when present, suppresses error logs from being printed to the console.
630
632
  - `greedy-refresh`: If this attribute exists, the component will refresh itself whenever an attribute is set, even if that attribute's value did not change.
631
633
 
@@ -748,6 +750,7 @@ Used for rendering a single model resource using a template. This is the single-
748
750
  - `model-fields` (required): A comma-separated list of fields to bind to. Note that unlike with `model-input` and `model-text`, the attribute name is plural and can bind to multiple fields.
749
751
  - `type-alias`: Allows you to provide an alternative name for your `Model` to use when injecting values inside the template. This is useful for situations where you may have multiple `model-viewer` elements and/or `model-viewer` elements of the same type nested inside each other and want to avoid `Model` name clashes in the nested template definitions. For example, if the `type-alias` in the snippet above was set to `MyProduct`, then `{{Product.name}}` would become `{{MyProduct.name}}`.
750
752
  - `fields-slice-to`: Optional attribute which can be used to trim strings down to a maximum number of characters when reading. The format is `fieldName1=number1,fieldName2=number2`. This is useful when dealing with potentially very long field values. Note that it may affect caching if the same field is being referenced in multiple parts of the application at the same time within the same `socket-provider`.
753
+ - `realtime-fields`: An optional comma-separated list of field names that should update in realtime. If not specified, all fields update in realtime. This can be used to limit realtime updates to only the fields that need it, improving performance.
751
754
  - `hide-error-logs`: A flag which, when present, suppresses error logs from being printed to the console.
752
755
  - `greedy-refresh`: If this attribute exists, the component will refresh itself whenever an attribute is set, even if that attribute's value did not change.
753
756
 
@@ -971,7 +974,7 @@ A link to initiate an OAuth flow to authenticate a user as part of log in. Can s
971
974
  - `client-id` (required): This is the client ID from the third-party OAuth provider.
972
975
  - `state-size`: This allows you to control the size (in bytes) of the random state string which is passed to the OAuth provider as part of the OAuth flow. Defaults to 20.
973
976
  - `state-storage-key`: The state string is stored in the browser's `sessionStorage` under this key. Defaults to `oauth.state`. It must match the value provided to the `oauth-handler` component at the end of the OAuth flow.
974
- - `use-local-storage`: By default, the state is stored inside sessionStorage. If this property is set, then the state will be stored inside localStorage instead. This is useful for sharing the state across different tabs. If set, this attribute should also be set on the related `oauth-handler` component.
977
+ - `use-session-storage`: By default, the state is stored inside sessionStorage. If this property is set, then the state will be stored inside localStorage instead. This is useful for sharing the state across different tabs. If set, this attribute should also be set on the related `oauth-handler` component.
975
978
 
976
979
  ### oauth-handler
977
980
 
@@ -1001,7 +1004,7 @@ When using an OAuth provider, the callback URL which you register with the provi
1001
1004
  - `code-param-name`: The name of the query parameter which holds the `code` as provided by the OAuth provider within the OAuth callback URL. Defaults to `code`.
1002
1005
  - `state-param-name`: The name of the query parameter which holds the `state` as provided by the OAuth provider within the OAuth callback URL. Defaults to `state`.
1003
1006
  - `auth-timeout`: The number of milliseconds to wait for authentication to complete before timing out. Defaults to 10000 (10 seconds).
1004
- - `use-local-storage`: By default, the state is retrieved from sessionStorage. If this property is set, then the state will be retrieved from localStorage instead. This is useful for sharing the state across different tabs. If set, this attribute should also be set on the related `oauth-link` component.
1007
+ - `use-session-storage`: By default, the state is retrieved from localStorage. If this property is set, then the state will be retrieved from sessionStorage instead. If set, this attribute should also be set on the related `oauth-link` component.
1005
1008
 
1006
1009
  ### render-group
1007
1010
 
package/model-input.js CHANGED
@@ -50,8 +50,7 @@ class ModelInput extends SocketConsumer {
50
50
  'autocorrect',
51
51
  'input-id',
52
52
  'input-props',
53
- 'ignore-invalid-selection',
54
- 'realtime-fields'
53
+ 'ignore-invalid-selection'
55
54
  ];
56
55
  }
57
56
 
package/oauth-handler.js CHANGED
@@ -33,7 +33,7 @@ class OAuthHandler extends SocketConsumer {
33
33
  throw new Error('The provider attribute of oauth-handler was not specified');
34
34
  }
35
35
 
36
- let useLocalStorage = this.hasAttribute('use-local-storage');
36
+ let useLocalStorage = !this.hasAttribute('use-session-storage');
37
37
  let storageKey = this.getAttribute('state-storage-key') || 'oauth.state';
38
38
  let expectedOAuthState = (useLocalStorage ? localStorage : sessionStorage).getItem(storageKey);
39
39
  if (!expectedOAuthState) {
package/oauth-link.js CHANGED
@@ -17,7 +17,7 @@ class OAuthLink extends HTMLElement {
17
17
  'client-id',
18
18
  'state-size',
19
19
  'state-storage-key',
20
- 'use-local-storage'
20
+ 'use-session-storage'
21
21
  ];
22
22
  }
23
23
 
@@ -77,7 +77,7 @@ class OAuthLink extends HTMLElement {
77
77
  if (!provider) {
78
78
  throw new Error('The provider attribute of oauth-link was not specified');
79
79
  }
80
- let useLocalStorage = this.hasAttribute('use-local-storage');
80
+ let useLocalStorage = !this.hasAttribute('use-session-storage');
81
81
  let stateSize = Number(this.getAttribute('state-size') || 20);
82
82
  let storageKey = this.getAttribute('state-storage-key') || 'oauth.state';
83
83
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "saasufy-components",
3
- "version": "9.4.0",
3
+ "version": "9.5.0",
4
4
  "description": "Components for Saasufy.",
5
5
  "main": "index.js",
6
6
  "scripts": {