synapse-react-client 4.0.7 → 4.0.8
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/SWC.index.js +1 -1
- package/dist/components/DataGrid/DataGridTypes.d.ts +8 -2
- package/dist/components/DataGrid/DataGridTypes.d.ts.map +1 -1
- package/dist/components/DataGrid/DataGridTypes.js.map +1 -1
- package/dist/components/DataGrid/SynapseGrid.d.ts.map +1 -1
- package/dist/components/DataGrid/SynapseGrid.js +190 -176
- package/dist/components/DataGrid/SynapseGrid.js.map +1 -1
- package/dist/components/DataGrid/hooks/useGridReplicaUsers.d.ts +15 -0
- package/dist/components/DataGrid/hooks/useGridReplicaUsers.d.ts.map +1 -0
- package/dist/components/DataGrid/hooks/useGridReplicaUsers.js +55 -0
- package/dist/components/DataGrid/hooks/useGridReplicaUsers.js.map +1 -0
- package/dist/components/DataGrid/utils/DataGridUtils.js +31 -31
- package/dist/components/DataGrid/utils/DataGridUtils.js.map +1 -1
- package/dist/components/DataGrid/utils/applyModelChange.d.ts +1 -1
- package/dist/components/DataGrid/utils/applyModelChange.d.ts.map +1 -1
- package/dist/components/DataGrid/utils/applyModelChange.js +28 -23
- package/dist/components/DataGrid/utils/applyModelChange.js.map +1 -1
- package/dist/components/DataGrid/utils/columnFactory.d.ts.map +1 -1
- package/dist/components/DataGrid/utils/columnFactory.js +90 -49
- package/dist/components/DataGrid/utils/columnFactory.js.map +1 -1
- package/dist/components/DataGrid/utils/enrichRowsWithChangeInfo.d.ts +14 -0
- package/dist/components/DataGrid/utils/enrichRowsWithChangeInfo.d.ts.map +1 -0
- package/dist/components/DataGrid/utils/enrichRowsWithChangeInfo.js +24 -0
- package/dist/components/DataGrid/utils/enrichRowsWithChangeInfo.js.map +1 -0
- package/dist/components/DataGrid/utils/getCellAuthorSid.d.ts +7 -0
- package/dist/components/DataGrid/utils/getCellAuthorSid.d.ts.map +1 -0
- package/dist/components/DataGrid/utils/getCellAuthorSid.js +11 -0
- package/dist/components/DataGrid/utils/getCellAuthorSid.js.map +1 -0
- package/dist/components/DataGrid/utils/getCellClassName.d.ts +0 -1
- package/dist/components/DataGrid/utils/getCellClassName.d.ts.map +1 -1
- package/dist/components/DataGrid/utils/getCellClassName.js +19 -17
- package/dist/components/DataGrid/utils/getCellClassName.js.map +1 -1
- package/dist/components/DataGrid/utils/getChangeTooltipText.d.ts +7 -0
- package/dist/components/DataGrid/utils/getChangeTooltipText.d.ts.map +1 -0
- package/dist/components/DataGrid/utils/getChangeTooltipText.js +18 -0
- package/dist/components/DataGrid/utils/getChangeTooltipText.js.map +1 -0
- package/dist/components/DataGrid/utils/getReplicaCategory.d.ts +12 -0
- package/dist/components/DataGrid/utils/getReplicaCategory.d.ts.map +1 -0
- package/dist/components/DataGrid/utils/getReplicaCategory.js +13 -0
- package/dist/components/DataGrid/utils/getReplicaCategory.js.map +1 -0
- package/dist/features/entity/metadata-task/utils/getCreateGridRequestForMetadataTask.d.ts.map +1 -1
- package/dist/features/entity/metadata-task/utils/getCreateGridRequestForMetadataTask.js +4 -8
- package/dist/features/entity/metadata-task/utils/getCreateGridRequestForMetadataTask.js.map +1 -1
- package/dist/style/components/_data-grid-extra.css +1 -1
- package/dist/style/components/_data-grid-extra.scss +33 -0
- package/dist/synapse-queries/index.js +42 -41
- package/dist/synapse-queries/user/index.js +17 -16
- package/dist/synapse-queries/user/useUserBundle.d.ts +9 -0
- package/dist/synapse-queries/user/useUserBundle.d.ts.map +1 -1
- package/dist/synapse-queries/user/useUserBundle.js +45 -37
- package/dist/synapse-queries/user/useUserBundle.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +5 -5
package/dist/SWC.index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ValidationResults } from '@sage-bionetworks/synapse-types';
|
|
2
2
|
import { Model } from 'json-joy/lib/json-crdt';
|
|
3
3
|
import { s } from 'json-joy/lib/json-crdt-patch';
|
|
4
|
+
import type { ReplicaCategory } from './utils/getReplicaCategory';
|
|
4
5
|
type SelectionMap = Record<string, ReturnType<typeof s.con<ReplicaSelectionModel>>>;
|
|
5
6
|
export declare const gridSchema: import("json-joy").nodes.obj<{
|
|
6
7
|
doc_version: import("json-joy").nodes.con<string>;
|
|
@@ -41,6 +42,10 @@ export interface QueryInput {
|
|
|
41
42
|
}
|
|
42
43
|
export type GridModel = ReturnType<typeof Model.create<typeof gridSchema>>;
|
|
43
44
|
export type GridModelSnapshot = ReturnType<GridModel['api']['getSnapshot']>;
|
|
45
|
+
export type CellChangeInfo = {
|
|
46
|
+
category: ReplicaCategory;
|
|
47
|
+
tooltipText: string;
|
|
48
|
+
};
|
|
44
49
|
export interface Operation {
|
|
45
50
|
type: 'UPDATE' | 'DELETE' | 'CREATE';
|
|
46
51
|
fromRowIndex: number;
|
|
@@ -51,14 +56,15 @@ export interface Operation {
|
|
|
51
56
|
* This objects acts as a "ViewModel" and can be translated to/from the Synapse data grid CRDT schema.
|
|
52
57
|
*/
|
|
53
58
|
export type DataGridRow = {
|
|
54
|
-
[key: string]: string | number | boolean | null | undefined
|
|
55
|
-
} & {
|
|
59
|
+
[key: string]: string | number | boolean | null | undefined | ValidationResults | Map<string, string[]> | Record<string, CellChangeInfo>;
|
|
56
60
|
/** The JSON Schema validation results for the row, generated by the hub */
|
|
57
61
|
__validationResults?: ValidationResults;
|
|
58
62
|
/** The current status of the validation results, as computed by the client */
|
|
59
63
|
__validationStatus?: 'valid' | 'invalid' | 'pending';
|
|
60
64
|
/** The parsed validation messages for individual columns **/
|
|
61
65
|
__cellValidationResults?: Map<string, string[]>;
|
|
66
|
+
/** Per-cell change attribution, keyed by column name */
|
|
67
|
+
__cellChangeInfo?: Record<string, CellChangeInfo>;
|
|
62
68
|
};
|
|
63
69
|
export {};
|
|
64
70
|
//# sourceMappingURL=DataGridTypes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataGridTypes.d.ts","sourceRoot":"","sources":["../../../src/components/DataGrid/DataGridTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AACnE,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;AAC9C,OAAO,EAAE,CAAC,EAAE,MAAM,8BAA8B,CAAA;
|
|
1
|
+
{"version":3,"file":"DataGridTypes.d.ts","sourceRoot":"","sources":["../../../src/components/DataGrid/DataGridTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AACnE,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;AAC9C,OAAO,EAAE,CAAC,EAAE,MAAM,8BAA8B,CAAA;AAChD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAcjE,KAAK,YAAY,GAAG,MAAM,CACxB,MAAM,EACN,UAAU,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC,CAChD,CAAA;AAGD,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;kDAMrB,CAAA;AAEF,MAAM,MAAM,MAAM,GAAG;IACnB,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,EAAE,MAAM,CAAA;CACZ,CAAA;AAED,MAAM,MAAM,qBAAqB,GAAG;IAClC,eAAe,CAAC,EAAE,MAAM,EAAE,CAAA;IAC1B,YAAY,CAAC,EAAE,MAAM,EAAE,CAAA;IACvB,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,YAAY,CAAC,EAAE,OAAO,CAAA;CACvB,CAAA;AAED,MAAM,WAAW,cAAc;IAC7B,cAAc,EAAE,MAAM,CAAA;IACtB,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,MAAM,cAAc,GACtB,OAAO,GACP,KAAK,GACL,WAAW,GACX,aAAa,GACb,SAAS,CAAA;AAEb,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,cAAc,CAAA;IACpB,KAAK,EAAE,MAAM,CAAA;CACd;AAED,MAAM,MAAM,SAAS,GAAG,UAAU,CAAC,OAAO,KAAK,CAAC,MAAM,CAAC,OAAO,UAAU,CAAC,CAAC,CAAA;AAC1E,MAAM,MAAM,iBAAiB,GAAG,UAAU,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,aAAa,CAAC,CAAC,CAAA;AAE3E,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,EAAE,eAAe,CAAA;IACzB,WAAW,EAAE,MAAM,CAAA;CACpB,CAAA;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAA;IACpC,YAAY,EAAE,MAAM,CAAA;IACpB,UAAU,EAAE,MAAM,CAAA;CACnB;AAED;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,CAAC,GAAG,EAAE,MAAM,GACR,MAAM,GACN,MAAM,GACN,OAAO,GACP,IAAI,GACJ,SAAS,GACT,iBAAiB,GACjB,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,GACrB,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAA;IAClC,2EAA2E;IAC3E,mBAAmB,CAAC,EAAE,iBAAiB,CAAA;IACvC,8EAA8E;IAC9E,kBAAkB,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,SAAS,CAAA;IACpD,6DAA6D;IAC7D,uBAAuB,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAA;IAC/C,wDAAwD;IACxD,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAA;CAClD,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataGridTypes.js","sources":["../../../src/components/DataGrid/DataGridTypes.ts"],"sourcesContent":["import { ValidationResults } from '@sage-bionetworks/synapse-types'\nimport { Model } from 'json-joy/lib/json-crdt'\nimport { s } from 'json-joy/lib/json-crdt-patch'\n\nconst gridRowSchema = s.obj({\n data: s.vec(s.con('')),\n metadata: s.obj({\n synapseRow: s.obj({\n rowId: s.con(0),\n versionNumber: s.con(0),\n etag: s.con(''),\n }),\n rowValidation: s.con<ValidationResults | undefined>(undefined),\n }),\n})\n\ntype SelectionMap = Record<\n string,\n ReturnType<typeof s.con<ReplicaSelectionModel>>\n>\nconst selectionSchema = s.obj<SelectionMap, SelectionMap>({})\n\nexport const gridSchema = s.obj({\n doc_version: s.con('0.1.0'),\n columnNames: s.vec(s.con('')),\n columnOrder: s.arr([]),\n selection: selectionSchema,\n rows: s.arr<typeof gridRowSchema>([]),\n})\n\nexport type CrdtId = {\n rep: number\n seq: number\n}\n\nexport type ReplicaSelectionModel = {\n columnSelection?: CrdtId[]\n rowSelection?: CrdtId[]\n columnSelectAll?: boolean\n rowSelectAll?: boolean\n}\n\nexport interface JsonJoyMessage {\n sequenceNumber: number\n methodName: string\n payload?: string\n}\n\nexport type QueryInputType =\n | 'empty'\n | 'sql'\n | 'sessionId'\n | 'recordSetId'\n | 'unknown'\n\nexport interface QueryInput {\n type: QueryInputType\n input: string\n}\n\nexport type GridModel = ReturnType<typeof Model.create<typeof gridSchema>>\nexport type GridModelSnapshot = ReturnType<GridModel['api']['getSnapshot']>\n\nexport interface Operation {\n type: 'UPDATE' | 'DELETE' | 'CREATE'\n fromRowIndex: number\n toRowIndex: number\n}\n\n/**\n * Object that represents a single row of data in a Grid session that is compatible with react-datasheet-grid.\n * This objects acts as a \"ViewModel\" and can be translated to/from the Synapse data grid CRDT schema.\n */\nexport type DataGridRow = {\n [key: string]
|
|
1
|
+
{"version":3,"file":"DataGridTypes.js","sources":["../../../src/components/DataGrid/DataGridTypes.ts"],"sourcesContent":["import { ValidationResults } from '@sage-bionetworks/synapse-types'\nimport { Model } from 'json-joy/lib/json-crdt'\nimport { s } from 'json-joy/lib/json-crdt-patch'\nimport type { ReplicaCategory } from './utils/getReplicaCategory'\n\nconst gridRowSchema = s.obj({\n data: s.vec(s.con('')),\n metadata: s.obj({\n synapseRow: s.obj({\n rowId: s.con(0),\n versionNumber: s.con(0),\n etag: s.con(''),\n }),\n rowValidation: s.con<ValidationResults | undefined>(undefined),\n }),\n})\n\ntype SelectionMap = Record<\n string,\n ReturnType<typeof s.con<ReplicaSelectionModel>>\n>\nconst selectionSchema = s.obj<SelectionMap, SelectionMap>({})\n\nexport const gridSchema = s.obj({\n doc_version: s.con('0.1.0'),\n columnNames: s.vec(s.con('')),\n columnOrder: s.arr([]),\n selection: selectionSchema,\n rows: s.arr<typeof gridRowSchema>([]),\n})\n\nexport type CrdtId = {\n rep: number\n seq: number\n}\n\nexport type ReplicaSelectionModel = {\n columnSelection?: CrdtId[]\n rowSelection?: CrdtId[]\n columnSelectAll?: boolean\n rowSelectAll?: boolean\n}\n\nexport interface JsonJoyMessage {\n sequenceNumber: number\n methodName: string\n payload?: string\n}\n\nexport type QueryInputType =\n | 'empty'\n | 'sql'\n | 'sessionId'\n | 'recordSetId'\n | 'unknown'\n\nexport interface QueryInput {\n type: QueryInputType\n input: string\n}\n\nexport type GridModel = ReturnType<typeof Model.create<typeof gridSchema>>\nexport type GridModelSnapshot = ReturnType<GridModel['api']['getSnapshot']>\n\nexport type CellChangeInfo = {\n category: ReplicaCategory\n tooltipText: string\n}\n\nexport interface Operation {\n type: 'UPDATE' | 'DELETE' | 'CREATE'\n fromRowIndex: number\n toRowIndex: number\n}\n\n/**\n * Object that represents a single row of data in a Grid session that is compatible with react-datasheet-grid.\n * This objects acts as a \"ViewModel\" and can be translated to/from the Synapse data grid CRDT schema.\n */\nexport type DataGridRow = {\n [key: string]:\n | string\n | number\n | boolean\n | null\n | undefined\n | ValidationResults\n | Map<string, string[]>\n | Record<string, CellChangeInfo>\n /** The JSON Schema validation results for the row, generated by the hub */\n __validationResults?: ValidationResults\n /** The current status of the validation results, as computed by the client */\n __validationStatus?: 'valid' | 'invalid' | 'pending'\n /** The parsed validation messages for individual columns **/\n __cellValidationResults?: Map<string, string[]>\n /** Per-cell change attribution, keyed by column name */\n __cellChangeInfo?: Record<string, CellChangeInfo>\n}\n"],"names":["s","selectionSchema","gridSchema"],"mappings":";AAKsBA,EAAE,IAAI;AAAA,EAC1B,MAAMA,EAAE,IAAIA,EAAE,IAAI,EAAE,CAAC;AAAA,EACrB,UAAUA,EAAE,IAAI;AAAA,IACd,YAAYA,EAAE,IAAI;AAAA,MAChB,OAAOA,EAAE,IAAI,CAAC;AAAA,MACd,eAAeA,EAAE,IAAI,CAAC;AAAA,MACtB,MAAMA,EAAE,IAAI,EAAE;AAAA,IAAA,CACf;AAAA,IACD,eAAeA,EAAE,IAAmC,MAAS;AAAA,EAAA,CAC9D;AACH,CAAC;AAMD,MAAMC,IAAkBD,EAAE,IAAgC,EAAE,GAE/CE,IAAaF,EAAE,IAAI;AAAA,EAC9B,aAAaA,EAAE,IAAI,OAAO;AAAA,EAC1B,aAAaA,EAAE,IAAIA,EAAE,IAAI,EAAE,CAAC;AAAA,EAC5B,aAAaA,EAAE,IAAI,EAAE;AAAA,EACrB,WAAWC;AAAA,EACX,MAAMD,EAAE,IAA0B,CAAA,CAAE;AACtC,CAAC;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SynapseGrid.d.ts","sourceRoot":"","sources":["../../../src/components/DataGrid/SynapseGrid.tsx"],"names":[],"mappings":"AAaA,OAAO,EACL,iBAAiB,EAElB,MAAM,kCAAkC,CAAA;
|
|
1
|
+
{"version":3,"file":"SynapseGrid.d.ts","sourceRoot":"","sources":["../../../src/components/DataGrid/SynapseGrid.tsx"],"names":[],"mappings":"AAaA,OAAO,EACL,iBAAiB,EAElB,MAAM,kCAAkC,CAAA;AA8BzC,MAAM,MAAM,gBAAgB,GAAG;IAC7B,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB,CAAA;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC9B,cAAc,EAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,IAAI,CAAA;IACpD,mBAAmB,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAA;CACjD,CAAA;AAED,QAAA,MAAM,WAAW,gHA6ehB,CAAA;AAED,eAAe,WAAW,CAAA"}
|