@tinacms/app 2.3.19 → 2.3.21

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/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @tinacms/app
2
2
 
3
+ ## 2.3.21
4
+
5
+ ### Patch Changes
6
+
7
+ - [#6346](https://github.com/tinacms/tinacms/pull/6346) [`3fa216c`](https://github.com/tinacms/tinacms/commit/3fa216c110af6417e6b835c49a275b08981e028b) Thanks [@JackDevAU](https://github.com/JackDevAU)! - Revert "✨ Visual element highlighting between iframe and form (#6211)"
8
+
9
+ - Updated dependencies [[`3fa216c`](https://github.com/tinacms/tinacms/commit/3fa216c110af6417e6b835c49a275b08981e028b), [`7352c96`](https://github.com/tinacms/tinacms/commit/7352c9660869d413a0f48d3fbb003d4c4c0e3d85)]:
10
+ - tinacms@3.3.1
11
+
12
+ ## 2.3.20
13
+
14
+ ### Patch Changes
15
+
16
+ - Updated dependencies [[`6c2c48a`](https://github.com/tinacms/tinacms/commit/6c2c48a9d869cb98e78fc656b986ecc244a5dafd)]:
17
+ - tinacms@3.3.0
18
+ - @tinacms/mdx@2.0.3
19
+
3
20
  ## 2.3.19
4
21
 
5
22
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tinacms/app",
3
- "version": "2.3.19",
3
+ "version": "2.3.21",
4
4
  "main": "src/main.tsx",
5
5
  "license": "Apache-2.0",
6
6
  "devDependencies": {
@@ -26,8 +26,8 @@
26
26
  "react-router-dom": "6.3.0",
27
27
  "typescript": "^5.7.3",
28
28
  "zod": "^3.24.2",
29
- "@tinacms/mdx": "2.0.2",
30
- "tinacms": "3.2.0"
29
+ "tinacms": "3.3.1",
30
+ "@tinacms/mdx": "2.0.3"
31
31
  },
32
32
  "repository": {
33
33
  "url": "https://github.com/tinacms/tinacms.git",
@@ -526,17 +526,9 @@ export const useGraphQLReducer = (
526
526
  const [queryId, eventFieldName] = event.data.fieldName.split('---');
527
527
  const result = results.find((res) => res.id === queryId);
528
528
  if (result?.data) {
529
- const { formId, fieldName } = getFormAndFieldNameFromMetadata(
530
- result.data,
531
- eventFieldName
532
- );
533
529
  cms.dispatch({
534
530
  type: 'forms:set-active-field-name',
535
- value: { formId: formId, fieldName: fieldName },
536
- });
537
- cms.events.dispatch({
538
- ...event.data,
539
- type: 'field:focus',
531
+ value: getFormAndFieldNameFromMetadata(result.data, eventFieldName),
540
532
  });
541
533
  }
542
534
  cms.dispatch({
@@ -544,30 +536,6 @@ export const useGraphQLReducer = (
544
536
  value: 'openOrFull',
545
537
  });
546
538
  }
547
- if (event.data.type === 'field:hovered') {
548
- if (event.data.fieldName) {
549
- const [queryId, eventFieldName] = event.data.fieldName.split('---');
550
- const result = results.find((res) => res.id === queryId);
551
- if (result?.data) {
552
- const fieldData = getFormAndFieldNameFromMetadata(
553
- result.data,
554
- eventFieldName
555
- );
556
- cms.dispatch({
557
- type: 'forms:set-hovered-field-name',
558
- value: fieldData,
559
- });
560
- }
561
- } else {
562
- // Clear hover state when fieldName is null
563
- cms.forms.all().forEach((form) => {
564
- cms.dispatch({
565
- type: 'forms:set-hovered-field-name',
566
- value: { formId: form.id, fieldName: null },
567
- });
568
- });
569
- }
570
- }
571
539
  if (event.data.type === 'close') {
572
540
  const payloadSchema = z.object({ id: z.string() });
573
541
  const { id } = payloadSchema.parse(event.data);
@@ -630,33 +598,6 @@ export const useGraphQLReducer = (
630
598
  });
631
599
  }, [cms.state.sidebarDisplayState]);
632
600
 
633
- // Compute the active field name to send to iframe
634
- const activeFieldName = React.useMemo(() => {
635
- const activeForm = cms.state.forms.find(
636
- (form: any) => form.tinaForm.id === cms.state.activeFormId
637
- );
638
- if (!activeForm) {
639
- return null;
640
- }
641
- const fieldName = activeForm.activeFieldName;
642
- if (fieldName === null) {
643
- return null;
644
- }
645
- const queries = activeForm.tinaForm.queries;
646
- if (queries && queries.length > 0) {
647
- const queryId = queries[queries.length - 1];
648
- return `${queryId}---${fieldName}`;
649
- }
650
- return null;
651
- }, [cms.state.forms, cms.state.activeFormId]);
652
-
653
- React.useEffect(() => {
654
- iframe.current?.contentWindow?.postMessage({
655
- type: 'field:set-focused',
656
- fieldName: activeFieldName,
657
- });
658
- }, [activeFieldName, iframe]);
659
-
660
601
  React.useEffect(() => {
661
602
  cms.dispatch({ type: 'set-edit-mode', value: 'visual' });
662
603
  if (iframe) {
package/src/lib/types.ts CHANGED
@@ -5,7 +5,6 @@ export type PostMessage =
5
5
  data: object;
6
6
  }
7
7
  | { type: 'field:selected'; fieldName: string }
8
- | { type: 'field:hovered'; fieldName: string | null }
9
8
  | { type: 'quick-edit'; value: boolean }
10
9
  | { type: 'user-select-form'; formId: string }
11
10
  | { type: 'url-changed' };