@localess/js-client 0.8.4 → 0.8.5

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/dist/index.d.mts CHANGED
@@ -268,6 +268,15 @@ declare function llEditable(content: ContentDataSchema): {
268
268
  'data-ll-id': string;
269
269
  'data-ll-schema': string;
270
270
  };
271
+ /**
272
+ * Adds Localess editable field attribute to a specific field.
273
+ * Added type safety to ensure fieldName is a valid key of the content data excluding base schema fields.
274
+ * @param fieldName
275
+ * @returns An object containing data-ll-field attribute.
276
+ */
277
+ declare function localessEditableField<T extends ContentData = ContentData>(fieldName: Exclude<keyof T, keyof ContentDataSchema>): {
278
+ 'data-ll-field': Exclude<keyof T, keyof ContentDataSchema>;
279
+ };
271
280
  /**
272
281
  * Adds Localess editable field attribute to a specific field.
273
282
  * @param fieldName
@@ -312,4 +321,4 @@ declare global {
312
321
  }
313
322
  }
314
323
 
315
- export { type Content, type ContentAsset, type ContentData, type ContentDataField, type ContentDataSchema, type ContentFetchParams, type ContentLink, type ContentMetadata, type ContentReference, type ContentRichText, type EventCallback, type EventToApp, type EventToAppType, type Links, type LinksFetchParams, type LocalessClient, type LocalessClientOptions, type LocalessSync, type Translations, isBrowser, isIframe, isServer, llEditable, llEditableField, loadLocalessSync, localessClient, localessEditable };
324
+ export { type Content, type ContentAsset, type ContentData, type ContentDataField, type ContentDataSchema, type ContentFetchParams, type ContentLink, type ContentMetadata, type ContentReference, type ContentRichText, type EventCallback, type EventToApp, type EventToAppType, type Links, type LinksFetchParams, type LocalessClient, type LocalessClientOptions, type LocalessSync, type Translations, isBrowser, isIframe, isServer, llEditable, llEditableField, loadLocalessSync, localessClient, localessEditable, localessEditableField };
package/dist/index.d.ts CHANGED
@@ -268,6 +268,15 @@ declare function llEditable(content: ContentDataSchema): {
268
268
  'data-ll-id': string;
269
269
  'data-ll-schema': string;
270
270
  };
271
+ /**
272
+ * Adds Localess editable field attribute to a specific field.
273
+ * Added type safety to ensure fieldName is a valid key of the content data excluding base schema fields.
274
+ * @param fieldName
275
+ * @returns An object containing data-ll-field attribute.
276
+ */
277
+ declare function localessEditableField<T extends ContentData = ContentData>(fieldName: Exclude<keyof T, keyof ContentDataSchema>): {
278
+ 'data-ll-field': Exclude<keyof T, keyof ContentDataSchema>;
279
+ };
271
280
  /**
272
281
  * Adds Localess editable field attribute to a specific field.
273
282
  * @param fieldName
@@ -312,4 +321,4 @@ declare global {
312
321
  }
313
322
  }
314
323
 
315
- export { type Content, type ContentAsset, type ContentData, type ContentDataField, type ContentDataSchema, type ContentFetchParams, type ContentLink, type ContentMetadata, type ContentReference, type ContentRichText, type EventCallback, type EventToApp, type EventToAppType, type Links, type LinksFetchParams, type LocalessClient, type LocalessClientOptions, type LocalessSync, type Translations, isBrowser, isIframe, isServer, llEditable, llEditableField, loadLocalessSync, localessClient, localessEditable };
324
+ export { type Content, type ContentAsset, type ContentData, type ContentDataField, type ContentDataSchema, type ContentFetchParams, type ContentLink, type ContentMetadata, type ContentReference, type ContentRichText, type EventCallback, type EventToApp, type EventToAppType, type Links, type LinksFetchParams, type LocalessClient, type LocalessClientOptions, type LocalessSync, type Translations, isBrowser, isIframe, isServer, llEditable, llEditableField, loadLocalessSync, localessClient, localessEditable, localessEditableField };
package/dist/index.js CHANGED
@@ -27,7 +27,8 @@ __export(index_exports, {
27
27
  llEditableField: () => llEditableField,
28
28
  loadLocalessSync: () => loadLocalessSync,
29
29
  localessClient: () => localessClient,
30
- localessEditable: () => localessEditable
30
+ localessEditable: () => localessEditable,
31
+ localessEditableField: () => localessEditableField
31
32
  });
32
33
  module.exports = __toCommonJS(index_exports);
33
34
 
@@ -219,6 +220,11 @@ function llEditable(content) {
219
220
  "data-ll-schema": content._schema || content.schema
220
221
  };
221
222
  }
223
+ function localessEditableField(fieldName) {
224
+ return {
225
+ "data-ll-field": fieldName
226
+ };
227
+ }
222
228
  function llEditableField(fieldName) {
223
229
  return {
224
230
  "data-ll-field": fieldName
@@ -252,5 +258,6 @@ function loadLocalessSync(origin, force = false) {
252
258
  llEditableField,
253
259
  loadLocalessSync,
254
260
  localessClient,
255
- localessEditable
261
+ localessEditable,
262
+ localessEditableField
256
263
  });
package/dist/index.mjs CHANGED
@@ -186,6 +186,11 @@ function llEditable(content) {
186
186
  "data-ll-schema": content._schema || content.schema
187
187
  };
188
188
  }
189
+ function localessEditableField(fieldName) {
190
+ return {
191
+ "data-ll-field": fieldName
192
+ };
193
+ }
189
194
  function llEditableField(fieldName) {
190
195
  return {
191
196
  "data-ll-field": fieldName
@@ -218,5 +223,6 @@ export {
218
223
  llEditableField,
219
224
  loadLocalessSync,
220
225
  localessClient,
221
- localessEditable
226
+ localessEditable,
227
+ localessEditableField
222
228
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@localess/js-client",
3
- "version": "0.8.4",
3
+ "version": "0.8.5",
4
4
  "description": "Universal JavaScript/TypeScript SDK for Localess's API.",
5
5
  "keywords": [
6
6
  "localess",