@overmap-ai/core 1.0.43-tiptap.0 → 1.0.43-tiptap.1

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.
@@ -1665,7 +1665,7 @@ var __publicField = (obj, key, value) => {
1665
1665
  toolkit.createSelector(
1666
1666
  [selectAllComponentAttachments, (_state, componentId) => componentId],
1667
1667
  (attachments, componentId) => {
1668
- return attachments.filter(({ component_id }) => componentId === component_id);
1668
+ return attachments.filter(({ component }) => componentId === component);
1669
1669
  }
1670
1670
  )
1671
1671
  );
@@ -1673,7 +1673,7 @@ var __publicField = (obj, key, value) => {
1673
1673
  toolkit.createSelector(
1674
1674
  [selectAllComponentAttachments, (_state, componentId) => componentId],
1675
1675
  (attachments, componentId) => {
1676
- const attachmentsOfComponent = attachments.filter(({ component_id }) => componentId === component_id);
1676
+ const attachmentsOfComponent = attachments.filter(({ component }) => componentId === component);
1677
1677
  const fileAttachments = attachmentsOfComponent.filter(
1678
1678
  // this null check here is necessary, there are cases where file_type is null or undefined
1679
1679
  ({ file_type }) => !file_type || !file_type.startsWith("image/")
@@ -1935,7 +1935,7 @@ var __publicField = (obj, key, value) => {
1935
1935
  toolkit.createSelector(
1936
1936
  [selectAllComponentTypeAttachments, (_state, componentTypeId) => componentTypeId],
1937
1937
  (attachments, componentTypeId) => {
1938
- return attachments.filter(({ component_type_id }) => componentTypeId === component_type_id);
1938
+ return attachments.filter(({ component_type }) => componentTypeId === component_type);
1939
1939
  }
1940
1940
  )
1941
1941
  );
@@ -1944,7 +1944,7 @@ var __publicField = (obj, key, value) => {
1944
1944
  [selectAllComponentTypeAttachments, (_state, componentTypeId) => componentTypeId],
1945
1945
  (attachments, componentTypeId) => {
1946
1946
  const attachmentsOfComponent = attachments.filter(
1947
- ({ component_type_id }) => component_type_id === componentTypeId
1947
+ ({ component_type }) => component_type === componentTypeId
1948
1948
  );
1949
1949
  const fileAttachments = attachmentsOfComponent.filter(
1950
1950
  // this null check here is necessary, there are cases where file_type is null or undefined
@@ -2093,7 +2093,7 @@ var __publicField = (obj, key, value) => {
2093
2093
  },
2094
2094
  removeIssueAttachment: removeAttachment,
2095
2095
  removeAttachmentsOfIssue: (state, action) => {
2096
- const attachments = Object.values(state.attachments).filter((a) => a.issue_id === action.payload);
2096
+ const attachments = Object.values(state.attachments).filter((a) => a.issue === action.payload);
2097
2097
  for (const attachment of attachments) {
2098
2098
  delete state.attachments[attachment.offline_id];
2099
2099
  }
@@ -2224,7 +2224,7 @@ var __publicField = (obj, key, value) => {
2224
2224
  [selectIssueAttachmentMapping, (_state, issueId) => issueId],
2225
2225
  (attachmentMapping, issueId) => {
2226
2226
  return Object.values(attachmentMapping).filter(
2227
- (attachment) => attachment.issue_id === issueId && attachment.file_type && attachment.file_type.startsWith("image/")
2227
+ (attachment) => attachment.issue === issueId && attachment.file_type && attachment.file_type.startsWith("image/")
2228
2228
  );
2229
2229
  }
2230
2230
  )
@@ -2239,7 +2239,7 @@ var __publicField = (obj, key, value) => {
2239
2239
  toolkit.createSelector(
2240
2240
  [selectIssueAttachments, (_state, issueId) => issueId],
2241
2241
  (attachments, issueId) => {
2242
- return attachments.filter(({ issue_id }) => issueId === issue_id);
2242
+ return attachments.filter(({ issue }) => issueId === issue);
2243
2243
  }
2244
2244
  )
2245
2245
  );
@@ -2247,12 +2247,12 @@ var __publicField = (obj, key, value) => {
2247
2247
  toolkit.createSelector(
2248
2248
  [selectIssueAttachments, (_state, issueId) => issueId],
2249
2249
  (attachments, issueId) => {
2250
- const attachmentsOfComponent = attachments.filter(({ issue_id }) => issue_id === issueId);
2251
- const fileAttachments = attachmentsOfComponent.filter(
2250
+ const attachmentsOfIssue = attachments.filter(({ issue }) => issue === issueId);
2251
+ const fileAttachments = attachmentsOfIssue.filter(
2252
2252
  // this null check here is necessary, there are cases where file_type is null or undefined
2253
2253
  ({ file_type }) => !file_type || !file_type.startsWith("image/")
2254
2254
  );
2255
- const imageAttachments = attachmentsOfComponent.filter(
2255
+ const imageAttachments = attachmentsOfIssue.filter(
2256
2256
  // this null check here is necessary, there are cases where file_type is null or undefined
2257
2257
  ({ file_type }) => file_type && file_type.startsWith("image/")
2258
2258
  );
@@ -2269,7 +2269,7 @@ var __publicField = (obj, key, value) => {
2269
2269
  return Object.values(attachmentMapping).filter(
2270
2270
  (attachment) => (
2271
2271
  // Files with file_type that is null or not an image file
2272
- attachment.issue_id === issueId && (!attachment.file_type || !attachment.file_type.startsWith("image/"))
2272
+ attachment.issue === issueId && (!attachment.file_type || !attachment.file_type.startsWith("image/"))
2273
2273
  )
2274
2274
  );
2275
2275
  }
@@ -4207,7 +4207,7 @@ var __publicField = (obj, key, value) => {
4207
4207
  }
4208
4208
  // Attachments aren't models, so we use the OptimisticGenericResult type instead
4209
4209
  async addIssueAttachment(attachmentPayload) {
4210
- const { description: description2, issue_id, file_sha1, offline_id } = attachmentPayload;
4210
+ const { description: description2, issue, file_sha1, offline_id } = attachmentPayload;
4211
4211
  if (!attachmentPayload.file.objectURL) {
4212
4212
  throw new Error("Expected attachmentPayload.file.objectURL to be defined.");
4213
4213
  }
@@ -4223,12 +4223,12 @@ var __publicField = (obj, key, value) => {
4223
4223
  const promise = this.enqueueRequest({
4224
4224
  description: "Create attachment",
4225
4225
  method: HttpMethod.POST,
4226
- url: `/issues/${issue_id}/attach/`,
4227
- blocks: [offline_id, issue_id],
4226
+ url: `/issues/${issue}/attach/`,
4227
+ blocks: [offline_id, issue],
4228
4228
  blockers: [file_sha1],
4229
4229
  payload: {
4230
4230
  offline_id,
4231
- issue: issue_id,
4231
+ issue,
4232
4232
  description: description2 ?? "",
4233
4233
  submitted_at: (/* @__PURE__ */ new Date()).getTime() / 1e3,
4234
4234
  ...fileProps
@@ -4241,7 +4241,7 @@ var __publicField = (obj, key, value) => {
4241
4241
  return [offlineAttachment, promise];
4242
4242
  }
4243
4243
  async addComponentAttachment(attachmentPayload) {
4244
- const { description: description2, component_id, file_sha1, offline_id } = attachmentPayload;
4244
+ const { description: description2, component, file_sha1, offline_id } = attachmentPayload;
4245
4245
  if (!attachmentPayload.file.objectURL) {
4246
4246
  throw new Error("Expected attachmentPayload.file.objectURL to be defined.");
4247
4247
  }
@@ -4257,12 +4257,12 @@ var __publicField = (obj, key, value) => {
4257
4257
  const promise = this.enqueueRequest({
4258
4258
  description: "Create attachment",
4259
4259
  method: HttpMethod.POST,
4260
- url: `/components/${component_id}/attach/`,
4261
- blocks: [offline_id, component_id],
4260
+ url: `/components/${component}/attach/`,
4261
+ blocks: [offline_id, component],
4262
4262
  blockers: [file_sha1],
4263
4263
  payload: {
4264
4264
  offline_id,
4265
- component: component_id,
4265
+ component,
4266
4266
  description: description2 ?? "",
4267
4267
  submitted_at: (/* @__PURE__ */ new Date()).getTime() / 1e3,
4268
4268
  ...fileProps
@@ -4275,7 +4275,7 @@ var __publicField = (obj, key, value) => {
4275
4275
  return [offlineAttachment, promise];
4276
4276
  }
4277
4277
  async addComponentTypeAttachment(attachmentPayload) {
4278
- const { description: description2, component_type_id, file_sha1, offline_id } = attachmentPayload;
4278
+ const { description: description2, component_type, file_sha1, offline_id } = attachmentPayload;
4279
4279
  if (!attachmentPayload.file.objectURL) {
4280
4280
  throw new Error("Expected attachmentPayload.file.objectURL to be defined.");
4281
4281
  }
@@ -4291,12 +4291,12 @@ var __publicField = (obj, key, value) => {
4291
4291
  const promise = this.enqueueRequest({
4292
4292
  description: "Create attachment",
4293
4293
  method: HttpMethod.POST,
4294
- url: `/components/types/${component_type_id}/attach/`,
4295
- blocks: [offline_id, component_type_id],
4294
+ url: `/components/types/${component_type}/attach/`,
4295
+ blocks: [offline_id, component_type],
4296
4296
  blockers: [file_sha1],
4297
4297
  payload: {
4298
4298
  offline_id,
4299
- component_type: component_type_id,
4299
+ component_type,
4300
4300
  description: description2 ?? "",
4301
4301
  submitted_at: (/* @__PURE__ */ new Date()).getTime() / 1e3,
4302
4302
  ...fileProps
@@ -4322,7 +4322,7 @@ var __publicField = (obj, key, value) => {
4322
4322
  file: file2,
4323
4323
  file_name: file2.name,
4324
4324
  file_type: file2.type,
4325
- issue_id: issueId,
4325
+ issue: issueId,
4326
4326
  file_sha1: hash
4327
4327
  });
4328
4328
  return this.addIssueAttachment(attachment);
@@ -4341,7 +4341,7 @@ var __publicField = (obj, key, value) => {
4341
4341
  file: file2,
4342
4342
  file_name: file2.name,
4343
4343
  file_type: file2.type,
4344
- component_id: componentId,
4344
+ component: componentId,
4345
4345
  file_sha1: hash
4346
4346
  });
4347
4347
  return this.addComponentAttachment(attachment);
@@ -4360,7 +4360,7 @@ var __publicField = (obj, key, value) => {
4360
4360
  file: file2,
4361
4361
  file_name: file2.name,
4362
4362
  file_type: file2.type,
4363
- component_type_id: componentTypeId,
4363
+ component_type: componentTypeId,
4364
4364
  file_sha1: hash
4365
4365
  });
4366
4366
  return this.addComponentTypeAttachment(attachment);
@@ -5514,7 +5514,7 @@ var __publicField = (obj, key, value) => {
5514
5514
  if (!backup) {
5515
5515
  throw new Error(`No issue with id ${id} found in the store`);
5516
5516
  }
5517
- const attachments = Object.values(state.issueReducer.attachments).filter((a) => a.issue_id === id);
5517
+ const attachments = Object.values(state.issueReducer.attachments).filter((a) => a.issue === id);
5518
5518
  const attachmentsOfIssue = selectAttachmentsOfIssue(id)(state);
5519
5519
  this.client.store.dispatch(removeIssue(id));
5520
5520
  store.dispatch(addActiveProjectIssuesCount(-1));
@@ -13906,14 +13906,16 @@ var __publicField = (obj, key, value) => {
13906
13906
  key: "duplicate",
13907
13907
  text: "Duplicate",
13908
13908
  buttonProps: { onClick: duplicate }
13909
- },
13910
- {
13909
+ }
13910
+ ];
13911
+ if (index2 === 0) {
13912
+ actions2.push({
13911
13913
  Icon: TrashIcon,
13912
13914
  key: "delete",
13913
13915
  text: "Delete",
13914
13916
  buttonProps: { onClick: remove2 }
13915
- }
13916
- ];
13917
+ });
13918
+ }
13917
13919
  if (type !== "section") {
13918
13920
  actions2.unshift({
13919
13921
  Icon: ImageIcon,