@arpproject/recrate 0.1.7 → 0.1.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.
Files changed (188) hide show
  1. package/dist/index.d.ts +3 -2
  2. package/dist/recrate.css +4 -4
  3. package/dist/recrate.es.js +34674 -114061
  4. package/package.json +41 -32
  5. package/.eslintrc.json +0 -37
  6. package/.storybook/main.ts +0 -40
  7. package/.storybook/preview.tsx +0 -46
  8. package/babel.config.json +0 -5
  9. package/docker-compose.yml +0 -30
  10. package/docs/.nojekyll +0 -1
  11. package/docs/assets/highlight.css +0 -99
  12. package/docs/assets/icons.js +0 -18
  13. package/docs/assets/icons.svg +0 -1
  14. package/docs/assets/main.js +0 -60
  15. package/docs/assets/navigation.js +0 -1
  16. package/docs/assets/search.js +0 -1
  17. package/docs/assets/style.css +0 -1448
  18. package/docs/classes/src_crate_builder_CrateManager_crate_manager.CrateManager.html +0 -240
  19. package/docs/classes/src_crate_builder_CrateManager_profile_manager.ProfileManager.html +0 -42
  20. package/docs/classes/src_crate_builder_editor_state.EditorState.html +0 -28
  21. package/docs/classes/src_crate_builder_types.CrateManagerType.html +0 -57
  22. package/docs/classes/src_crate_builder_types.ProfileManagerType.html +0 -13
  23. package/docs/functions/src_crate_builder_CrateManager_lib.isURL.html +0 -2
  24. package/docs/functions/src_crate_builder_CrateManager_lib.mintNewCrate.html +0 -3
  25. package/docs/functions/src_crate_builder_CrateManager_lib.normalise.html +0 -5
  26. package/docs/functions/src_crate_builder_CrateManager_lib.normaliseEntityType.html +0 -1
  27. package/docs/index.html +0 -58
  28. package/docs/interfaces/src_crate_builder_types.NormalisedCrate.html +0 -3
  29. package/docs/interfaces/src_crate_builder_types.NormalisedEntityDefinition.html +0 -4
  30. package/docs/interfaces/src_crate_builder_types.NormalisedProfile.html +0 -9
  31. package/docs/interfaces/src_crate_builder_types.ProfileLayout.html +0 -2
  32. package/docs/interfaces/src_crate_builder_types.ProfileLayoutGroup.html +0 -9
  33. package/docs/interfaces/src_crate_builder_types.UnverifiedCrate.html +0 -3
  34. package/docs/interfaces/src_crate_builder_types.UnverifiedEntityDefinition.html +0 -4
  35. package/docs/modules/src_crate_builder_CrateManager_crate_manager.html +0 -2
  36. package/docs/modules/src_crate_builder_CrateManager_lib.html +0 -6
  37. package/docs/modules/src_crate_builder_CrateManager_profile_manager.html +0 -2
  38. package/docs/modules/src_crate_builder_editor_state.html +0 -2
  39. package/docs/modules/src_crate_builder_types.html +0 -16
  40. package/docs/types/src_crate_builder_types.EntityReference.html +0 -1
  41. package/docs/types/src_crate_builder_types.NormalisedContext.html +0 -1
  42. package/docs/types/src_crate_builder_types.PrimitiveType.html +0 -1
  43. package/docs/types/src_crate_builder_types.ProfileAssociation.html +0 -1
  44. package/docs/types/src_crate_builder_types.ProfileInput.html +0 -1
  45. package/docs/types/src_crate_builder_types.UnverifiedContext.html +0 -1
  46. package/docs/variables/src_crate_builder_CrateManager_lib.urlProtocols.html +0 -1
  47. package/index.html +0 -13
  48. package/load-data-packs.cjs +0 -38
  49. package/postcss.config.cjs +0 -6
  50. package/public/favicon.ico +0 -0
  51. package/public/index.html +0 -43
  52. package/public/logo192.png +0 -0
  53. package/public/logo512.png +0 -0
  54. package/public/manifest.json +0 -25
  55. package/public/marker-icon.png +0 -0
  56. package/public/marker-shadow.png +0 -0
  57. package/public/robots.txt +0 -3
  58. package/react-app-env.d.ts +0 -1
  59. package/rollup.config.js +0 -26
  60. package/src/app/App.tsx +0 -13
  61. package/src/app/EmbeddedComponent.tsx +0 -432
  62. package/src/app/index.html +0 -20
  63. package/src/app/index.tsx +0 -19
  64. package/src/app/lookup.ts +0 -141
  65. package/src/app/override-styles.css +0 -96
  66. package/src/crate-builder/CrateManager/contexts/1.1-context.jsonld +0 -2660
  67. package/src/crate-builder/CrateManager/contexts/1.2-DRAFT-context.jsonld +0 -2918
  68. package/src/crate-builder/CrateManager/contexts.ts +0 -42
  69. package/src/crate-builder/CrateManager/crate-manager-benchmarking.spec.ts +0 -31
  70. package/src/crate-builder/CrateManager/crate-manager-loading-exporting.spec.ts +0 -431
  71. package/src/crate-builder/CrateManager/crate-manager-operations.spec.ts +0 -298
  72. package/src/crate-builder/CrateManager/crate-manager.spec.ts +0 -2336
  73. package/src/crate-builder/CrateManager/crate-manager.ts +0 -2111
  74. package/src/crate-builder/CrateManager/lib.spec.ts +0 -133
  75. package/src/crate-builder/CrateManager/lib.ts +0 -170
  76. package/src/crate-builder/CrateManager/profile-manager.spec.ts +0 -593
  77. package/src/crate-builder/CrateManager/profile-manager.ts +0 -367
  78. package/src/crate-builder/CrateManager/schema-type-definitions.json +0 -35122
  79. package/src/crate-builder/CrateManager/validate-identifier.spec.ts +0 -82
  80. package/src/crate-builder/CrateManager/validate-identifier.ts +0 -65
  81. package/src/crate-builder/RenderEntity/Add.tsx +0 -249
  82. package/src/crate-builder/RenderEntity/AddControl.stories.tsx +0 -126
  83. package/src/crate-builder/RenderEntity/AddControl.tsx +0 -84
  84. package/src/crate-builder/RenderEntity/AutoComplete.tsx +0 -215
  85. package/src/crate-builder/RenderEntity/BulkAdd.tsx +0 -136
  86. package/src/crate-builder/RenderEntity/DeleteProperty.tsx +0 -33
  87. package/src/crate-builder/RenderEntity/DialogAddProperty.tsx +0 -83
  88. package/src/crate-builder/RenderEntity/DialogBrowseEntities.tsx +0 -136
  89. package/src/crate-builder/RenderEntity/DialogEditContext.tsx +0 -107
  90. package/src/crate-builder/RenderEntity/DialogPreviewCrate.tsx +0 -54
  91. package/src/crate-builder/RenderEntity/DialogSaveCrateAsTemplate.tsx +0 -65
  92. package/src/crate-builder/RenderEntity/DialogSaveEntityTemplate.tsx +0 -87
  93. package/src/crate-builder/RenderEntity/DisplayPropertyName.stories.tsx +0 -30
  94. package/src/crate-builder/RenderEntity/DisplayPropertyName.tsx +0 -21
  95. package/src/crate-builder/RenderEntity/EntityId.tsx +0 -75
  96. package/src/crate-builder/RenderEntity/EntityName.tsx +0 -49
  97. package/src/crate-builder/RenderEntity/EntityProperty.tsx +0 -188
  98. package/src/crate-builder/RenderEntity/EntityPropertyInstance.tsx +0 -255
  99. package/src/crate-builder/RenderEntity/EntityType.tsx +0 -95
  100. package/src/crate-builder/RenderEntity/ItemLink.tsx +0 -37
  101. package/src/crate-builder/RenderEntity/PaginateLinkedEntities.stories.tsx +0 -43
  102. package/src/crate-builder/RenderEntity/PaginateLinkedEntities.tsx +0 -141
  103. package/src/crate-builder/RenderEntity/PropertyHelp.tsx +0 -39
  104. package/src/crate-builder/RenderEntity/RenderControls.tsx +0 -278
  105. package/src/crate-builder/RenderEntity/RenderLinkedItem.tsx +0 -139
  106. package/src/crate-builder/RenderEntity/RenderPropertyHelp.tsx +0 -41
  107. package/src/crate-builder/RenderEntity/RenderReverseConnections.tsx +0 -150
  108. package/src/crate-builder/RenderEntity/RenderTypes.tsx +0 -102
  109. package/src/crate-builder/RenderEntity/Shell2.tsx +0 -576
  110. package/src/crate-builder/RenderEntity/UnlinkEntity.tsx +0 -30
  111. package/src/crate-builder/RenderEntity/auto-complete.lib.ts +0 -184
  112. package/src/crate-builder/RenderEntity/keys.ts +0 -4
  113. package/src/crate-builder/RenderEntity/layout.spec.js +0 -593
  114. package/src/crate-builder/RenderEntity/layout.ts +0 -220
  115. package/src/crate-builder/Shell.tsx +0 -337
  116. package/src/crate-builder/component.css +0 -65
  117. package/src/crate-builder/editor-state.ts +0 -114
  118. package/src/crate-builder/emotionCache.ts +0 -8
  119. package/src/crate-builder/helpers.ts +0 -16
  120. package/src/crate-builder/i18n.ts +0 -22
  121. package/src/crate-builder/lib/validate-iri.js +0 -69
  122. package/src/crate-builder/lib/validate-iri.ts +0 -57
  123. package/src/crate-builder/locales/en.js +0 -149
  124. package/src/crate-builder/locales/hu.js +0 -147
  125. package/src/crate-builder/primitives/Boolean.stories.tsx +0 -33
  126. package/src/crate-builder/primitives/Boolean.tsx +0 -67
  127. package/src/crate-builder/primitives/Date.stories.tsx +0 -32
  128. package/src/crate-builder/primitives/Date.tsx +0 -58
  129. package/src/crate-builder/primitives/DateTime.stories.tsx +0 -32
  130. package/src/crate-builder/primitives/DateTime.tsx +0 -64
  131. package/src/crate-builder/primitives/Geo.stories.tsx +0 -57
  132. package/src/crate-builder/primitives/Geo.tsx +0 -225
  133. package/src/crate-builder/primitives/Map.SelectArea.js +0 -359
  134. package/src/crate-builder/primitives/Map.stories.tsx +0 -61
  135. package/src/crate-builder/primitives/Map.tsx +0 -124
  136. package/src/crate-builder/primitives/Number.stories.tsx +0 -74
  137. package/src/crate-builder/primitives/Number.tsx +0 -166
  138. package/src/crate-builder/primitives/Select.stories.tsx +0 -66
  139. package/src/crate-builder/primitives/Select.tsx +0 -121
  140. package/src/crate-builder/primitives/SelectObject.stories.tsx +0 -29
  141. package/src/crate-builder/primitives/SelectObject.tsx +0 -105
  142. package/src/crate-builder/primitives/SelectUrl.stories.tsx +0 -42
  143. package/src/crate-builder/primitives/SelectUrl.tsx +0 -110
  144. package/src/crate-builder/primitives/Text.stories.tsx +0 -106
  145. package/src/crate-builder/primitives/Text.tsx +0 -197
  146. package/src/crate-builder/primitives/Time.stories.tsx +0 -38
  147. package/src/crate-builder/primitives/Time.tsx +0 -71
  148. package/src/crate-builder/primitives/Url.stories.tsx +0 -43
  149. package/src/crate-builder/primitives/Url.tsx +0 -75
  150. package/src/crate-builder/primitives/Value.stories.tsx +0 -37
  151. package/src/crate-builder/primitives/Value.tsx +0 -30
  152. package/src/crate-builder/primitives/date-libs.ts +0 -12
  153. package/src/crate-builder/profile-schema.json +0 -145
  154. package/src/crate-builder/property-definitions.ts +0 -78
  155. package/src/crate-builder/recrate.css +0 -3
  156. package/src/crate-builder/store.ts +0 -14
  157. package/src/crate-builder/tailwind.css +0 -5
  158. package/src/crate-builder/types.d.ts +0 -318
  159. package/src/examples/collection/collections-entity-example.json +0 -131
  160. package/src/examples/collection/crate-builder-entity-example.json +0 -33
  161. package/src/examples/item/complex-collection/ro-crate-metadata.json +0 -174
  162. package/src/examples/item/complex-item/ro-crate-metadata.json +0 -769
  163. package/src/examples/item/crate-with-language.json +0 -38
  164. package/src/examples/item/empty/ro-crate-metadata.json +0 -20
  165. package/src/examples/item/item-with-relationship-and-action/ro-crate-metadata.json +0 -66
  166. package/src/examples/item/large-crate/ro-crate-metadata.json +0 -5762
  167. package/src/examples/item/multiple-types/ro-crate-metadata.json +0 -20
  168. package/src/examples/item/ridiculously-big-collection/ro-crate-metadata.json +0 -162977
  169. package/src/examples/profile/aroma.complex.profile.json +0 -11098
  170. package/src/examples/profile/aroma.profile.json +0 -9158
  171. package/src/examples/profile/nyingarn-item-profile.json +0 -426
  172. package/src/examples/profile/profile-to-test-inverse-associations.json +0 -73
  173. package/src/examples/profile/profile-to-test-multiple-types.json +0 -31
  174. package/src/examples/profile/profile-with-all-primitives-and-groups.json +0 -207
  175. package/src/examples/profile/profile-with-all-primitives.json +0 -244
  176. package/src/examples/profile/profile-with-constraints.json +0 -446
  177. package/src/examples/profile/profile-with-resolve.json +0 -57
  178. package/src/examples/profile/vocabulary-creation-profile.json +0 -231
  179. package/src/images.d.ts +0 -5
  180. package/src/index.ts +0 -12
  181. package/src/types.ts +0 -104
  182. package/tailwind.config.js +0 -21
  183. package/tsconfig.app.json +0 -31
  184. package/tsconfig.json +0 -26
  185. package/typedoc.json +0 -11
  186. package/update-deps.sh +0 -4
  187. package/vite-env.d.ts +0 -1
  188. package/vite.config.ts +0 -46
