lucid-extension-sdk 0.0.124 → 0.0.125

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,6 +1,6 @@
1
1
  {
2
2
  "name": "lucid-extension-sdk",
3
- "version": "0.0.124",
3
+ "version": "0.0.125",
4
4
  "description": "Utility classes for writing Lucid Software editor extensions",
5
5
  "main": "sdk/index.js",
6
6
  "types": "sdk/index.d.ts",
@@ -501,6 +501,8 @@ export declare type AddCardIntegrationQuery = {
501
501
  'isl': string;
502
502
  /** Icon url */
503
503
  'u': string;
504
+ /** Text style */
505
+ 'ts'?: Partial<TextStyle> | undefined;
504
506
  /** Field configuration */
505
507
  'fc': {
506
508
  /** Callback to get field definitions for all fields supported by the card integration */
@@ -991,6 +993,8 @@ export declare type RegisterPanelQuery = {
991
993
  'i': string;
992
994
  /** tooltip */
993
995
  'to'?: string;
996
+ /** If true, we will persist the panel's iframe */
997
+ 'p'?: boolean;
994
998
  };
995
999
  export declare type RegisterPanelResult = undefined;
996
1000
  export declare type RegisterUnfurlQuery = {
@@ -1,3 +1,4 @@
1
+ import { TextStyle } from '../../document/text/textstyle';
1
2
  import { LucidCardFieldDisplaySettings, SerializedLucidCardFieldDisplaySettings } from './cardfielddisplaysettings';
2
3
  export interface CardIntegrationConfig {
3
4
  cardConfig: {
@@ -5,6 +6,11 @@ export interface CardIntegrationConfig {
5
6
  * The data fields to be displayed on cards, as data-linked text fields
6
7
  */
7
8
  fieldNames: string[];
9
+ /**
10
+ * The default text style to set on each of the above fields for new cards. Any style not specified
11
+ * will use a default value, and any field name not present will use all defaults.
12
+ */
13
+ fieldStyles?: Map<string, Partial<TextStyle>>;
8
14
  /**
9
15
  * The data fields to be displayed on cards as data graphics
10
16
  */
@@ -30,7 +36,8 @@ export interface CardIntegrationConfig {
30
36
  export declare type SerializedCardIntegrationConfig = {
31
37
  'cc': {
32
38
  'f': string[];
33
- 'fd'?: [string, SerializedLucidCardFieldDisplaySettings][];
39
+ 'fd'?: [string, SerializedLucidCardFieldDisplaySettings][] | undefined;
40
+ 'fs'?: [string, Partial<TextStyle>][] | undefined;
34
41
  'id'?: string | undefined;
35
42
  };
36
43
  'cdpc': {
@@ -13,6 +13,7 @@ function serializeCardIntegrationConfig(config) {
13
13
  (0, cardfielddisplaysettings_1.serializeLucidCardFieldDisplaySettings)(settings),
14
14
  ])
15
15
  : undefined,
16
+ 'fs': config.cardConfig.fieldStyles ? [...config.cardConfig.fieldStyles] : undefined,
16
17
  },
17
18
  'cdpc': {
18
19
  'f': config.cardDetailsPanelConfig.fields.map((field) => {
@@ -30,6 +31,7 @@ function deserializeCardIntegrationConfig(raw) {
30
31
  return {
31
32
  cardConfig: {
32
33
  fieldNames: raw['cc']['f'],
34
+ fieldStyles: raw['cc']['fs'] ? new Map(raw['cc']['fs']) : undefined,
33
35
  fieldDisplaySettings: raw['cc']['fd']
34
36
  ? new Map(raw['cc']['fd'].map(([key, settings]) => [
35
37
  key,
@@ -1,6 +1,7 @@
1
1
  import { CollectionDefinition } from '../../data/collectiondefinition';
2
2
  import { CollectionProxy } from '../../data/collectionproxy';
3
3
  import { DataSourceProxy } from '../../data/datasourceproxy';
4
+ import { TextStyle } from '../../document/text/textstyle';
4
5
  import { EditorClient } from '../../editorclient';
5
6
  import { SerializedFieldType } from '../data/serializedfield/serializedfields';
6
7
  import { CardIntegrationConfig } from './cardintegrationconfig';
@@ -29,6 +30,12 @@ export declare abstract class LucidCardIntegration {
29
30
  * The name of the data connector associated with the card integration.
30
31
  */
31
32
  abstract dataConnectorName: string;
33
+ /**
34
+ * The default text style to use on cards created as part of this integration.
35
+ * These can be overridden by values in getDefaultConfig().fieldStyles for
36
+ * individual fields that should have different styles.
37
+ */
38
+ textStyle?: Partial<TextStyle>;
32
39
  abstract fieldConfiguration: {
33
40
  /**
34
41
  * Callback to provide a list of all supported field names for the card integration.
@@ -60,6 +60,7 @@ class LucidCardIntegrationRegistry {
60
60
  'il': cardIntegration.itemLabel,
61
61
  'isl': cardIntegration.itemsLabel,
62
62
  'u': cardIntegration.iconUrl,
63
+ 'ts': cardIntegration.textStyle,
63
64
  'fc': {
64
65
  'gf': getFieldsActionName,
65
66
  'osfc': onSelectedFieldsChangeActionName,
package/sdk/ui/panel.d.ts CHANGED
@@ -24,6 +24,8 @@ export interface PanelConfig {
24
24
  iconUrl: string;
25
25
  /** A tool tip to be displayed when hovering over the activation icon. */
26
26
  toolTip?: string;
27
+ /** If set true, we will persist the panel's iframe in the background if it's not currently active*/
28
+ persist?: boolean;
27
29
  }
28
30
  /**
29
31
  * Extend this class to show a custom panel to the user, whose contents are displayed in a sandboxed
package/sdk/ui/panel.js CHANGED
@@ -37,6 +37,7 @@ class Panel extends iframeui_1.IframeUI {
37
37
  'v': this.config.visibleAction,
38
38
  'i': this.config.iconUrl,
39
39
  'to': this.config.toolTip,
40
+ 'p': this.config.persist,
40
41
  });
41
42
  }
42
43
  /**