package/src/app/lookup.ts DELETED
@@ -1,141 +0,0 @@
1
- export class Lookup {
2
- constructor() {}
3
- /**
4
- * This method is used to lookup entities created by users and saved for their
5
- * own personal use. How you implement that, if you do at all, is up to you.
6
- * In desktop for example, when the user saves a template, that entity gets stored
7
- * in their local database.
8
- *
9
- * @param {Object} params
10
- * @param {Array | String} params.type: the type array or type string of the entity being looked up
11
- * @param {String} params.queryString: the query string typed in by the user
12
- * @param {Number} params.limit=5: the number of matches to return - default = 5
13
- *
14
- * @returns {Object} { documents: [...]} - Object with documents array
15
- */
16
- async entityTemplates({ type = undefined, queryString = undefined, limit = 5 }) {
17
- // code to lookup entity templates in *YOUR* system
18
- //
19
- // type: the @type of template to lookup
20
- // queryString: what the user is looking for. You probably want to look in the
21
- // @id and name fields at least
22
- // limit: number of matches to return
23
- //
24
- // return array of json-ld objects matching the query:
25
- // ---------------------------------------------------
26
- // let documents = [{json-ld object}, {json-ld object}, ...]
27
- // return { documents }
28
- return { documents: [] };
29
- }
30
-
31
- /**
32
- *
33
- * This method is used to lookup data packs. Data packs are JSON-LD snippets that
34
- * have been created by an expert/s and can be trusted as being valid and correct.
35
- *
36
- * @param {Object} params
37
- * @param {Object} params.elasticQuery: a query object to be used against an elastic search server
38
- * @param {Array | String} params.type: the type array or type string of the entity being looked up
39
- * @param {String} params.queryString: the query string typed in by the user
40
- * @param {Array | String} params.fields: the fields to search against in the data pack json objects
41
- * @param {Array | String} params.datapack: the datapack or packs with the data to be used for this entity type
42
- * @param {Number} params.limit=10: the number of matches to return - default = 10
43
- *
44
- * @returns {Object} { documents: [...]} - Object with documents array
45
- */
46
- async dataPacks({
47
- elasticQuery = undefined,
48
- type = undefined,
49
- queryString = undefined,
50
- fields = undefined,
51
- datapacks = undefined,
52
- limit = 10,
53
- }) {
54
- if (elasticQuery) {
55
- // query: the elastic query to perform
56
- //
57
- // The crate builder component will pass a fully formed elastic search query to this method
58
- // It's up to you to get it to the elastic search server. In this example
59
- // it's hardcoded in the _execute method
60
- const documents = await this._execute({ query: elasticQuery, indexPath: "data" });
61
- return { documents };
62
- } else {
63
- // do the lookup yourself in whatever way you want
64
- //
65
- // the value of 'datapack' will be whatever the profile author defined so
66
- // that's your datasource. How you implement that lookup is totally
67
- // up to you.
68
- //
69
- // return array of json-ld objects matching the query:
70
- // ---------------------------------------------------
71
- // let documents = [{json-ld object}, {json-ld object}, ...]
72
- // return { documents }
73
- return { documents: [] };
74
- }
75
- }
76
-
77
- /**
78
- * This method is used to lookup user created entities in, for example, a repository. Imagine
79
- * a user creates an entity of type Country that overlaps with a Country in the data pack (same @id for both).
80
- * The user created Country may not be correct but if it has the same @id and is stored
81
- * in the same index, it will overrwrite the datapack version which is valid and correct.
82
- *
83
- * So, by separating out general entity lookups from data packs, you can store data in a way
84
- * where user created stuff doesn't trample known good content.
85
- *
86
- * @param {Object} params
87
- * @param {Object} params.elasticQuery: a query object to be used against an elastic search server
88
- * @param {Array | String} params.type: the type array or type string of the entity being looked up
89
- * @param {String} params.queryString: the query string typed in by the user
90
- * @param {Array | String} params.fields: the fields to search against in the data pack json objects
91
- * @param {Array | String} params.datapack: the datapack or packs with the data to be used for this entity type
92
- * @param {Number} params.limit=10: the number of matches to return - default = 10
93
- * @returns {Object} { documents: [...]} - Object with documents array
94
- *
95
- * @returns
96
- */
97
- async entities({
98
- elasticQuery = undefined,
99
- type = undefined,
100
- queryString = undefined,
101
- fields = undefined,
102
- limit = 10,
103
- }) {
104
- if (elasticQuery) {
105
- // query: the elastic query to perform
106
- //
107
- // The crate builder component will pass a fully formed elastic search query to this method
108
- // It's up to you to get it to the elastic search server. In this example
109
- // it's hardcoded in the _execute method
110
- const documents = await this._execute({ query: elasticQuery, indexPath: "entities" });
111
- return { documents };
112
- } else {
113
- // do the lookup yourself in whatever way you want
114
- //
115
- // return array of json-ld objects matching the query:
116
- // ---------------------------------------------------
117
- // let documents = [{json-ld object}, {json-ld object}, ...]
118
- return { documents: [] };
119
- }
120
- }
121
-
122
- /** private method */
123
- async _execute({ query, indexPath }: { query: Record<string, any>; indexPath: string }) {
124
- let response = await fetch(`http://localhost:9200/${indexPath}/_search`, {
125
- method: "POST",
126
- headers: {
127
- "Content-Type": "application/json",
128
- },
129
- body: JSON.stringify(query),
130
- });
131
- let status = response.status;
132
- response = await response.json();
133
- if (status !== 200) {
134
- return response;
135
- }
136
- // const total = response.hits.total.value;
137
- const documents = (response as any).hits.hits.map((doc: { _source: any }) => ({ ...doc._source }));
138
- // return { total, documents };
139
- return documents;
140
- }
141
- }
@@ -1,96 +0,0 @@
1
- /*
2
-
3
- In all cases you have the full breadth of tailwindcss (https://tailwindcss.com/docs/installation)
4
- at your disposal.
5
-
6
- For example, to colour the property names red and make them larger:
7
-
8
- .describo-property-name {
9
- @apply text-red-600 text-2xl
10
- }
11
-
12
- */
13
-
14
-
15
- /**************************************
16
- * Target all properties
17
- **************************************/
18
- .describo-property {
19
- /* use this to target the whole area of each property */
20
- }
21
- .describo-property-name {
22
- /* use this to target the property name */
23
- }
24
- .describo-property-value {
25
- /* use this to target the value of a property */
26
- }
27
- .describo-property-help {
28
- /* use this to target the help text of a property */
29
- }
30
- .describo-property-help-more {
31
- /* use this to target the expanded help text of a property */
32
- }
33
- .describo-property-background {
34
- /* target the background of all properties except core: '@id', '@type' and 'name' */
35
- }
36
- .describo-property-heading {
37
- /* target the label of all proeprties except core: '@id', '@type' and 'name' */
38
-
39
- }
40
- .describo-property-value-readonly {
41
- /* target properties that are set to readonly */
42
- }
43
- .describo-property-type-entity {
44
- /* use this to target the autocomplete dropdown when adding an entity */
45
-
46
- }
47
-
48
-
49
- /**************************************
50
- * Target specific properties
51
- **************************************/
52
- .describo-property-name-id {
53
- /* specifically target the @id property */
54
- }
55
- .describo-property-name-type {
56
- /* specifically target the @type property */
57
- }
58
- .describo-property-name-name {
59
- /* specifically target the name property */
60
- }
61
- /* .describo-property-name-{property name} {
62
- } */
63
-
64
-
65
- /**************************************
66
- * Target specific property types
67
- **************************************/
68
- .describo-property-type-datetime {}
69
- .describo-property-type-date {}
70
- .describo-property-type-select {}
71
- .describo-property-type-geo {}
72
- .describo-property-type-number {}
73
- .describo-property-type-map {}
74
- .describo-property-type-value {}
75
- .describo-property-type-time {}
76
- .describo-property-type-text {}
77
- .describo-property-type-url {}
78
-
79
-
80
- /**************************************
81
- * Target item links
82
- **************************************/
83
- .describo-render-item-link {
84
- /* target the whole of an item link */
85
- }
86
-
87
-
88
- /**************************************
89
- * Target tab labels
90
- **************************************/
91
- .describo-tab-label {
92
- /* use this to target the tab label */
93
- }
94
- .describo-tab-description {
95
- /* use this to target the tab description */
96
- }