From 25ae424f4271b848e52d0a2410ed41e05c27ba04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sedat=20=C3=96zt=C3=BCrk?= Date: Wed, 5 Aug 2026 23:51:43 +0300 Subject: [PATCH] =?UTF-8?q?Custom=20Component=20d=C3=BCzenlemesi?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DeveloperKit/CustomComponentAppService.cs | 13 + .../PlatformConsts.cs | 2 +- .../EntityFrameworkCore/PlatformDbContext.cs | 194 +- ....cs => 20260805202101_Initial.Designer.cs} | 195 +- ...4_Initial.cs => 20260805202101_Initial.cs} | 192 +- .../PlatformDbContextModelSnapshot.cs | 193 +- ui/.gitignore | 3 +- ui/package-lock.json | 14 +- ui/package.json | 9 +- ui/scripts/generate-component-metadata.mjs | 182 + ui/src/assets/styles/components/_select.css | 35 + .../codeLayout/ComponentCodeEditor.tsx | 783 ---- .../codeLayout/ComponentLibrary.tsx | 190 - .../codeLayout/ComponentSelector.tsx | 50 - ui/src/components/codeLayout/PanelManager.tsx | 79 - .../components/codeLayout/PropertyPanel.tsx | 619 --- .../components/codeLayout/TailwindModal.tsx | 191 +- .../codeLayout/data/componentDefinitions.ts | 77 +- .../codeLayout/data/tailwindClasses.ts | 297 -- .../codeLayout/editorSettings/global.d.ts | 13 - .../codeLayout/editorSettings/monacoSetup.ts | 31 - .../componentEditor/DynamicRenderer.tsx | 154 +- .../componentEditor/PlatformViewHost.tsx | 114 + ui/src/components/ui/Menu/Menu.tsx | 25 +- ui/src/components/ui/Select/Select.tsx | 451 ++- .../visualDesigner/VisualCanvas.tsx | 892 +++++ ui/src/components/visualDesigner/catalog.ts | 475 +++ .../visualDesigner/codeGenerator.ts | 415 ++ ui/src/components/visualDesigner/types.ts | 153 + ui/src/contexts/ComponentContext.tsx | 237 +- ui/src/proxy/developerKit/componentInfo.ts | 26 +- ui/src/services/developerKit.service.ts | 8 +- ui/src/utils/codeParser.ts | 799 ---- .../developerKit/ComponentCodeLayout.tsx | 678 +--- ui/src/views/developerKit/ComponentEditor.tsx | 89 +- .../views/developerKit/ComponentManager.tsx | 88 +- .../developerKit/VisualComponentDesigner.tsx | 3423 +++++++++++++++++ ui/src/views/list/GanttView.tsx | 22 +- ui/src/views/list/Grid.tsx | 2 +- ui/src/views/list/List.tsx | 31 +- 40 files changed, 6852 insertions(+), 4592 deletions(-) rename api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/{20260731143824_Initial.Designer.cs => 20260805202101_Initial.Designer.cs} (98%) rename api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/{20260731143824_Initial.cs => 20260805202101_Initial.cs} (98%) create mode 100644 ui/scripts/generate-component-metadata.mjs delete mode 100644 ui/src/components/codeLayout/ComponentCodeEditor.tsx delete mode 100644 ui/src/components/codeLayout/ComponentLibrary.tsx delete mode 100644 ui/src/components/codeLayout/ComponentSelector.tsx delete mode 100644 ui/src/components/codeLayout/PanelManager.tsx delete mode 100644 ui/src/components/codeLayout/PropertyPanel.tsx delete mode 100644 ui/src/components/codeLayout/data/tailwindClasses.ts delete mode 100644 ui/src/components/codeLayout/editorSettings/global.d.ts delete mode 100644 ui/src/components/codeLayout/editorSettings/monacoSetup.ts create mode 100644 ui/src/components/componentEditor/PlatformViewHost.tsx create mode 100644 ui/src/components/visualDesigner/VisualCanvas.tsx create mode 100644 ui/src/components/visualDesigner/catalog.ts create mode 100644 ui/src/components/visualDesigner/codeGenerator.ts create mode 100644 ui/src/components/visualDesigner/types.ts delete mode 100644 ui/src/utils/codeParser.ts create mode 100644 ui/src/views/developerKit/VisualComponentDesigner.tsx diff --git a/api/src/Sozsoft.Platform.Application/DeveloperKit/CustomComponentAppService.cs b/api/src/Sozsoft.Platform.Application/DeveloperKit/CustomComponentAppService.cs index d1e0cd9f..d7402803 100644 --- a/api/src/Sozsoft.Platform.Application/DeveloperKit/CustomComponentAppService.cs +++ b/api/src/Sozsoft.Platform.Application/DeveloperKit/CustomComponentAppService.cs @@ -22,6 +22,19 @@ public class CustomComponentAppService : CrudAppService< { } + public override async Task UpdateAsync( + Guid id, + CreateUpdateCustomComponentDto input) + { + if (input.Props is null) + { + var existingComponent = await Repository.GetAsync(id); + input.Props = existingComponent.Props; + } + + return await base.UpdateAsync(id, input); + } + public async Task> GetActiveComponentsAsync() { var components = await Repository.GetListAsync(x => x.IsActive); diff --git a/api/src/Sozsoft.Platform.Domain.Shared/PlatformConsts.cs b/api/src/Sozsoft.Platform.Domain.Shared/PlatformConsts.cs index 2b7002cf..da5a6c9b 100644 --- a/api/src/Sozsoft.Platform.Domain.Shared/PlatformConsts.cs +++ b/api/src/Sozsoft.Platform.Domain.Shared/PlatformConsts.cs @@ -25,7 +25,7 @@ public static class PlatformConsts { public static string Disabled = "{ \"disabled\" : true }"; public static string ShowClearButton = "{ \"showClearButton\" : true }"; - public static string HtmlEditorOptions = """{"mediaResizing":{"enabled":true},"imageUpload":{"tabs":["file","url"],"fileUploadMode":"base64"},"toolbar":{"multiline":true,"items":[{"name":"undo"},{"name":"redo"},{"name":"separator"},{"name":"size","acceptedValues":["8pt","10pt","12pt","14pt","18pt","24pt","36pt"],"options":{"inputAttr":{"aria-label":"Font size"}}},{"name":"font","acceptedValues":["Arial","Courier New","Georgia","Impact","Lucida Console","Tahoma","Times New Roman","Verdana"],"options":{"inputAttr":{"aria-label":"Font family"}}},{"name":"separator"},{"name":"bold"},{"name":"italic"},{"name":"strike"},{"name":"underline"},{"name":"separator"},{"name":"alignLeft"},{"name":"alignCenter"},{"name":"alignRight"},{"name":"alignJustify"},{"name":"separator"},{"name":"orderedList"},{"name":"bulletList"},{"name":"separator"},{"name":"header","acceptedValues":[false,1,2,3,4,5]},{"name":"separator"},{"name":"color"},{"name":"background"},{"name":"separator"},{"name":"link"},{"name":"image"},{"name":"separator"},{"name":"clear"},{"name":"codeBlock"},{"name":"blockquote"},{"name":"separator"},{"name":"insertTable"},{"name":"deleteTable"},{"name":"insertRowAbove"},{"name":"insertRowBelow"},{"name":"deleteRow"},{"name":"insertColumnLeft"},{"name":"insertColumnRight"},{"name":"deleteColumn"},{"name":"cellProperties"},{"name":"tableProperties"}]},"encodeHtml":true}"""; + public static string HtmlEditorOptions = """{"mediaResizing":{"enabled":true},"imageUpload":{"tabs":["file","url"],"fileUploadMode":"base64"},"toolbar":{"multiline":true,"items":[{"name":"undo"},{"name":"redo"},{"name":"separator"},{"name":"size","acceptedValues":["8pt","10pt","12pt","14pt","18pt","24pt","36pt"],"options":{"inputAttr":{"aria-label":"Font size"}}},{"name":"font","acceptedValues":["Arial","Courier New","Georgia","Impact","Lucida Console","Tahoma","Times New Roman","Verdana"],"options":{"inputAttr":{"aria-label":"Font family"}}},{"name":"separator"},{"name":"bold"},{"name":"italic"},{"name":"strike"},{"name":"underline"},{"name":"separator"},{"name":"alignLeft"},{"name":"alignCenter"},{"name":"alignRight"},{"name":"alignJustify"},{"name":"separator"},{"name":"orderedList"},{"name":"bulletList"},{"name":"separator"},{"name":"header","acceptedValues":[false,1,2,3,4,5]},{"name":"separator"},{"name":"color"},{"name":"background"},{"name":"separator"},{"name":"link"},{"name":"image"},{"name":"separator"},{"name":"clear"},{"name":"codeBlock"},{"name":"blockquote"},{"name":"separator"},{"name":"insertTable"},{"name":"deleteTable"},{"name":"insertRowAbove"},{"name":"insertRowBelow"},{"name":"deleteRow"},{"name":"insertColumnLeft"},{"name":"insertColumnRight"},{"name":"deleteColumn"},{"name":"cellProperties"},{"name":"tableProperties"}]},"encodeHtml":true,"height":200}"""; public static string PhoneEditorOptions = "{\"format\": \"phoneGlobal\", \"mask\":\"(000) 000-0000\", \"maskInvalidMessage\":\"Lütfen geçerli bir telefon numarası girin\", \"useMaskedValue\":false, \"maskRules\": { \"X\": \"[0-9]\" }, \"placeholder\": \"(555) 123-4567\" }"; public static string TimeSpanOptions = "{\"type\":\"time\",\"pickerType\":\"list\",\"displayFormat\":\"HH:mm\",\"dateSerializationFormat\":\"yyyy-MM-ddTHH:mm:ss\",\"interval\":5,\"width\":\"100%\"}"; public static string NumberStandartFormat(int precision = 2) => "{ \"format\": { \"type\": \"fixedPoint\", \"precision\": " + precision + " }, \"useMaskBehavior\": true, \"showSpinButtons\": true }"; diff --git a/api/src/Sozsoft.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs b/api/src/Sozsoft.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs index 900e2f8b..083c853f 100644 --- a/api/src/Sozsoft.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs +++ b/api/src/Sozsoft.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs @@ -196,8 +196,8 @@ public class PlatformDbContext : b.Property(a => a.Name).IsRequired().HasMaxLength(128); b.Property(a => a.ApiUrl).HasMaxLength(256); - b.Property(a => a.Description).HasColumnType("text"); - b.Property(a => a.Tenants).HasColumnType("text"); + b.Property(a => a.Description).HasColumnType("ntext"); + b.Property(a => a.Tenants).HasColumnType("ntext"); b.HasIndex(x => new { x.Name }).IsUnique().HasFilter(null); }); @@ -349,60 +349,60 @@ public class PlatformDbContext : b.Property(a => a.ListFormType).HasMaxLength(20); // Uzun JSON alanları için nvarchar(max) - b.Property(a => a.SelectCommand).HasColumnType("text"); - b.Property(a => a.SelectFieldsDefaultValueJson).HasColumnType("text"); + b.Property(a => a.SelectCommand).HasColumnType("ntext"); + b.Property(a => a.SelectFieldsDefaultValueJson).HasColumnType("ntext"); b.Property(a => a.DefaultFilter).IsUnicode(true); - b.Property(a => a.ColumnOptionJson).HasColumnType("text"); - b.Property(a => a.PivotOptionJson).HasColumnType("text"); - b.Property(a => a.FilterRowJson).HasColumnType("text"); - b.Property(a => a.HeaderFilterJson).HasColumnType("text"); - b.Property(a => a.FilterPanelJson).HasColumnType("text"); - b.Property(a => a.SearchPanelJson).HasColumnType("text"); - b.Property(a => a.GroupPanelJson).HasColumnType("text"); - b.Property(a => a.SelectionJson).HasColumnType("text"); - b.Property(a => a.PagerOptionJson).HasColumnType("text"); - b.Property(a => a.EditingOptionJson).HasColumnType("text"); - b.Property(a => a.EditingFormJson).HasColumnType("text"); - b.Property(a => a.PermissionJson).HasColumnType("text"); - b.Property(a => a.InsertFieldsDefaultValueJson).HasColumnType("text"); - b.Property(a => a.UpdateFieldsDefaultValueJson).HasColumnType("text"); - b.Property(a => a.DeleteFieldsDefaultValueJson).HasColumnType("text"); - b.Property(a => a.CommandColumnJson).HasColumnType("text"); - b.Property(a => a.StateStoringJson).HasColumnType("text"); - b.Property(a => a.DeleteCommand).HasColumnType("text"); - b.Property(a => a.UpdateCommand).HasColumnType("text"); - b.Property(a => a.InsertCommand).HasColumnType("text"); - b.Property(a => a.CustomJsSourcesJson).HasColumnType("text"); - b.Property(a => a.CustomStyleSourcesJson).HasColumnType("text"); - b.Property(a => a.FormFieldsDefaultValueJson).HasColumnType("text"); - b.Property(a => a.SubFormsJson).HasColumnType("text"); - b.Property(a => a.WidgetsJson).HasColumnType("text"); - b.Property(a => a.WorkflowJson).HasColumnType("text"); - b.Property(a => a.ExtraFilterJson).HasColumnType("text"); - b.Property(a => a.LayoutJson).HasColumnType("text"); - b.Property(a => a.TodoOptionJson).HasColumnType("text"); - b.Property(a => a.CommonJson).HasColumnType("text"); - b.Property(a => a.DataSourceJson).HasColumnType("text"); - b.Property(a => a.AdaptiveLayoutJson).HasColumnType("text"); - b.Property(a => a.AnimationJson).HasColumnType("text"); - b.Property(a => a.AnnotationsJson).HasColumnType("text"); - b.Property(a => a.ArgumentAxisJson).HasColumnType("text"); - b.Property(a => a.CommonAnnotationsSettingsJson).HasColumnType("text"); - b.Property(a => a.CommonAxisSettingsJson).HasColumnType("text"); - b.Property(a => a.CommonPaneSettingsJson).HasColumnType("text"); - b.Property(a => a.CommonSeriesSettingsJson).HasColumnType("text"); - b.Property(a => a.CrosshairJson).HasColumnType("text"); - b.Property(a => a.ExportJson).HasColumnType("text"); - b.Property(a => a.LegendJson).HasColumnType("text"); - b.Property(a => a.MarginJson).HasColumnType("text"); - b.Property(a => a.PanesJson).HasColumnType("text"); - b.Property(a => a.ScrollBarJson).HasColumnType("text"); - b.Property(a => a.SeriesJson).HasColumnType("text"); - b.Property(a => a.SizeJson).HasColumnType("text"); - b.Property(a => a.TitleJson).HasColumnType("text"); - b.Property(a => a.TooltipJson).HasColumnType("text"); - b.Property(a => a.ValueAxisJson).HasColumnType("text"); - b.Property(a => a.ZoomAndPanJson).HasColumnType("text"); + b.Property(a => a.ColumnOptionJson).HasColumnType("ntext"); + b.Property(a => a.PivotOptionJson).HasColumnType("ntext"); + b.Property(a => a.FilterRowJson).HasColumnType("ntext"); + b.Property(a => a.HeaderFilterJson).HasColumnType("ntext"); + b.Property(a => a.FilterPanelJson).HasColumnType("ntext"); + b.Property(a => a.SearchPanelJson).HasColumnType("ntext"); + b.Property(a => a.GroupPanelJson).HasColumnType("ntext"); + b.Property(a => a.SelectionJson).HasColumnType("ntext"); + b.Property(a => a.PagerOptionJson).HasColumnType("ntext"); + b.Property(a => a.EditingOptionJson).HasColumnType("ntext"); + b.Property(a => a.EditingFormJson).HasColumnType("ntext"); + b.Property(a => a.PermissionJson).HasColumnType("ntext"); + b.Property(a => a.InsertFieldsDefaultValueJson).HasColumnType("ntext"); + b.Property(a => a.UpdateFieldsDefaultValueJson).HasColumnType("ntext"); + b.Property(a => a.DeleteFieldsDefaultValueJson).HasColumnType("ntext"); + b.Property(a => a.CommandColumnJson).HasColumnType("ntext"); + b.Property(a => a.StateStoringJson).HasColumnType("ntext"); + b.Property(a => a.DeleteCommand).HasColumnType("ntext"); + b.Property(a => a.UpdateCommand).HasColumnType("ntext"); + b.Property(a => a.InsertCommand).HasColumnType("ntext"); + b.Property(a => a.CustomJsSourcesJson).HasColumnType("ntext"); + b.Property(a => a.CustomStyleSourcesJson).HasColumnType("ntext"); + b.Property(a => a.FormFieldsDefaultValueJson).HasColumnType("ntext"); + b.Property(a => a.SubFormsJson).HasColumnType("ntext"); + b.Property(a => a.WidgetsJson).HasColumnType("ntext"); + b.Property(a => a.WorkflowJson).HasColumnType("ntext"); + b.Property(a => a.ExtraFilterJson).HasColumnType("ntext"); + b.Property(a => a.LayoutJson).HasColumnType("ntext"); + b.Property(a => a.TodoOptionJson).HasColumnType("ntext"); + b.Property(a => a.CommonJson).HasColumnType("ntext"); + b.Property(a => a.DataSourceJson).HasColumnType("ntext"); + b.Property(a => a.AdaptiveLayoutJson).HasColumnType("ntext"); + b.Property(a => a.AnimationJson).HasColumnType("ntext"); + b.Property(a => a.AnnotationsJson).HasColumnType("ntext"); + b.Property(a => a.ArgumentAxisJson).HasColumnType("ntext"); + b.Property(a => a.CommonAnnotationsSettingsJson).HasColumnType("ntext"); + b.Property(a => a.CommonAxisSettingsJson).HasColumnType("ntext"); + b.Property(a => a.CommonPaneSettingsJson).HasColumnType("ntext"); + b.Property(a => a.CommonSeriesSettingsJson).HasColumnType("ntext"); + b.Property(a => a.CrosshairJson).HasColumnType("ntext"); + b.Property(a => a.ExportJson).HasColumnType("ntext"); + b.Property(a => a.LegendJson).HasColumnType("ntext"); + b.Property(a => a.MarginJson).HasColumnType("ntext"); + b.Property(a => a.PanesJson).HasColumnType("ntext"); + b.Property(a => a.ScrollBarJson).HasColumnType("ntext"); + b.Property(a => a.SeriesJson).HasColumnType("ntext"); + b.Property(a => a.SizeJson).HasColumnType("ntext"); + b.Property(a => a.TitleJson).HasColumnType("ntext"); + b.Property(a => a.TooltipJson).HasColumnType("ntext"); + b.Property(a => a.ValueAxisJson).HasColumnType("ntext"); + b.Property(a => a.ZoomAndPanJson).HasColumnType("ntext"); b.HasIndex(x => new { x.ListFormCode }).IsUnique().HasFilter(null); @@ -438,27 +438,27 @@ public class PlatformDbContext : b.Property(a => a.BandName).HasMaxLength(128); // JSON alanlar - b.Property(a => a.ColumnFilterJson).HasColumnType("text"); - b.Property(a => a.ColumnHeaderJson).HasColumnType("text"); - b.Property(a => a.GroupingJson).HasColumnType("text"); - b.Property(a => a.ColumnCustomizationJson).HasColumnType("text"); - b.Property(a => a.TotalSummaryJson).HasColumnType("text"); - b.Property(a => a.GroupSummaryJson).HasColumnType("text"); - b.Property(a => a.JoinTableJson).HasColumnType("text"); - b.Property(a => a.LookupJson).HasColumnType("text"); - b.Property(a => a.ValidationRuleJson).HasColumnType("text"); - b.Property(a => a.ColumnStylingJson).HasColumnType("text"); - b.Property(a => a.PermissionJson).HasColumnType("text"); - b.Property(a => a.PivotSettingsJson).HasColumnType("text"); + b.Property(a => a.ColumnFilterJson).HasColumnType("ntext"); + b.Property(a => a.ColumnHeaderJson).HasColumnType("ntext"); + b.Property(a => a.GroupingJson).HasColumnType("ntext"); + b.Property(a => a.ColumnCustomizationJson).HasColumnType("ntext"); + b.Property(a => a.TotalSummaryJson).HasColumnType("ntext"); + b.Property(a => a.GroupSummaryJson).HasColumnType("ntext"); + b.Property(a => a.JoinTableJson).HasColumnType("ntext"); + b.Property(a => a.LookupJson).HasColumnType("ntext"); + b.Property(a => a.ValidationRuleJson).HasColumnType("ntext"); + b.Property(a => a.ColumnStylingJson).HasColumnType("ntext"); + b.Property(a => a.PermissionJson).HasColumnType("ntext"); + b.Property(a => a.PivotSettingsJson).HasColumnType("ntext"); // Stil ve format b.Property(a => a.ColumnCssClass).HasMaxLength(128); b.Property(a => a.ColumnCssValue).HasMaxLength(256); b.Property(a => a.Alignment).HasMaxLength(20).HasDefaultValue("left"); b.Property(a => a.Format).HasMaxLength(128); - b.Property(a => a.EditorOptions).HasColumnType("text"); + b.Property(a => a.EditorOptions).HasColumnType("ntext"); b.Property(a => a.EditorType2).HasMaxLength(64); - b.Property(a => a.EditorScript).HasColumnType("text"); + b.Property(a => a.EditorScript).HasColumnType("ntext"); b.HasIndex(x => new { x.ListFormCode, x.UserId, x.RoleId, x.CultureName, x.FieldName }).IsUnique().HasFilter(null); }); @@ -472,7 +472,7 @@ public class PlatformDbContext : b.Property(a => a.UserId).HasMaxLength(256); b.Property(a => a.RoleId).HasMaxLength(256); b.Property(a => a.FilterName).HasMaxLength(128); - b.Property(a => a.CustomizationData).HasColumnType("text"); + b.Property(a => a.CustomizationData).HasColumnType("ntext"); b.Property(a => a.CustomizationType).IsRequired(); }); @@ -496,7 +496,7 @@ public class PlatformDbContext : b.Property(x => x.ImportId).IsRequired(); b.Property(x => x.BlobName).IsRequired().HasMaxLength(256); b.Property(x => x.Status).IsRequired().HasMaxLength(64); - b.Property(x => x.ErrorsJson).HasColumnType("text"); + b.Property(x => x.ErrorsJson).HasColumnType("ntext"); }); builder.Entity(b => @@ -519,7 +519,7 @@ public class PlatformDbContext : b.Property(x => x.NextOnReject).IsRequired().HasMaxLength(128); b.Property(x => x.PositionX).IsRequired(); b.Property(x => x.PositionY).IsRequired(); - b.Property(x => x.CompareOutcomesJson).HasColumnType("text"); + b.Property(x => x.CompareOutcomesJson).HasColumnType("ntext"); }); builder.Entity(b => @@ -546,7 +546,7 @@ public class PlatformDbContext : b.Property(a => a.DataSourceCode).HasMaxLength(64); b.Property(a => a.BeforeSp).HasMaxLength(128); b.Property(a => a.AfterSp).HasMaxLength(128); - b.Property(a => a.Options).HasColumnType("text"); + b.Property(a => a.Options).HasColumnType("ntext"); b.HasIndex(x => new { x.Name }).IsUnique().HasFilter("[IsDeleted] = 0"); }); @@ -638,8 +638,8 @@ public class PlatformDbContext : b.Property(a => a.Method).IsRequired().HasMaxLength(10); b.Property(a => a.DataSourceCode).IsRequired().HasMaxLength(128); b.Property(a => a.Sql).IsRequired(); - b.Property(a => a.ParametersJson).HasColumnType("text"); - b.Property(a => a.PermissionsJson).HasColumnType("text"); + b.Property(a => a.ParametersJson).HasColumnType("ntext"); + b.Property(a => a.PermissionsJson).HasColumnType("ntext"); b.HasIndex(x => new { x.TenantId, x.Name }).IsUnique().HasFilter("[IsDeleted] = 0"); }); @@ -652,7 +652,9 @@ public class PlatformDbContext : b.Property(x => x.Name).IsRequired().HasMaxLength(128); b.Property(x => x.RoutePath).IsRequired().HasMaxLength(512); b.Property(x => x.Code).IsRequired(); - b.Property(x => x.Props).HasMaxLength(1024); + // The visual designer document contains user-facing text. Keep it Unicode so + // Turkish and other non-ASCII property values survive a database round-trip. + b.Property(x => x.Props).HasColumnType("nvarchar(max)"); b.Property(x => x.Description).HasMaxLength(512); b.Property(x => x.Dependencies).HasMaxLength(2048); @@ -931,9 +933,9 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.About)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.StatsJson).HasColumnType("text"); - b.Property(x => x.DescriptionsJson).HasColumnType("text"); - b.Property(x => x.SectionsJson).HasColumnType("text"); + b.Property(x => x.StatsJson).HasColumnType("ntext"); + b.Property(x => x.DescriptionsJson).HasColumnType("ntext"); + b.Property(x => x.SectionsJson).HasColumnType("ntext"); }); builder.Entity(b => @@ -951,9 +953,9 @@ public class PlatformDbContext : b.Property(x => x.CtaTitleKey).HasMaxLength(256); b.Property(x => x.CtaSubtitleKey).HasMaxLength(256); b.Property(x => x.CtaButtonLabelKey).HasMaxLength(256); - b.Property(x => x.SlidesJson).HasColumnType("text"); - b.Property(x => x.FeaturesJson).HasColumnType("text"); - b.Property(x => x.SolutionsJson).HasColumnType("text"); + b.Property(x => x.SlidesJson).HasColumnType("ntext"); + b.Property(x => x.FeaturesJson).HasColumnType("ntext"); + b.Property(x => x.SolutionsJson).HasColumnType("ntext"); }); builder.Entity(b => @@ -1143,9 +1145,9 @@ public class PlatformDbContext : b.Property(x => x.Email).HasMaxLength(128); b.Property(x => x.Location).HasMaxLength(256); - b.Property(x => x.BankJson).HasColumnType("text"); - b.Property(x => x.WorkHoursJson).HasColumnType("text"); - b.Property(x => x.MapJson).HasColumnType("text"); + b.Property(x => x.BankJson).HasColumnType("ntext"); + b.Property(x => x.WorkHoursJson).HasColumnType("ntext"); + b.Property(x => x.MapJson).HasColumnType("ntext"); }); builder.Entity(b => @@ -1162,10 +1164,10 @@ public class PlatformDbContext : b.Property(x => x.Name).IsRequired().HasMaxLength(256); b.Property(x => x.DisplayName).HasMaxLength(512); b.Property(x => x.Description).HasMaxLength(2048); - b.Property(x => x.Code).IsRequired().HasColumnType("text"); // Uzun C# kod metni için + b.Property(x => x.Code).IsRequired().HasColumnType("ntext"); // Uzun C# kod metni için b.Property(x => x.IsActive).IsRequired().HasDefaultValue(true); b.Property(x => x.CompilationStatus).IsRequired().HasConversion().HasMaxLength(20); - b.Property(x => x.LastCompilationError).HasColumnType("text"); // Uzun hata mesajları için + b.Property(x => x.LastCompilationError).HasColumnType("ntext"); // Uzun hata mesajları için b.Property(x => x.LastSuccessfulCompilation).IsRequired(false); b.Property(x => x.Version).IsRequired().HasDefaultValue(1); b.Property(x => x.CodeHash).HasMaxLength(64); @@ -1187,7 +1189,7 @@ public class PlatformDbContext : b.Property(x => x.PublishDate).IsRequired(); b.Property(x => x.Attachments).HasMaxLength(2048); b.Property(x => x.ViewCount).HasDefaultValue(0); - b.Property(x => x.ImageUrl).HasColumnType("text"); + b.Property(x => x.ImageUrl).HasColumnType("ntext"); b.HasIndex(x => new { x.TenantId, x.Title }).IsUnique().HasFilter("[IsDeleted] = 0"); }); @@ -1403,7 +1405,7 @@ public class PlatformDbContext : b.Property(x => x.Description).HasMaxLength(1024); b.Property(x => x.Status).HasMaxLength(20); b.Property(x => x.isPublished).HasDefaultValue(false); - b.Property(x => x.Photos).HasColumnType("text"); + b.Property(x => x.Photos).HasColumnType("ntext"); b.HasIndex(x => new { x.TenantId, x.CategoryId, x.TypeId, x.Name }).IsUnique().HasFilter("[IsDeleted] = 0"); @@ -1452,7 +1454,7 @@ public class PlatformDbContext : b.Property(x => x.Title).HasMaxLength(256); b.Property(x => x.ParticipantKey).IsRequired().HasMaxLength(512); - b.Property(x => x.ParticipantIdsJson).IsRequired().HasColumnType("text"); + b.Property(x => x.ParticipantIdsJson).IsRequired().HasColumnType("ntext"); b.Property(x => x.LastMessagePreview).HasMaxLength(512); b.Property(x => x.MessageCount).HasDefaultValue(0); @@ -1469,9 +1471,9 @@ public class PlatformDbContext : b.Property(x => x.SenderUserName).IsRequired().HasMaxLength(256); b.Property(x => x.SenderName).IsRequired().HasMaxLength(256); - b.Property(x => x.RecipientIdsJson).IsRequired().HasColumnType("text"); + b.Property(x => x.RecipientIdsJson).IsRequired().HasColumnType("ntext"); b.Property(x => x.Text).HasMaxLength(4096); - b.Property(x => x.AttachmentsJson).IsRequired().HasColumnType("text"); + b.Property(x => x.AttachmentsJson).IsRequired().HasColumnType("ntext"); b.Property(x => x.SentAt).IsRequired(); b.HasIndex(x => new { x.TenantId, x.ConversationId, x.SentAt }); @@ -1575,7 +1577,7 @@ public class PlatformDbContext : b.Property(x => x.ResourceName).HasMaxLength(64); b.Property(x => x.MaxForms).HasDefaultValue(500); b.Property(x => x.CacheKey).HasMaxLength(512).IsRequired(); - b.Property(x => x.JsonData).IsRequired().HasColumnType("text"); + b.Property(x => x.JsonData).IsRequired().HasColumnType("ntext"); b.Property(x => x.FormCount).HasDefaultValue(0); b.Property(x => x.FieldCount).HasDefaultValue(0); b.Property(x => x.JsonLength).HasDefaultValue(0); @@ -1594,7 +1596,7 @@ public class PlatformDbContext : b.Property(e => e.Title).HasMaxLength(512).IsRequired(); b.Property(e => e.Status).HasMaxLength(64).IsRequired(); - b.Property(e => e.Description).HasColumnType("text"); + b.Property(e => e.Description).HasColumnType("ntext"); b.Property(e => e.Tags).HasMaxLength(256); b.Property(e => e.Assignees).HasMaxLength(512); b.Property(e => e.Priority).HasMaxLength(64); @@ -1610,10 +1612,10 @@ public class PlatformDbContext : b.Property(e => e.UserName).HasMaxLength(256).IsRequired(); b.Property(e => e.Text).HasMaxLength(512).IsRequired(); - b.Property(e => e.Description).HasColumnType("text"); + b.Property(e => e.Description).HasColumnType("ntext"); b.Property(e => e.AllDay).HasDefaultValue(false); b.Property(e => e.RecurrenceRule).HasMaxLength(512); - b.Property(e => e.RecurrenceException).HasColumnType("text"); + b.Property(e => e.RecurrenceException).HasColumnType("ntext"); }); ConfigureProviderSpecificModel(builder); diff --git a/api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/20260731143824_Initial.Designer.cs b/api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/20260805202101_Initial.Designer.cs similarity index 98% rename from api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/20260731143824_Initial.Designer.cs rename to api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/20260805202101_Initial.Designer.cs index 719b591f..eaf579f0 100644 --- a/api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/20260731143824_Initial.Designer.cs +++ b/api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/20260805202101_Initial.Designer.cs @@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore; namespace Sozsoft.Platform.Migrations { [DbContext(typeof(PlatformDbContext))] - [Migration("20260731143824_Initial")] + [Migration("20260805202101_Initial")] partial class Initial { /// @@ -652,7 +652,7 @@ namespace Sozsoft.Platform.Migrations .HasColumnName("DeletionTime"); b.Property("DescriptionsJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("IsDeleted") .ValueGeneratedOnAdd() @@ -669,10 +669,10 @@ namespace Sozsoft.Platform.Migrations .HasColumnName("LastModifierId"); b.Property("SectionsJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("StatsJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.HasKey("Id"); @@ -706,7 +706,7 @@ namespace Sozsoft.Platform.Migrations .HasColumnName("DeletionTime"); b.Property("Description") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("EndDate") .HasColumnType("datetime2"); @@ -726,7 +726,7 @@ namespace Sozsoft.Platform.Migrations .HasColumnName("LastModifierId"); b.Property("RecurrenceException") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("RecurrenceRule") .HasMaxLength(512) @@ -764,7 +764,7 @@ namespace Sozsoft.Platform.Migrations .HasColumnType("nvarchar(256)"); b.Property("Description") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("IsActive") .HasColumnType("bit"); @@ -775,7 +775,7 @@ namespace Sozsoft.Platform.Migrations .HasColumnType("nvarchar(128)"); b.Property("Tenants") - .HasColumnType("text"); + .HasColumnType("ntext"); b.HasKey("Id"); @@ -829,7 +829,7 @@ namespace Sozsoft.Platform.Migrations .HasColumnType("datetime2"); b.Property("ImageUrl") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("IsDeleted") .ValueGeneratedOnAdd() @@ -1059,7 +1059,7 @@ namespace Sozsoft.Platform.Migrations .HasColumnType("nvarchar(128)"); b.Property("Options") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("WorkerType") .HasColumnType("int"); @@ -1453,7 +1453,7 @@ namespace Sozsoft.Platform.Migrations .HasColumnType("nvarchar(512)"); b.Property("BankJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("CreationTime") .HasColumnType("datetime2") @@ -1494,7 +1494,7 @@ namespace Sozsoft.Platform.Migrations .HasColumnType("nvarchar(256)"); b.Property("MapJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("PhoneNumber") .HasMaxLength(20) @@ -1504,7 +1504,7 @@ namespace Sozsoft.Platform.Migrations .HasColumnType("bigint"); b.Property("WorkHoursJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.HasKey("Id"); @@ -1898,8 +1898,7 @@ namespace Sozsoft.Platform.Migrations .HasColumnType("nvarchar(128)"); b.Property("Props") - .HasMaxLength(1024) - .HasColumnType("nvarchar(1024)"); + .HasColumnType("nvarchar(max)"); b.Property("RoutePath") .IsRequired() @@ -1978,10 +1977,10 @@ namespace Sozsoft.Platform.Migrations .HasColumnType("nvarchar(128)"); b.Property("ParametersJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("PermissionsJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("Sql") .IsRequired() @@ -2103,7 +2102,7 @@ namespace Sozsoft.Platform.Migrations b.Property("JsonData") .IsRequired() - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("JsonLength") .ValueGeneratedOnAdd() @@ -2323,7 +2322,7 @@ namespace Sozsoft.Platform.Migrations .HasColumnName("DeletionTime"); b.Property("Description") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("DueDate") .HasColumnType("datetime2"); @@ -2458,7 +2457,7 @@ namespace Sozsoft.Platform.Migrations b.Property("Code") .IsRequired() - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("CodeHash") .HasMaxLength(64) @@ -2509,7 +2508,7 @@ namespace Sozsoft.Platform.Migrations .HasColumnName("IsDeleted"); b.Property("LastCompilationError") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("LastModificationTime") .HasColumnType("datetime2") @@ -2606,7 +2605,7 @@ namespace Sozsoft.Platform.Migrations .HasColumnType("int"); b.Property("Photos") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("Place") .HasMaxLength(256) @@ -2937,7 +2936,7 @@ namespace Sozsoft.Platform.Migrations .HasColumnName("DeletionTime"); b.Property("FeaturesJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("FeaturesSubtitleKey") .HasMaxLength(256) @@ -2974,10 +2973,10 @@ namespace Sozsoft.Platform.Migrations .HasColumnName("LastModifierId"); b.Property("SlidesJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("SolutionsJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("SolutionsSubtitleKey") .HasMaxLength(256) @@ -3180,40 +3179,40 @@ namespace Sozsoft.Platform.Migrations .HasColumnType("uniqueidentifier"); b.Property("AdaptiveLayoutJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("AnimationJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("AnnotationsJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("ArgumentAxisJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("ColumnOptionJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("CommandColumnJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("CommonAnnotationsSettingsJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("CommonAxisSettingsJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("CommonJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("CommonPaneSettingsJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("CommonSeriesSettingsJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("CrosshairJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("CultureName") .IsRequired() @@ -3221,17 +3220,17 @@ namespace Sozsoft.Platform.Migrations .HasColumnType("nvarchar(10)"); b.Property("CustomJsSourcesJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("CustomStyleSourcesJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("DataSourceCode") .HasMaxLength(128) .HasColumnType("nvarchar(128)"); b.Property("DataSourceJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("DefaultFilter") .IsUnicode(true) @@ -3244,10 +3243,10 @@ namespace Sozsoft.Platform.Migrations .HasColumnType("nvarchar(max)"); b.Property("DeleteCommand") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("DeleteFieldsDefaultValueJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("DeleteServiceAddress") .HasMaxLength(256) @@ -3258,25 +3257,25 @@ namespace Sozsoft.Platform.Migrations .HasColumnType("nvarchar(512)"); b.Property("EditingFormJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("EditingOptionJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("ExportJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("ExtraFilterJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("FilterPanelJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("FilterRowJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("FormFieldsDefaultValueJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("FullHeight") .HasColumnType("bit"); @@ -3285,10 +3284,10 @@ namespace Sozsoft.Platform.Migrations .HasColumnType("nvarchar(max)"); b.Property("GroupPanelJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("HeaderFilterJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("Height") .HasColumnType("int"); @@ -3300,10 +3299,10 @@ namespace Sozsoft.Platform.Migrations .HasColumnType("nvarchar(max)"); b.Property("InsertCommand") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("InsertFieldsDefaultValueJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("InsertServiceAddress") .HasMaxLength(256) @@ -3329,10 +3328,10 @@ namespace Sozsoft.Platform.Migrations .HasColumnType("nvarchar(64)"); b.Property("LayoutJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("LegendJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("ListFormCode") .IsRequired() @@ -3344,7 +3343,7 @@ namespace Sozsoft.Platform.Migrations .HasColumnType("nvarchar(20)"); b.Property("MarginJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("Name") .HasMaxLength(128) @@ -3356,16 +3355,16 @@ namespace Sozsoft.Platform.Migrations .HasDefaultValue(50); b.Property("PagerOptionJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("PanesJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("PermissionJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("PivotOptionJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("RoleId") .HasMaxLength(256) @@ -3378,41 +3377,41 @@ namespace Sozsoft.Platform.Migrations .HasColumnType("nvarchar(max)"); b.Property("ScrollBarJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("SearchPanelJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("SelectCommand") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("SelectCommandType") .HasColumnType("int"); b.Property("SelectFieldsDefaultValueJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("SelectionJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("SeriesJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("ShowNote") .HasColumnType("bit"); b.Property("SizeJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("SortMode") .HasMaxLength(20) .HasColumnType("nvarchar(20)"); b.Property("StateStoringJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("SubFormsJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("SubFormsListFormType") .HasColumnType("nvarchar(max)"); @@ -3426,13 +3425,13 @@ namespace Sozsoft.Platform.Migrations .HasColumnType("nvarchar(256)"); b.Property("TitleJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("TodoOptionJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("TooltipJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("TreeOptionJson") .HasColumnType("nvarchar(max)"); @@ -3444,10 +3443,10 @@ namespace Sozsoft.Platform.Migrations .HasColumnType("nvarchar(max)"); b.Property("UpdateCommand") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("UpdateFieldsDefaultValueJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("UpdateServiceAddress") .HasMaxLength(256) @@ -3458,19 +3457,19 @@ namespace Sozsoft.Platform.Migrations .HasColumnType("nvarchar(256)"); b.Property("ValueAxisJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("WidgetsJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("Width") .HasColumnType("int"); b.Property("WorkflowJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("ZoomAndPanJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.HasKey("Id"); @@ -3494,7 +3493,7 @@ namespace Sozsoft.Platform.Migrations .HasColumnName("CreatorId"); b.Property("CustomizationData") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("CustomizationType") .HasColumnType("int"); @@ -3591,16 +3590,16 @@ namespace Sozsoft.Platform.Migrations .HasColumnType("nvarchar(256)"); b.Property("ColumnCustomizationJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("ColumnFilterJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("ColumnHeaderJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("ColumnStylingJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("CultureName") .IsRequired() @@ -3614,10 +3613,10 @@ namespace Sozsoft.Platform.Migrations .HasColumnType("int"); b.Property("EditorOptions") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("EditorScript") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("EditorType2") .HasMaxLength(64) @@ -3633,10 +3632,10 @@ namespace Sozsoft.Platform.Migrations .HasColumnType("nvarchar(128)"); b.Property("GroupSummaryJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("GroupingJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("IsActive") .ValueGeneratedOnAdd() @@ -3644,7 +3643,7 @@ namespace Sozsoft.Platform.Migrations .HasDefaultValue(true); b.Property("JoinTableJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("ListFormCode") .IsRequired() @@ -3657,13 +3656,13 @@ namespace Sozsoft.Platform.Migrations .HasDefaultValue(30); b.Property("LookupJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("PermissionJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("PivotSettingsJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("PlaceHolder") .HasMaxLength(256) @@ -3684,14 +3683,14 @@ namespace Sozsoft.Platform.Migrations .HasColumnType("int"); b.Property("TotalSummaryJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("UserId") .HasMaxLength(256) .HasColumnType("nvarchar(256)"); b.Property("ValidationRuleJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("Visible") .ValueGeneratedOnAdd() @@ -3801,7 +3800,7 @@ namespace Sozsoft.Platform.Migrations .HasColumnType("int"); b.Property("ErrorsJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("ExecRows") .HasColumnType("int"); @@ -3863,7 +3862,7 @@ namespace Sozsoft.Platform.Migrations .HasColumnType("nvarchar(20)"); b.Property("CompareOutcomesJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("CompareValue") .HasPrecision(18, 2) @@ -4095,7 +4094,7 @@ namespace Sozsoft.Platform.Migrations b.Property("ParticipantIdsJson") .IsRequired() - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("ParticipantKey") .IsRequired() @@ -4122,7 +4121,7 @@ namespace Sozsoft.Platform.Migrations b.Property("AttachmentsJson") .IsRequired() - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("ConversationId") .HasColumnType("uniqueidentifier"); @@ -4159,7 +4158,7 @@ namespace Sozsoft.Platform.Migrations b.Property("RecipientIdsJson") .IsRequired() - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("SenderId") .HasColumnType("uniqueidentifier"); diff --git a/api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/20260731143824_Initial.cs b/api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/20260805202101_Initial.cs similarity index 98% rename from api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/20260731143824_Initial.cs rename to api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/20260805202101_Initial.cs index 9b3d0366..85b21f28 100644 --- a/api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/20260731143824_Initial.cs +++ b/api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/20260805202101_Initial.cs @@ -489,12 +489,12 @@ namespace Sozsoft.Platform.Migrations TenantId = table.Column(type: "uniqueidentifier", nullable: true), UserName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), Text = table.Column(type: "nvarchar(512)", maxLength: 512, nullable: false), - Description = table.Column(type: "text", nullable: true), + Description = table.Column(type: "ntext", nullable: true), StartDate = table.Column(type: "datetime2", nullable: false), EndDate = table.Column(type: "datetime2", nullable: false), AllDay = table.Column(type: "bit", nullable: true, defaultValue: false), RecurrenceRule = table.Column(type: "nvarchar(512)", maxLength: 512, nullable: true), - RecurrenceException = table.Column(type: "text", nullable: true), + RecurrenceException = table.Column(type: "ntext", nullable: true), CreationTime = table.Column(type: "datetime2", nullable: false), CreatorId = table.Column(type: "uniqueidentifier", nullable: true), LastModificationTime = table.Column(type: "datetime2", nullable: true), @@ -517,7 +517,7 @@ namespace Sozsoft.Platform.Migrations Title = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), Excerpt = table.Column(type: "nvarchar(512)", maxLength: 512, nullable: false), Content = table.Column(type: "nvarchar(max)", maxLength: 4096, nullable: false), - ImageUrl = table.Column(type: "text", nullable: true), + ImageUrl = table.Column(type: "ntext", nullable: true), Category = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), UserId = table.Column(type: "uniqueidentifier", nullable: true), PublishDate = table.Column(type: "datetime2", nullable: false), @@ -630,7 +630,7 @@ namespace Sozsoft.Platform.Migrations TenantId = table.Column(type: "uniqueidentifier", nullable: true), Title = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), ParticipantKey = table.Column(type: "nvarchar(512)", maxLength: 512, nullable: false), - ParticipantIdsJson = table.Column(type: "text", nullable: false), + ParticipantIdsJson = table.Column(type: "ntext", nullable: false), IsGroup = table.Column(type: "bit", nullable: false), LastSenderId = table.Column(type: "uniqueidentifier", nullable: true), LastMessagePreview = table.Column(type: "nvarchar(512)", maxLength: 512, nullable: true), @@ -926,9 +926,9 @@ namespace Sozsoft.Platform.Migrations columns: table => new { Id = table.Column(type: "uniqueidentifier", nullable: false), - StatsJson = table.Column(type: "text", nullable: true), - DescriptionsJson = table.Column(type: "text", nullable: true), - SectionsJson = table.Column(type: "text", nullable: true), + StatsJson = table.Column(type: "ntext", nullable: true), + DescriptionsJson = table.Column(type: "ntext", nullable: true), + SectionsJson = table.Column(type: "ntext", nullable: true), CreationTime = table.Column(type: "datetime2", nullable: false), CreatorId = table.Column(type: "uniqueidentifier", nullable: true), LastModificationTime = table.Column(type: "datetime2", nullable: true), @@ -950,8 +950,8 @@ namespace Sozsoft.Platform.Migrations Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), IsActive = table.Column(type: "bit", nullable: false), ApiUrl = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), - Description = table.Column(type: "text", nullable: true), - Tenants = table.Column(type: "text", nullable: true) + Description = table.Column(type: "ntext", nullable: true), + Tenants = table.Column(type: "ntext", nullable: true) }, constraints: table => { @@ -970,7 +970,7 @@ namespace Sozsoft.Platform.Migrations DataSourceCode = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), BeforeSp = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), AfterSp = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), - Options = table.Column(type: "text", nullable: true), + Options = table.Column(type: "ntext", nullable: true), CreationTime = table.Column(type: "datetime2", nullable: false), CreatorId = table.Column(type: "uniqueidentifier", nullable: true), LastModificationTime = table.Column(type: "datetime2", nullable: true), @@ -1045,9 +1045,9 @@ namespace Sozsoft.Platform.Migrations Email = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), Location = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), TaxNumber = table.Column(type: "bigint", nullable: true), - BankJson = table.Column(type: "text", nullable: true), - WorkHoursJson = table.Column(type: "text", nullable: true), - MapJson = table.Column(type: "text", nullable: true), + BankJson = table.Column(type: "ntext", nullable: true), + WorkHoursJson = table.Column(type: "ntext", nullable: true), + MapJson = table.Column(type: "ntext", nullable: true), CreationTime = table.Column(type: "datetime2", nullable: false), CreatorId = table.Column(type: "uniqueidentifier", nullable: true), LastModificationTime = table.Column(type: "datetime2", nullable: true), @@ -1158,7 +1158,7 @@ namespace Sozsoft.Platform.Migrations Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), RoutePath = table.Column(type: "nvarchar(512)", maxLength: 512, nullable: false), Code = table.Column(type: "nvarchar(max)", nullable: false), - Props = table.Column(type: "nvarchar(1024)", maxLength: 1024, nullable: true), + Props = table.Column(type: "nvarchar(max)", nullable: true), Description = table.Column(type: "nvarchar(512)", maxLength: 512, nullable: true), IsActive = table.Column(type: "bit", nullable: false), Dependencies = table.Column(type: "nvarchar(2048)", maxLength: 2048, nullable: true), @@ -1187,8 +1187,8 @@ namespace Sozsoft.Platform.Migrations Method = table.Column(type: "nvarchar(10)", maxLength: 10, nullable: false), DataSourceCode = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), Sql = table.Column(type: "nvarchar(max)", nullable: false), - ParametersJson = table.Column(type: "text", nullable: true), - PermissionsJson = table.Column(type: "text", nullable: true), + ParametersJson = table.Column(type: "ntext", nullable: true), + PermissionsJson = table.Column(type: "ntext", nullable: true), CreationTime = table.Column(type: "datetime2", nullable: false), CreatorId = table.Column(type: "uniqueidentifier", nullable: true), LastModificationTime = table.Column(type: "datetime2", nullable: true), @@ -1237,7 +1237,7 @@ namespace Sozsoft.Platform.Migrations ResourceName = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), MaxForms = table.Column(type: "int", nullable: false, defaultValue: 500), CacheKey = table.Column(type: "nvarchar(512)", maxLength: 512, nullable: false), - JsonData = table.Column(type: "text", nullable: false), + JsonData = table.Column(type: "ntext", nullable: false), FormCount = table.Column(type: "int", nullable: false, defaultValue: 0), FieldCount = table.Column(type: "int", nullable: false, defaultValue: 0), JsonLength = table.Column(type: "int", nullable: false, defaultValue: 0), @@ -1287,7 +1287,7 @@ namespace Sozsoft.Platform.Migrations RequestDate = table.Column(type: "datetime2", nullable: true), Title = table.Column(type: "nvarchar(512)", maxLength: 512, nullable: false), Status = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), - Description = table.Column(type: "text", nullable: true), + Description = table.Column(type: "ntext", nullable: true), DueDate = table.Column(type: "datetime2", nullable: true), Tags = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), Assignees = table.Column(type: "nvarchar(512)", maxLength: 512, nullable: true), @@ -1316,10 +1316,10 @@ namespace Sozsoft.Platform.Migrations Name = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), DisplayName = table.Column(type: "nvarchar(512)", maxLength: 512, nullable: true), Description = table.Column(type: "nvarchar(2048)", maxLength: 2048, nullable: true), - Code = table.Column(type: "text", nullable: false), + Code = table.Column(type: "ntext", nullable: false), IsActive = table.Column(type: "bit", nullable: false, defaultValue: true), CompilationStatus = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: false), - LastCompilationError = table.Column(type: "text", nullable: true), + LastCompilationError = table.Column(type: "ntext", nullable: true), LastSuccessfulCompilation = table.Column(type: "datetime2", nullable: true), Version = table.Column(type: "int", nullable: false, defaultValue: 1), CodeHash = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), @@ -1353,9 +1353,9 @@ namespace Sozsoft.Platform.Migrations CtaTitleKey = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), CtaSubtitleKey = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), CtaButtonLabelKey = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), - SlidesJson = table.Column(type: "text", nullable: true), - FeaturesJson = table.Column(type: "text", nullable: true), - SolutionsJson = table.Column(type: "text", nullable: true), + SlidesJson = table.Column(type: "ntext", nullable: true), + FeaturesJson = table.Column(type: "ntext", nullable: true), + SolutionsJson = table.Column(type: "ntext", nullable: true), CreationTime = table.Column(type: "datetime2", nullable: false), CreatorId = table.Column(type: "uniqueidentifier", nullable: true), LastModificationTime = table.Column(type: "datetime2", nullable: true), @@ -1432,10 +1432,10 @@ namespace Sozsoft.Platform.Migrations DataSourceCode = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), SelectCommandType = table.Column(type: "int", nullable: false), TableName = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), - SelectCommand = table.Column(type: "text", nullable: true), + SelectCommand = table.Column(type: "ntext", nullable: true), KeyFieldName = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), KeyFieldDbSourceType = table.Column(type: "int", nullable: false), - SelectFieldsDefaultValueJson = table.Column(type: "text", nullable: true), + SelectFieldsDefaultValueJson = table.Column(type: "ntext", nullable: true), Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), Description = table.Column(type: "nvarchar(512)", maxLength: 512, nullable: true), Title = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), @@ -1445,43 +1445,43 @@ namespace Sozsoft.Platform.Migrations Height = table.Column(type: "int", nullable: true), FullHeight = table.Column(type: "bit", nullable: false), DefaultFilter = table.Column(type: "nvarchar(max)", nullable: true), - ColumnOptionJson = table.Column(type: "text", nullable: true), - PivotOptionJson = table.Column(type: "text", nullable: true), + ColumnOptionJson = table.Column(type: "ntext", nullable: true), + PivotOptionJson = table.Column(type: "ntext", nullable: true), TreeOptionJson = table.Column(type: "nvarchar(max)", nullable: true), GanttOptionJson = table.Column(type: "nvarchar(max)", nullable: true), SchedulerOptionJson = table.Column(type: "nvarchar(max)", nullable: true), - TodoOptionJson = table.Column(type: "text", nullable: true), - FilterRowJson = table.Column(type: "text", nullable: true), + TodoOptionJson = table.Column(type: "ntext", nullable: true), + FilterRowJson = table.Column(type: "ntext", nullable: true), RowJson = table.Column(type: "nvarchar(max)", nullable: true), - HeaderFilterJson = table.Column(type: "text", nullable: true), - FilterPanelJson = table.Column(type: "text", nullable: true), - SearchPanelJson = table.Column(type: "text", nullable: true), - GroupPanelJson = table.Column(type: "text", nullable: true), - SelectionJson = table.Column(type: "text", nullable: true), - PagerOptionJson = table.Column(type: "text", nullable: true), - EditingOptionJson = table.Column(type: "text", nullable: true), - EditingFormJson = table.Column(type: "text", nullable: true), - PermissionJson = table.Column(type: "text", nullable: true), - InsertFieldsDefaultValueJson = table.Column(type: "text", nullable: true), - UpdateFieldsDefaultValueJson = table.Column(type: "text", nullable: true), - DeleteFieldsDefaultValueJson = table.Column(type: "text", nullable: true), - CommandColumnJson = table.Column(type: "text", nullable: true), - StateStoringJson = table.Column(type: "text", nullable: true), - DeleteCommand = table.Column(type: "text", nullable: true), + HeaderFilterJson = table.Column(type: "ntext", nullable: true), + FilterPanelJson = table.Column(type: "ntext", nullable: true), + SearchPanelJson = table.Column(type: "ntext", nullable: true), + GroupPanelJson = table.Column(type: "ntext", nullable: true), + SelectionJson = table.Column(type: "ntext", nullable: true), + PagerOptionJson = table.Column(type: "ntext", nullable: true), + EditingOptionJson = table.Column(type: "ntext", nullable: true), + EditingFormJson = table.Column(type: "ntext", nullable: true), + PermissionJson = table.Column(type: "ntext", nullable: true), + InsertFieldsDefaultValueJson = table.Column(type: "ntext", nullable: true), + UpdateFieldsDefaultValueJson = table.Column(type: "ntext", nullable: true), + DeleteFieldsDefaultValueJson = table.Column(type: "ntext", nullable: true), + CommandColumnJson = table.Column(type: "ntext", nullable: true), + StateStoringJson = table.Column(type: "ntext", nullable: true), + DeleteCommand = table.Column(type: "ntext", nullable: true), DeleteBeforeCommand = table.Column(type: "nvarchar(max)", nullable: true), DeleteAfterCommand = table.Column(type: "nvarchar(max)", nullable: true), - UpdateCommand = table.Column(type: "text", nullable: true), + UpdateCommand = table.Column(type: "ntext", nullable: true), UpdateBeforeCommand = table.Column(type: "nvarchar(max)", nullable: true), UpdateAfterCommand = table.Column(type: "nvarchar(max)", nullable: true), - InsertCommand = table.Column(type: "text", nullable: true), + InsertCommand = table.Column(type: "ntext", nullable: true), InsertBeforeCommand = table.Column(type: "nvarchar(max)", nullable: true), InsertAfterCommand = table.Column(type: "nvarchar(max)", nullable: true), UpdateServiceAddress = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), InsertServiceAddress = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), DeleteServiceAddress = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), - CustomJsSourcesJson = table.Column(type: "text", nullable: true), - CustomStyleSourcesJson = table.Column(type: "text", nullable: true), - FormFieldsDefaultValueJson = table.Column(type: "text", nullable: true), + CustomJsSourcesJson = table.Column(type: "ntext", nullable: true), + CustomStyleSourcesJson = table.Column(type: "ntext", nullable: true), + FormFieldsDefaultValueJson = table.Column(type: "ntext", nullable: true), IsTenant = table.Column(type: "bit", nullable: false), IsBranch = table.Column(type: "bit", nullable: false), IsOrganizationUnit = table.Column(type: "bit", nullable: false), @@ -1489,35 +1489,35 @@ namespace Sozsoft.Platform.Migrations IsSubForm = table.Column(type: "bit", nullable: false), SubFormsListFormType = table.Column(type: "nvarchar(max)", nullable: true), ShowNote = table.Column(type: "bit", nullable: false), - SubFormsJson = table.Column(type: "text", nullable: true), - WidgetsJson = table.Column(type: "text", nullable: true), - WorkflowJson = table.Column(type: "text", nullable: true), - ExtraFilterJson = table.Column(type: "text", nullable: true), - LayoutJson = table.Column(type: "text", nullable: true), + SubFormsJson = table.Column(type: "ntext", nullable: true), + WidgetsJson = table.Column(type: "ntext", nullable: true), + WorkflowJson = table.Column(type: "ntext", nullable: true), + ExtraFilterJson = table.Column(type: "ntext", nullable: true), + LayoutJson = table.Column(type: "ntext", nullable: true), UserId = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), RoleId = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), - CommonJson = table.Column(type: "text", nullable: true), - DataSourceJson = table.Column(type: "text", nullable: true), - AdaptiveLayoutJson = table.Column(type: "text", nullable: true), - AnimationJson = table.Column(type: "text", nullable: true), - AnnotationsJson = table.Column(type: "text", nullable: true), - ArgumentAxisJson = table.Column(type: "text", nullable: true), - CommonAnnotationsSettingsJson = table.Column(type: "text", nullable: true), - CommonAxisSettingsJson = table.Column(type: "text", nullable: true), - CommonPaneSettingsJson = table.Column(type: "text", nullable: true), - CommonSeriesSettingsJson = table.Column(type: "text", nullable: true), - CrosshairJson = table.Column(type: "text", nullable: true), - ExportJson = table.Column(type: "text", nullable: true), - LegendJson = table.Column(type: "text", nullable: true), - MarginJson = table.Column(type: "text", nullable: true), - PanesJson = table.Column(type: "text", nullable: true), - ScrollBarJson = table.Column(type: "text", nullable: true), - SeriesJson = table.Column(type: "text", nullable: true), - SizeJson = table.Column(type: "text", nullable: true), - TitleJson = table.Column(type: "text", nullable: true), - TooltipJson = table.Column(type: "text", nullable: true), - ValueAxisJson = table.Column(type: "text", nullable: true), - ZoomAndPanJson = table.Column(type: "text", nullable: true) + CommonJson = table.Column(type: "ntext", nullable: true), + DataSourceJson = table.Column(type: "ntext", nullable: true), + AdaptiveLayoutJson = table.Column(type: "ntext", nullable: true), + AnimationJson = table.Column(type: "ntext", nullable: true), + AnnotationsJson = table.Column(type: "ntext", nullable: true), + ArgumentAxisJson = table.Column(type: "ntext", nullable: true), + CommonAnnotationsSettingsJson = table.Column(type: "ntext", nullable: true), + CommonAxisSettingsJson = table.Column(type: "ntext", nullable: true), + CommonPaneSettingsJson = table.Column(type: "ntext", nullable: true), + CommonSeriesSettingsJson = table.Column(type: "ntext", nullable: true), + CrosshairJson = table.Column(type: "ntext", nullable: true), + ExportJson = table.Column(type: "ntext", nullable: true), + LegendJson = table.Column(type: "ntext", nullable: true), + MarginJson = table.Column(type: "ntext", nullable: true), + PanesJson = table.Column(type: "ntext", nullable: true), + ScrollBarJson = table.Column(type: "ntext", nullable: true), + SeriesJson = table.Column(type: "ntext", nullable: true), + SizeJson = table.Column(type: "ntext", nullable: true), + TitleJson = table.Column(type: "ntext", nullable: true), + TooltipJson = table.Column(type: "ntext", nullable: true), + ValueAxisJson = table.Column(type: "ntext", nullable: true), + ZoomAndPanJson = table.Column(type: "ntext", nullable: true) }, constraints: table => { @@ -2250,7 +2250,7 @@ namespace Sozsoft.Platform.Migrations ParticipantsCount = table.Column(type: "int", nullable: false), Likes = table.Column(type: "int", nullable: false), isPublished = table.Column(type: "bit", nullable: false, defaultValue: false), - Photos = table.Column(type: "text", nullable: true), + Photos = table.Column(type: "ntext", nullable: true), CreationTime = table.Column(type: "datetime2", nullable: false), CreatorId = table.Column(type: "uniqueidentifier", nullable: true), LastModificationTime = table.Column(type: "datetime2", nullable: true), @@ -2286,9 +2286,9 @@ namespace Sozsoft.Platform.Migrations SenderId = table.Column(type: "uniqueidentifier", nullable: false), SenderUserName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), SenderName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), - RecipientIdsJson = table.Column(type: "text", nullable: false), + RecipientIdsJson = table.Column(type: "ntext", nullable: false), Text = table.Column(type: "nvarchar(max)", maxLength: 4096, nullable: true), - AttachmentsJson = table.Column(type: "text", nullable: false), + AttachmentsJson = table.Column(type: "ntext", nullable: false), SentAt = table.Column(type: "datetime2", nullable: false), CreationTime = table.Column(type: "datetime2", nullable: false), CreatorId = table.Column(type: "uniqueidentifier", nullable: true), @@ -2789,7 +2789,7 @@ namespace Sozsoft.Platform.Migrations UserId = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), RoleId = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), FilterName = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), - CustomizationData = table.Column(type: "text", nullable: true), + CustomizationData = table.Column(type: "ntext", nullable: true), CustomizationType = table.Column(type: "int", nullable: false), CreationTime = table.Column(type: "datetime2", nullable: false), CreatorId = table.Column(type: "uniqueidentifier", nullable: true), @@ -2833,28 +2833,28 @@ namespace Sozsoft.Platform.Migrations AllowEditing = table.Column(type: "bit", nullable: true, defaultValue: true), AllowAdding = table.Column(type: "bit", nullable: true, defaultValue: true), BandName = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), - ColumnFilterJson = table.Column(type: "text", nullable: true), - ColumnHeaderJson = table.Column(type: "text", nullable: true), - GroupingJson = table.Column(type: "text", nullable: true), - ColumnCustomizationJson = table.Column(type: "text", nullable: true), - TotalSummaryJson = table.Column(type: "text", nullable: true), - GroupSummaryJson = table.Column(type: "text", nullable: true), + ColumnFilterJson = table.Column(type: "ntext", nullable: true), + ColumnHeaderJson = table.Column(type: "ntext", nullable: true), + GroupingJson = table.Column(type: "ntext", nullable: true), + ColumnCustomizationJson = table.Column(type: "ntext", nullable: true), + TotalSummaryJson = table.Column(type: "ntext", nullable: true), + GroupSummaryJson = table.Column(type: "ntext", nullable: true), ColumnCssClass = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), ColumnCssValue = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), - JoinTableJson = table.Column(type: "text", nullable: true), - LookupJson = table.Column(type: "text", nullable: true), - ValidationRuleJson = table.Column(type: "text", nullable: true), - ColumnStylingJson = table.Column(type: "text", nullable: true), - PermissionJson = table.Column(type: "text", nullable: true), - PivotSettingsJson = table.Column(type: "text", nullable: true), + JoinTableJson = table.Column(type: "ntext", nullable: true), + LookupJson = table.Column(type: "ntext", nullable: true), + ValidationRuleJson = table.Column(type: "ntext", nullable: true), + ColumnStylingJson = table.Column(type: "ntext", nullable: true), + PermissionJson = table.Column(type: "ntext", nullable: true), + PivotSettingsJson = table.Column(type: "ntext", nullable: true), Alignment = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: true, defaultValue: "left"), Format = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), EditOrderNo = table.Column(type: "int", nullable: true), EditGroupOrderNo = table.Column(type: "int", nullable: true), EditorType2 = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), ColSpan = table.Column(type: "int", nullable: true), - EditorScript = table.Column(type: "text", nullable: true), - EditorOptions = table.Column(type: "text", nullable: true) + EditorScript = table.Column(type: "ntext", nullable: true), + EditorOptions = table.Column(type: "ntext", nullable: true) }, constraints: table => { @@ -2914,7 +2914,7 @@ namespace Sozsoft.Platform.Migrations NextOnReject = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), PositionX = table.Column(type: "int", nullable: false), PositionY = table.Column(type: "int", nullable: false), - CompareOutcomesJson = table.Column(type: "text", nullable: true) + CompareOutcomesJson = table.Column(type: "ntext", nullable: true) }, constraints: table => { @@ -3392,7 +3392,7 @@ namespace Sozsoft.Platform.Migrations ValidRows = table.Column(type: "int", nullable: false), ErrorRows = table.Column(type: "int", nullable: false), Progress = table.Column(type: "float", nullable: false), - ErrorsJson = table.Column(type: "text", nullable: true), + ErrorsJson = table.Column(type: "ntext", nullable: true), CreationTime = table.Column(type: "datetime2", nullable: false), CreatorId = table.Column(type: "uniqueidentifier", nullable: true), LastModificationTime = table.Column(type: "datetime2", nullable: true), diff --git a/api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs b/api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs index e6394ef8..6cd5499e 100644 --- a/api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs +++ b/api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs @@ -649,7 +649,7 @@ namespace Sozsoft.Platform.Migrations .HasColumnName("DeletionTime"); b.Property("DescriptionsJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("IsDeleted") .ValueGeneratedOnAdd() @@ -666,10 +666,10 @@ namespace Sozsoft.Platform.Migrations .HasColumnName("LastModifierId"); b.Property("SectionsJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("StatsJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.HasKey("Id"); @@ -703,7 +703,7 @@ namespace Sozsoft.Platform.Migrations .HasColumnName("DeletionTime"); b.Property("Description") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("EndDate") .HasColumnType("datetime2"); @@ -723,7 +723,7 @@ namespace Sozsoft.Platform.Migrations .HasColumnName("LastModifierId"); b.Property("RecurrenceException") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("RecurrenceRule") .HasMaxLength(512) @@ -761,7 +761,7 @@ namespace Sozsoft.Platform.Migrations .HasColumnType("nvarchar(256)"); b.Property("Description") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("IsActive") .HasColumnType("bit"); @@ -772,7 +772,7 @@ namespace Sozsoft.Platform.Migrations .HasColumnType("nvarchar(128)"); b.Property("Tenants") - .HasColumnType("text"); + .HasColumnType("ntext"); b.HasKey("Id"); @@ -826,7 +826,7 @@ namespace Sozsoft.Platform.Migrations .HasColumnType("datetime2"); b.Property("ImageUrl") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("IsDeleted") .ValueGeneratedOnAdd() @@ -1056,7 +1056,7 @@ namespace Sozsoft.Platform.Migrations .HasColumnType("nvarchar(128)"); b.Property("Options") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("WorkerType") .HasColumnType("int"); @@ -1450,7 +1450,7 @@ namespace Sozsoft.Platform.Migrations .HasColumnType("nvarchar(512)"); b.Property("BankJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("CreationTime") .HasColumnType("datetime2") @@ -1491,7 +1491,7 @@ namespace Sozsoft.Platform.Migrations .HasColumnType("nvarchar(256)"); b.Property("MapJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("PhoneNumber") .HasMaxLength(20) @@ -1501,7 +1501,7 @@ namespace Sozsoft.Platform.Migrations .HasColumnType("bigint"); b.Property("WorkHoursJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.HasKey("Id"); @@ -1895,8 +1895,7 @@ namespace Sozsoft.Platform.Migrations .HasColumnType("nvarchar(128)"); b.Property("Props") - .HasMaxLength(1024) - .HasColumnType("nvarchar(1024)"); + .HasColumnType("nvarchar(max)"); b.Property("RoutePath") .IsRequired() @@ -1975,10 +1974,10 @@ namespace Sozsoft.Platform.Migrations .HasColumnType("nvarchar(128)"); b.Property("ParametersJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("PermissionsJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("Sql") .IsRequired() @@ -2100,7 +2099,7 @@ namespace Sozsoft.Platform.Migrations b.Property("JsonData") .IsRequired() - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("JsonLength") .ValueGeneratedOnAdd() @@ -2320,7 +2319,7 @@ namespace Sozsoft.Platform.Migrations .HasColumnName("DeletionTime"); b.Property("Description") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("DueDate") .HasColumnType("datetime2"); @@ -2455,7 +2454,7 @@ namespace Sozsoft.Platform.Migrations b.Property("Code") .IsRequired() - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("CodeHash") .HasMaxLength(64) @@ -2506,7 +2505,7 @@ namespace Sozsoft.Platform.Migrations .HasColumnName("IsDeleted"); b.Property("LastCompilationError") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("LastModificationTime") .HasColumnType("datetime2") @@ -2603,7 +2602,7 @@ namespace Sozsoft.Platform.Migrations .HasColumnType("int"); b.Property("Photos") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("Place") .HasMaxLength(256) @@ -2934,7 +2933,7 @@ namespace Sozsoft.Platform.Migrations .HasColumnName("DeletionTime"); b.Property("FeaturesJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("FeaturesSubtitleKey") .HasMaxLength(256) @@ -2971,10 +2970,10 @@ namespace Sozsoft.Platform.Migrations .HasColumnName("LastModifierId"); b.Property("SlidesJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("SolutionsJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("SolutionsSubtitleKey") .HasMaxLength(256) @@ -3177,40 +3176,40 @@ namespace Sozsoft.Platform.Migrations .HasColumnType("uniqueidentifier"); b.Property("AdaptiveLayoutJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("AnimationJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("AnnotationsJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("ArgumentAxisJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("ColumnOptionJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("CommandColumnJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("CommonAnnotationsSettingsJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("CommonAxisSettingsJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("CommonJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("CommonPaneSettingsJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("CommonSeriesSettingsJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("CrosshairJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("CultureName") .IsRequired() @@ -3218,17 +3217,17 @@ namespace Sozsoft.Platform.Migrations .HasColumnType("nvarchar(10)"); b.Property("CustomJsSourcesJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("CustomStyleSourcesJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("DataSourceCode") .HasMaxLength(128) .HasColumnType("nvarchar(128)"); b.Property("DataSourceJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("DefaultFilter") .IsUnicode(true) @@ -3241,10 +3240,10 @@ namespace Sozsoft.Platform.Migrations .HasColumnType("nvarchar(max)"); b.Property("DeleteCommand") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("DeleteFieldsDefaultValueJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("DeleteServiceAddress") .HasMaxLength(256) @@ -3255,25 +3254,25 @@ namespace Sozsoft.Platform.Migrations .HasColumnType("nvarchar(512)"); b.Property("EditingFormJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("EditingOptionJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("ExportJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("ExtraFilterJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("FilterPanelJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("FilterRowJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("FormFieldsDefaultValueJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("FullHeight") .HasColumnType("bit"); @@ -3282,10 +3281,10 @@ namespace Sozsoft.Platform.Migrations .HasColumnType("nvarchar(max)"); b.Property("GroupPanelJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("HeaderFilterJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("Height") .HasColumnType("int"); @@ -3297,10 +3296,10 @@ namespace Sozsoft.Platform.Migrations .HasColumnType("nvarchar(max)"); b.Property("InsertCommand") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("InsertFieldsDefaultValueJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("InsertServiceAddress") .HasMaxLength(256) @@ -3326,10 +3325,10 @@ namespace Sozsoft.Platform.Migrations .HasColumnType("nvarchar(64)"); b.Property("LayoutJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("LegendJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("ListFormCode") .IsRequired() @@ -3341,7 +3340,7 @@ namespace Sozsoft.Platform.Migrations .HasColumnType("nvarchar(20)"); b.Property("MarginJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("Name") .HasMaxLength(128) @@ -3353,16 +3352,16 @@ namespace Sozsoft.Platform.Migrations .HasDefaultValue(50); b.Property("PagerOptionJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("PanesJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("PermissionJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("PivotOptionJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("RoleId") .HasMaxLength(256) @@ -3375,41 +3374,41 @@ namespace Sozsoft.Platform.Migrations .HasColumnType("nvarchar(max)"); b.Property("ScrollBarJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("SearchPanelJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("SelectCommand") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("SelectCommandType") .HasColumnType("int"); b.Property("SelectFieldsDefaultValueJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("SelectionJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("SeriesJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("ShowNote") .HasColumnType("bit"); b.Property("SizeJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("SortMode") .HasMaxLength(20) .HasColumnType("nvarchar(20)"); b.Property("StateStoringJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("SubFormsJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("SubFormsListFormType") .HasColumnType("nvarchar(max)"); @@ -3423,13 +3422,13 @@ namespace Sozsoft.Platform.Migrations .HasColumnType("nvarchar(256)"); b.Property("TitleJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("TodoOptionJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("TooltipJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("TreeOptionJson") .HasColumnType("nvarchar(max)"); @@ -3441,10 +3440,10 @@ namespace Sozsoft.Platform.Migrations .HasColumnType("nvarchar(max)"); b.Property("UpdateCommand") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("UpdateFieldsDefaultValueJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("UpdateServiceAddress") .HasMaxLength(256) @@ -3455,19 +3454,19 @@ namespace Sozsoft.Platform.Migrations .HasColumnType("nvarchar(256)"); b.Property("ValueAxisJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("WidgetsJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("Width") .HasColumnType("int"); b.Property("WorkflowJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("ZoomAndPanJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.HasKey("Id"); @@ -3491,7 +3490,7 @@ namespace Sozsoft.Platform.Migrations .HasColumnName("CreatorId"); b.Property("CustomizationData") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("CustomizationType") .HasColumnType("int"); @@ -3588,16 +3587,16 @@ namespace Sozsoft.Platform.Migrations .HasColumnType("nvarchar(256)"); b.Property("ColumnCustomizationJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("ColumnFilterJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("ColumnHeaderJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("ColumnStylingJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("CultureName") .IsRequired() @@ -3611,10 +3610,10 @@ namespace Sozsoft.Platform.Migrations .HasColumnType("int"); b.Property("EditorOptions") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("EditorScript") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("EditorType2") .HasMaxLength(64) @@ -3630,10 +3629,10 @@ namespace Sozsoft.Platform.Migrations .HasColumnType("nvarchar(128)"); b.Property("GroupSummaryJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("GroupingJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("IsActive") .ValueGeneratedOnAdd() @@ -3641,7 +3640,7 @@ namespace Sozsoft.Platform.Migrations .HasDefaultValue(true); b.Property("JoinTableJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("ListFormCode") .IsRequired() @@ -3654,13 +3653,13 @@ namespace Sozsoft.Platform.Migrations .HasDefaultValue(30); b.Property("LookupJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("PermissionJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("PivotSettingsJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("PlaceHolder") .HasMaxLength(256) @@ -3681,14 +3680,14 @@ namespace Sozsoft.Platform.Migrations .HasColumnType("int"); b.Property("TotalSummaryJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("UserId") .HasMaxLength(256) .HasColumnType("nvarchar(256)"); b.Property("ValidationRuleJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("Visible") .ValueGeneratedOnAdd() @@ -3798,7 +3797,7 @@ namespace Sozsoft.Platform.Migrations .HasColumnType("int"); b.Property("ErrorsJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("ExecRows") .HasColumnType("int"); @@ -3860,7 +3859,7 @@ namespace Sozsoft.Platform.Migrations .HasColumnType("nvarchar(20)"); b.Property("CompareOutcomesJson") - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("CompareValue") .HasPrecision(18, 2) @@ -4092,7 +4091,7 @@ namespace Sozsoft.Platform.Migrations b.Property("ParticipantIdsJson") .IsRequired() - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("ParticipantKey") .IsRequired() @@ -4119,7 +4118,7 @@ namespace Sozsoft.Platform.Migrations b.Property("AttachmentsJson") .IsRequired() - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("ConversationId") .HasColumnType("uniqueidentifier"); @@ -4156,7 +4155,7 @@ namespace Sozsoft.Platform.Migrations b.Property("RecipientIdsJson") .IsRequired() - .HasColumnType("text"); + .HasColumnType("ntext"); b.Property("SenderId") .HasColumnType("uniqueidentifier"); diff --git a/ui/.gitignore b/ui/.gitignore index a33db1d1..da118544 100644 --- a/ui/.gitignore +++ b/ui/.gitignore @@ -25,4 +25,5 @@ build *.sln *.sw? .vite-cache/ -src/devextreme-license.ts \ No newline at end of file +src/devextreme-license.ts +src/components/visualDesigner/generated/componentProps.json diff --git a/ui/package-lock.json b/ui/package-lock.json index a7d99a51..17872926 100644 --- a/ui/package-lock.json +++ b/ui/package-lock.json @@ -72,9 +72,7 @@ "@typescript-eslint/parser": "^8.62.1", "@vitejs/plugin-react": "^4.2.1", "autoprefixer": "^10.4.14", - "baseline-browser-mapping": "^2.9.19", "browserslist": "^4.25.2", - "caniuse-lite": "^1.0.30001734", "cssnano": "^6.0.1", "eslint": "^9.39.0", "eslint-config-prettier": "^10.1.8", @@ -5135,9 +5133,9 @@ "license": "MIT" }, "node_modules/baseline-browser-mapping": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.0.tgz", - "integrity": "sha512-lIyg0szRfYbiy67j9KN8IyeD7q7hcmqnJ1ddWmNt19ItGpNN64mnllmxUNFIOdOm6by97jlL6wfpTTJrmnjWAA==", + "version": "2.11.12", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.11.12.tgz", + "integrity": "sha512-r7WnVImvVCeFpf2DOXfy41aPWzeNg3H/A2X4dKmy1QL0MSyyk/e7z8ihJ3N6Nn2PsdhkVlqnEfnUE4a05P2aTA==", "dev": true, "license": "Apache-2.0", "bin": { @@ -5315,9 +5313,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001774", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001774.tgz", - "integrity": "sha512-DDdwPGz99nmIEv216hKSgLD+D4ikHQHjBC/seF98N9CPqRX4M5mSxT9eTV6oyisnJcuzxtZy4n17yKKQYmYQOA==", + "version": "1.0.30001806", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001806.tgz", + "integrity": "sha512-72Cuvd95zbSYPKq6Fhg8eDJRlzgWDf7/mtoZv6Qe/DYNCEBdNxoA3+rZAU2ZhGCpZlns3EssFavaZomckT5Uuw==", "dev": true, "funding": [ { diff --git a/ui/package.json b/ui/package.json index 8adf4fd7..cb3b2e53 100644 --- a/ui/package.json +++ b/ui/package.json @@ -5,9 +5,10 @@ "elstarVersion": "2.1.6", "type": "module", "scripts": { - "start": "vite", - "build": "node scripts/generate-version.js && vite build", - "build:production": "vite build", + "generate:component-metadata": "node scripts/generate-component-metadata.mjs", + "start": "node scripts/generate-component-metadata.mjs && vite", + "build": "node scripts/generate-component-metadata.mjs && node scripts/generate-version.js && vite build", + "build:production": "node scripts/generate-component-metadata.mjs && vite build", "preview": "vite preview", "lint": "eslint .", "lint:fix": "npm run lint -- --fix", @@ -80,9 +81,7 @@ "@typescript-eslint/parser": "^8.62.1", "@vitejs/plugin-react": "^4.2.1", "autoprefixer": "^10.4.14", - "baseline-browser-mapping": "^2.9.19", "browserslist": "^4.25.2", - "caniuse-lite": "^1.0.30001734", "cssnano": "^6.0.1", "eslint": "^9.39.0", "eslint-config-prettier": "^10.1.8", diff --git a/ui/scripts/generate-component-metadata.mjs b/ui/scripts/generate-component-metadata.mjs new file mode 100644 index 00000000..3710d301 --- /dev/null +++ b/ui/scripts/generate-component-metadata.mjs @@ -0,0 +1,182 @@ +/* global console, process */ +import fs from 'node:fs' +import path from 'node:path' +import prettier from 'prettier' +import ts from 'typescript' +import { fileURLToPath } from 'node:url' + +const scriptDirectory = path.dirname(fileURLToPath(import.meta.url)) +const uiRoot = path.resolve(scriptDirectory, '..') +const sourceRoot = path.join(uiRoot, 'src', 'components', 'ui') +const outputFile = path.join(sourceRoot, '..', 'visualDesigner', 'generated', 'componentProps.json') + +const componentTypeOverrides = { + Calendar: 'CalenderProps', + ScrollBar: 'ScrollbarProps', +} + +const namespaceOptions = { + 'TypeAttributes.Size': ['lg', 'md', 'sm', 'xs'], + 'TypeAttributes.ControlSize': ['lg', 'md', 'sm', 'xs'], + 'TypeAttributes.Shape': ['round', 'circle', 'none'], + 'TypeAttributes.Status': ['success', 'warning', 'danger', 'info'], + 'TypeAttributes.FormLayout': ['horizontal', 'vertical', 'inline'], + 'TypeAttributes.MenuVariant': ['light', 'dark', 'themed', 'transparent'], + 'TypeAttributes.Direction': ['ltr', 'rtl'], +} + +const walkFiles = (directory) => + fs.readdirSync(directory, { withFileTypes: true }).flatMap((entry) => { + const target = path.join(directory, entry.name) + if (entry.isDirectory()) return walkFiles(target) + return /\.(ts|tsx)$/.test(entry.name) ? [target] : [] + }) + +const sourceFiles = walkFiles(sourceRoot) +const metadataInputs = [...sourceFiles, fileURLToPath(import.meta.url)] +const outputIsCurrent = + !process.argv.includes('--force') && + fs.existsSync(outputFile) && + fs.statSync(outputFile).mtimeMs >= + Math.max(...metadataInputs.map((fileName) => fs.statSync(fileName).mtimeMs)) + +if (outputIsCurrent) { + console.log('Designer component metadata is up to date.') + process.exit(0) +} + +const program = ts.createProgram(sourceFiles, { + target: ts.ScriptTarget.Latest, + jsx: ts.JsxEmit.ReactJSX, +}) + +const interfaces = new Map() +const defaultsByFile = new Map() + +const literalValue = (node, sourceFile) => { + if (!node) return undefined + if (ts.isStringLiteral(node) || ts.isNoSubstitutionTemplateLiteral(node)) return node.text + if (ts.isNumericLiteral(node)) return Number(node.text) + if (node.kind === ts.SyntaxKind.TrueKeyword) return true + if (node.kind === ts.SyntaxKind.FalseKeyword) return false + if (node.kind === ts.SyntaxKind.NullKeyword) return null + if (ts.isArrayLiteralExpression(node)) { + const values = node.elements.map((element) => literalValue(element, sourceFile)) + return values.some((value) => value === undefined) ? undefined : values + } + if (ts.isObjectLiteralExpression(node)) { + const result = {} + for (const property of node.properties) { + if (!ts.isPropertyAssignment(property)) return undefined + const name = property.name.getText(sourceFile).replace(/^['"]|['"]$/g, '') + const value = literalValue(property.initializer, sourceFile) + if (value === undefined) return undefined + result[name] = value + } + return result + } + return undefined +} + +for (const sourceFile of program.getSourceFiles()) { + if (!path.resolve(sourceFile.fileName).startsWith(path.resolve(sourceRoot))) continue + const fileDefaults = {} + + const visit = (node) => { + if (ts.isInterfaceDeclaration(node) && node.name.text.endsWith('Props')) { + interfaces.set(node.name.text, { node, sourceFile }) + } + if (ts.isVariableDeclaration(node) && ts.isObjectBindingPattern(node.name)) { + for (const element of node.name.elements) { + if (!ts.isIdentifier(element.name) || !element.initializer) continue + const value = literalValue(element.initializer, sourceFile) + if (value !== undefined) fileDefaults[element.name.text] = value + } + } + ts.forEachChild(node, visit) + } + visit(sourceFile) + defaultsByFile.set(sourceFile.fileName, fileDefaults) +} + +const indexSource = program.getSourceFile(path.join(sourceRoot, 'index.ts')) +if (!indexSource) throw new Error('UI component index could not be found.') + +const componentNames = [] +for (const statement of indexSource.statements) { + if (!ts.isExportDeclaration(statement) || statement.isTypeOnly || !statement.exportClause) + continue + if (!ts.isNamedExports(statement.exportClause)) continue + for (const element of statement.exportClause.elements) componentNames.push(element.name.text) +} + +const unionOptions = (typeNode, sourceFile) => { + if (!typeNode) return [] + const typeText = typeNode.getText(sourceFile) + if (namespaceOptions[typeText]) return namespaceOptions[typeText] + if (!ts.isUnionTypeNode(typeNode)) return [] + return typeNode.types + .filter((type) => ts.isLiteralTypeNode(type) && ts.isStringLiteral(type.literal)) + .map((type) => type.literal.text) +} + +const propertyType = (typeNode, sourceFile) => { + const text = typeNode?.getText(sourceFile) || 'unknown' + const options = unionOptions(typeNode, sourceFile) + if (options.length) return { type: 'select', options } + if (text.includes('=>') || text.startsWith('MouseEventHandler')) return { type: 'function' } + if (/\bboolean\b/.test(text)) return { type: 'boolean' } + if (/\bnumber\b/.test(text)) return { type: 'number' } + if (/\[\]|Array<|ReadonlyArray + clause.types.some((type) => type.expression.getText(sourceFile) === 'CommonProps'), + ) + const properties = [] + + for (const member of node.members) { + if (!ts.isPropertySignature(member) || !member.name) continue + const name = member.name.getText(sourceFile).replace(/^['"]|['"]$/g, '') + const typeInfo = propertyType(member.type, sourceFile) + properties.push({ + name, + tsType: member.type?.getText(sourceFile) || 'unknown', + ...typeInfo, + required: !member.questionToken, + ...(defaults[name] !== undefined ? { defaultValue: defaults[name] } : {}), + }) + } + + if (extendsCommonProps) { + for (const property of commonProperties) { + if (!properties.some((item) => item.name === property.name)) properties.push(property) + } + } + + metadata[componentName] = { + interfaceName, + sourceFile: path.relative(uiRoot, sourceFile.fileName).replaceAll('\\', '/'), + properties, + } +} + +fs.mkdirSync(path.dirname(outputFile), { recursive: true }) +const formattedMetadata = await prettier.format(JSON.stringify(metadata), { parser: 'json' }) +fs.writeFileSync(outputFile, formattedMetadata) +console.log(`Generated designer metadata for ${Object.keys(metadata).length} UI components.`) diff --git a/ui/src/assets/styles/components/_select.css b/ui/src/assets/styles/components/_select.css index 94e3e3de..dd21821f 100644 --- a/ui/src/assets/styles/components/_select.css +++ b/ui/src/assets/styles/components/_select.css @@ -25,6 +25,41 @@ } } + &.select-md { + @apply text-sm; + + .select-dropdown-indicator, + .select-clear-indicator { + @apply p-2 text-lg; + } + } + + &.select-sm { + @apply text-sm; + + .select-dropdown-indicator, + .select-clear-indicator { + @apply px-1.5 py-1 text-sm; + } + + .select__multi-value { + @apply rounded text-sm; + } + } + + &.select-xs { + @apply text-xs; + + .select-dropdown-indicator, + .select-clear-indicator { + @apply px-1 py-0.5 text-xs; + } + + .select__multi-value { + @apply rounded text-xs; + } + } + .select__single-value { color: inherit; } diff --git a/ui/src/components/codeLayout/ComponentCodeEditor.tsx b/ui/src/components/codeLayout/ComponentCodeEditor.tsx deleted file mode 100644 index 84e545de..00000000 --- a/ui/src/components/codeLayout/ComponentCodeEditor.tsx +++ /dev/null @@ -1,783 +0,0 @@ -import React, { useState, useEffect, useRef } from 'react' -import Editor from '@monaco-editor/react' -import { ComponentDefinition } from '../../proxy/developerKit/componentInfo' -import { generateSingleComponentJSX, generateUniqueId } from '@/utils/codeParser' -import { FaCheck, FaCode, FaMousePointer, FaSave, FaCog, FaTimes } from 'react-icons/fa' -import { Button, toast } from '../ui' -import Notification from '../ui/Notification/Notification' - -interface ComponentCodeEditorProps { - code: string - onChange: (code: string) => void - onApplyCodeChanges: (code: string) => void - onResetCodeChanges: () => void - language?: string - theme?: 'vs-dark' | 'light' - onCursorChange?: (componentId: string | null) => void - onComponentAdded?: (componentDef: ComponentDefinition) => void - onComponentSave: () => void -} - -export const ComponentCodeEditor: React.FC = ({ - code, - onChange, - onApplyCodeChanges, - onResetCodeChanges, - language = 'typescript', - theme = 'vs-dark', - onCursorChange, - onComponentAdded, - onComponentSave, -}) => { - const [localCode, setLocalCode] = useState(code) - const [hasChanges, setHasChanges] = useState(false) - const [isFormatting, setIsFormatting] = useState(false) - const [showSettings, setShowSettings] = useState(false) - const [editorTheme, setEditorTheme] = useState(theme) - const [fontSize, setFontSize] = useState(14) - const [wordWrap, setWordWrap] = useState<'on' | 'off'>('on') - const [minimap, setMinimap] = useState(true) - const [showSuccessMessage, setShowSuccessMessage] = useState(false) - const [isDragOver, setIsDragOver] = useState(false) - const [dropIndicator, setDropIndicator] = useState<{ - show: boolean - line: number - column: number - }>({ show: false, line: 0, column: 0 }) - - const editorRef = useRef(null) - const containerRef = useRef(null) - // Refs to keep latest values accessible inside native DOM listeners - const localCodeRef = useRef(localCode) - const dropCallbacksRef = useRef({ onChange, onComponentAdded, onApplyCodeChanges }) - - useEffect(() => { - setLocalCode(code) - setHasChanges(false) - }, [code]) - - useEffect(() => { - localCodeRef.current = localCode - }, [localCode]) - - useEffect(() => { - dropCallbacksRef.current = { onChange, onComponentAdded, onApplyCodeChanges } - }, [onChange, onComponentAdded, onApplyCodeChanges]) - - const findComponentIdAtPosition = ( - code: string, - position: { lineNumber: number; column: number }, - ): string | null => { - const lines = code.split('\n') - const currentLineIndex = position.lineNumber - 1 - - // Önce bulunduğu satırı kontrol et - const line = lines[currentLineIndex] || '' - const idMatch = line.match(/id=["']([\w-]+)["']/) - if (idMatch) return idMatch[1] - - // Eğer bulunduğu satırda yoksa, yakındaki satırları kontrol et - // Önce yukarı doğru ara, sonra aşağı doğru ara - for (let distance = 1; distance <= 3; distance++) { - // Yukarı ara - if (currentLineIndex - distance >= 0) { - const upLine = lines[currentLineIndex - distance] || '' - // Component tag başlangıcını kontrol et - const componentMatch = upLine.match(/<([A-Z][a-zA-Z]*)/) - if (componentMatch) { - // Bu component tag'inin ID'sini ara (aynı satırda veya sonraki satırlarda) - for ( - let j = currentLineIndex - distance; - j <= Math.min(lines.length - 1, currentLineIndex + 2); - j++ - ) { - const searchLine = lines[j] || '' - const foundId = searchLine.match(/id=["']([\w-]+)["']/) - if (foundId) return foundId[1] - } - } - } - - // Aşağı ara - if (currentLineIndex + distance < lines.length) { - const downLine = lines[currentLineIndex + distance] || '' - const componentMatch = downLine.match(/<([A-Z][a-zA-Z]*)/) - if (componentMatch) { - // Bu component tag'inin ID'sini ara - for ( - let j = currentLineIndex + distance; - j <= Math.min(lines.length - 1, currentLineIndex + distance + 2); - j++ - ) { - const searchLine = lines[j] || '' - const foundId = searchLine.match(/id=["']([\w-]+)["']/) - if (foundId) return foundId[1] - } - } - } - } - - // Hiçbir şey bulunamadıysa, cursor'ın bulunduğu satırda herhangi bir JSX tag var mı kontrol et - const jsxMatch = line.match(/<\/?([A-Z][a-zA-Z]*)/) - if (jsxMatch) { - // Bu tag'e ait ID'yi bulabilir miyiz? - const componentName = jsxMatch[1] - for ( - let i = Math.max(0, currentLineIndex - 5); - i <= Math.min(lines.length - 1, currentLineIndex + 5); - i++ - ) { - const searchLine = lines[i] || '' - if (searchLine.includes(`<${componentName}`) && searchLine.includes('id=')) { - const foundId = searchLine.match(/id=["']([\w-]+)["']/) - if (foundId) return foundId[1] - } - } - } - - return null - } - - /** - * Returns true if the given 1-based lineNumber is inside a `return (...)` block. - * Uses parenthesis depth counting to track entry and exit of the return expression. - */ - const isPositionInsideJSXReturn = (codeStr: string, lineNumber: number): boolean => { - const lines = codeStr.split('\n') - let insideReturn = false - let parenDepth = 0 - - for (let i = 0; i < lineNumber && i < lines.length; i++) { - const line = lines[i] - if (!insideReturn) { - if (/\breturn\s*\(/.test(line)) { - insideReturn = true - parenDepth = 0 - const returnIdx = line.search(/\breturn/) - const fromReturn = line.slice(returnIdx) - for (const ch of fromReturn) { - if (ch === '(') parenDepth++ - else if (ch === ')') { - parenDepth-- - if (parenDepth <= 0) { - insideReturn = false - break - } - } - } - } - } else { - for (const ch of line) { - if (ch === '(') parenDepth++ - else if (ch === ')') { - parenDepth-- - if (parenDepth <= 0) { - insideReturn = false - break - } - } - } - } - } - return insideReturn - } - - const handleEditorCursorChange = () => { - if (!editorRef.current) return - const position = editorRef.current.getPosition() - if (!position) return - - const id = findComponentIdAtPosition(localCode, position) - if (onCursorChange) onCursorChange(id) - } - - const handleEditorDidMount = (editor: any, monaco: any) => { - editorRef.current = editor - - monaco.languages.typescript.typescriptDefaults.setCompilerOptions({ - target: monaco.languages.typescript.ScriptTarget.Latest, - allowNonTsExtensions: true, - moduleResolution: monaco.languages.typescript.ModuleResolutionKind.NodeJs, - module: monaco.languages.typescript.ModuleKind.CommonJS, - noEmit: true, - esModuleInterop: true, - jsx: monaco.languages.typescript.JsxEmit.React, - reactNamespace: 'React', - allowJs: true, - typeRoots: ['node_modules/@types'], - }) - - editor.addCommand(monaco.KeyMod.CtrlCmd | monaco.KeyCode.KeyS, () => { - handleApplyChanges() - }) - - editor.addCommand(monaco.KeyMod.CtrlCmd | monaco.KeyMod.Shift | monaco.KeyCode.KeyF, () => { - handleFormatCode() - }) - - editor.onDidChangeCursorPosition(handleEditorCursorChange) - - // Intercept Monaco's native drop so it never inserts raw JSON text. - // We handle the drop ourselves: insert JSX when inside return(), skip otherwise. - const domNode = editor.getDomNode() - if (domNode) { - domNode.addEventListener( - 'drop', - (nativeEvent: DragEvent) => { - nativeEvent.preventDefault() - nativeEvent.stopPropagation() - nativeEvent.stopImmediatePropagation() - - if (!nativeEvent.dataTransfer) return - - // Read component definition from drag data - let componentDefData: string | undefined - for (const fmt of ['application/json', 'text/plain']) { - const d = nativeEvent.dataTransfer.getData(fmt) - if (d) { - componentDefData = d - break - } - } - if (!componentDefData) return - - let componentDef: any - try { - componentDef = JSON.parse(componentDefData) - } catch { - return - } - if (!componentDef?.name) return - - // Resolve the drop position inside Monaco - const dropPos = editor.getTargetAtClientPoint(nativeEvent.clientX, nativeEvent.clientY) - const position = dropPos?.position ?? editor.getPosition() - if (!position) return - - // Only allow drop inside JSX return(...) block - if (!isPositionInsideJSXReturn(localCodeRef.current, position.lineNumber)) { - toast.push( - - Bileşen yalnızca return(...) bloğu içine eklenebilir. - , - { placement: 'bottom-end' }, - ) - return - } - - const componentId = generateUniqueId() - const adaptedProps = { - ...(componentDef.properties || []).reduce( - (acc: any, prop: any) => { - acc[prop.name] = { - type: prop.type, - value: prop.value, - ...(prop.options ? { options: prop.options } : {}), - } - return acc - }, - {} as Record, - ), - id: { type: 'string', value: componentId }, - } - - const componentJSX = generateSingleComponentJSX(componentDef.name, adaptedProps) - const componentDefWithId = { - ...componentDef, - id: componentId, - properties: [ - ...(componentDef.properties || []).filter((p: any) => p.name !== 'id'), - { name: 'id', type: 'string', value: componentId, category: 'properties' }, - ], - } - - const lines = localCodeRef.current.split('\n') - const indent = (lines[position.lineNumber - 1] || '').match(/^(\s*)/)?.[1] ?? ' ' - const formattedJSX = `${indent}${componentJSX}` - const newLines = [...lines] - newLines.splice(position.lineNumber, 0, formattedJSX) - const newCode = newLines.join('\n') - - setLocalCode(newCode) - const { - onChange: onChg, - onComponentAdded: onAdded, - onApplyCodeChanges: onApply, - } = dropCallbacksRef.current - onChg(newCode) - if (onAdded) onAdded(componentDefWithId) - setTimeout(() => onApply(newCode), 100) - - setIsDragOver(false) - setDropIndicator({ show: false, line: 0, column: 0 }) - }, - true, // capture phase — fires before Monaco's own listeners - ) - } - } - - const handleCodeChange = (value: string | undefined) => { - if (value !== undefined) { - setLocalCode(value) - setHasChanges(value !== code) - onChange(value) - } - } - - const handleApplyChanges = () => { - onApplyCodeChanges(localCode) - setHasChanges(false) - setShowSuccessMessage(true) - handleFormatCode() - setTimeout(() => setShowSuccessMessage(false), 3000) - } - - const handleFormatCode = async () => { - if (editorRef.current) { - setIsFormatting(true) - try { - await editorRef.current.getAction('editor.action.formatDocument').run() - } catch (error) { - console.error('Kod formatlama hatası:', error) - } finally { - setIsFormatting(false) - } - } - } - - const handleResetChanges = () => { - setLocalCode(code) - setHasChanges(false) - onResetCodeChanges() - } - - // Drag & Drop handlers for Code Editor - const handleDragOver = (e: React.DragEvent) => { - e.preventDefault() - e.stopPropagation() - - if (!editorRef.current || !containerRef.current) return - - try { - const hasComponentData = e.dataTransfer.types.some( - (type) => type === 'application/json' || type === 'text/plain' || type === 'text', - ) - - if (hasComponentData) { - e.dataTransfer.dropEffect = 'copy' - setIsDragOver(true) - - // Get cursor position from mouse coordinates - const rect = containerRef.current.getBoundingClientRect() - const x = e.clientX - rect.left - const y = e.clientY - rect.top - - // Convert to editor position - const position = editorRef.current.getTargetAtClientPoint(x, y) - if (position) { - setDropIndicator({ - show: true, - line: position.position.lineNumber, - column: position.position.column, - }) - } - } - } catch (err) { - console.warn('Error handling drag over:', err) - } - } - - const handleDragLeave = (e: React.DragEvent) => { - e.preventDefault() - e.stopPropagation() - - if (!containerRef.current) return - - const rect = containerRef.current.getBoundingClientRect() - const x = e.clientX - const y = e.clientY - - if (x <= rect.left || x >= rect.right || y <= rect.top || y >= rect.bottom) { - setIsDragOver(false) - setDropIndicator({ show: false, line: 0, column: 0 }) - } - } - - const handleDrop = (e: React.DragEvent) => { - e.preventDefault() - e.stopPropagation() - - setIsDragOver(false) - setDropIndicator({ show: false, line: 0, column: 0 }) - - if (!editorRef.current || !containerRef.current) return - - try { - let componentDefData - const formats = ['application/json', 'text/plain', 'text'] - - // Sürüklenen bileşenin verisini al - for (const format of formats) { - const data = e.dataTransfer.getData(format) - - if (data) { - componentDefData = data - break - } - } - - if (!componentDefData) return - - let componentDef - try { - componentDef = JSON.parse(componentDefData) - } catch (error) { - console.error('Component verisi çözümlenemedi:', error) - return - } - - // 1. Component ID'sini oluştur - const componentId = generateUniqueId() - - // 2. Props'ları adapt et ve ID'yi dahil et - const adaptedProps = { - ...(componentDef.properties || []).reduce( - (acc: any, prop: any) => { - acc[prop.name] = { - type: prop.type, - value: prop.value, - ...(prop.options ? { options: prop.options } : {}), - } - return acc - }, - {} as Record, - ), - id: { - type: 'string', - value: componentId, - }, - } - - // 3. JSX oluştur - const componentJSX = generateSingleComponentJSX(componentDef.name, adaptedProps) - - // 4. Component tanımını ID ile genişlet - const componentDefWithId = { - ...componentDef, - id: componentId, - properties: [ - ...(componentDef.properties || []).filter((p: any) => p.name !== 'id'), - { - name: 'id', - type: 'string', - value: componentId, - category: 'properties', - }, - ], - } - - // 5. Pozisyonu al - let position = editorRef.current.getPosition() - if (!position) { - console.error('Geçersiz pozisyon tespit edildi. Yedek pozisyon kullanılıyor.') - position = { lineNumber: 0, column: 0 } - } - - // 6. JSX kodunu pozisyonda ekle - const newCode = insertJSXAtPosition(localCode, componentJSX, position) - setLocalCode(newCode) - onChange(newCode) - - // 7. Parent'a bildirim gönder - if (onComponentAdded) { - onComponentAdded(componentDefWithId) - } - - // 8. Uygulamayı tetikle - setTimeout(() => { - onApplyCodeChanges(newCode) - }, 100) - } catch (error) { - console.error('Bileşen bırakılırken hata oluştu:', error) - } - } - - const insertJSXAtPosition = ( - code: string, - jsx: string, - position: { lineNumber: number; column: number }, - ): string => { - const updatedCode = code - const lines = updatedCode.split('\n') - - // Pozisyonu doğrula (import eklendiyse satır numaraları değişmiş olabilir) - if (position.lineNumber < 1 || position.lineNumber > lines.length) { - console.error('Geçersiz satır numarası:', position.lineNumber) - position.lineNumber = lines.length // Geçersiz satırda son satıra ekle - } - - const line = lines[position.lineNumber - 1] // 1 tabanlı indeks, 0 tabanlıya çevrilir - - if (!line) { - console.error('Satır bulunamadı:', position.lineNumber) - return updatedCode // Eğer satır yoksa, kodu değiştirmeden döndür - } - - // Satırın indentasyonunu belirle - const indentMatch = line.match(/^(\s*)/) - const indent = indentMatch ? indentMatch[1] : ' ' // Default 6 boşluk - - // Component'i yeni satıra ekle (mevcut satırın altına) - const formattedJSX = `${indent}${jsx}` - lines.splice(position.lineNumber, 0, formattedJSX) - - return lines.join('\n') // Tüm satırları birleştir ve yeni kodu döndür - } - - const handleDragEnter = (e: React.DragEvent) => { - e.preventDefault() - e.stopPropagation() - } - - return ( -
- {/* Drop Indicator */} - {dropIndicator.show && ( -
-
- Bileşeni Line {dropIndicator.line}, Column {dropIndicator.column} konumuna bırak -
-
- )} - - {/* Header */} -
-
- - - - - - - -
-
- -
-
- - {/* Settings Panel */} - {showSettings && ( -
-
-
- - -
- -
- - setFontSize(parseInt(e.target.value))} - /> -
- -
- - -
- -
- - -
-
-
- )} - - {/* Editor */} -
- -
- - {/* Status Bar */} -
-
- TypeScript React - UTF-8 - LF -
-
- Satır 1, Sütun 1 - Boşluklar: 2 - {hasChanges && ● Kaydedilmemiş değişiklikler} - {showSuccessMessage && ( - - - - )} - {isDragOver && ( - - - Bileşeni bırakmaya hazır - - )} -
-
-
- ) -} diff --git a/ui/src/components/codeLayout/ComponentLibrary.tsx b/ui/src/components/codeLayout/ComponentLibrary.tsx deleted file mode 100644 index 4cf5d898..00000000 --- a/ui/src/components/codeLayout/ComponentLibrary.tsx +++ /dev/null @@ -1,190 +0,0 @@ -import React, { useMemo, useState } from "react"; -import { FaSearch, FaSquare } from 'react-icons/fa'; -import { ComponentDefinition, HookInfo, PropertyInfo } from "../../proxy/developerKit/componentInfo"; -import { getAllComponentDefinitions } from "./data/componentDefinitions"; -import navigationIcon from "@/proxy/menus/navigation-icon.config"; - -interface ComponentLibraryProps { - onDragStart: (componentDef: ComponentDefinition, e: React.DragEvent) => void; -} - -export const ComponentLibrary: React.FC = ({ - onDragStart, -}) => { - const [searchTerm, setSearchTerm] = useState(""); - - const handleDragStart = ( - componentDef: ComponentDefinition, - e: React.DragEvent - ) => { - e.stopPropagation(); - try { - const data = JSON.stringify(componentDef); - e.dataTransfer.setData("text/plain", data); - e.dataTransfer.setData("application/json", data); - } catch (error) { - console.error("Error setting drag data:", error); - } - - e.dataTransfer.effectAllowed = "copy"; - - if (e.dataTransfer.setDragImage) { - try { - const dragPreview = document.createElement("div"); - dragPreview.className = "component-drag-preview"; - dragPreview.innerHTML = `
- ${componentDef.icon || "📦"} - ${componentDef.name} -
`; - Object.assign(dragPreview.style, { - position: "absolute", - top: "-1000px", - left: "0", - padding: "8px 12px", - backgroundColor: "white", - border: "2px solid #4f46e5", - borderRadius: "4px", - boxShadow: "0 2px 5px rgba(0,0,0,0.2)", - zIndex: "9999", - pointerEvents: "none", - }); - document.body.appendChild(dragPreview); - e.dataTransfer.setDragImage(dragPreview, 20, 20); - setTimeout(() => document.body.removeChild(dragPreview), 0); - } catch (error) { - console.error("Error setting drag image:", error); - } - } - - onDragStart(componentDef, e); - }; - - const filteredComponents = useMemo( - () => - getAllComponentDefinitions().filter( - (comp) => - comp.name.toLowerCase().includes(searchTerm.toLowerCase()) || - comp.description.toLowerCase().includes(searchTerm.toLowerCase()) - ), - [searchTerm] - ); - - const categories = [ - "basic", - "form", - "layout", - "feedback", - "media", - "interactive", - "navigation", - "data", - ] - .map((cat: any) => ({ - id: cat, - name: cat, - components: filteredComponents?.filter((c) => c.category === cat), - })) - .filter((cat) => cat.components.length > 0); - - const getIcon = (iconName: string): React.ComponentType => { - return navigationIcon[iconName] || FaSquare; - }; - - return ( -
- {/* Arama kutusu */} -
-
- - setSearchTerm(e.target.value)} - className="w-full pl-10 pr-4 py-2 bg-gray-800 border border-gray-600 rounded-lg text-sm text-white placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-blue-500" - /> -
-
- - {/* Bileşen kategorileri */} -
-
- {categories.map((category) => ( -
-

- {category.name} -

-
- {category.components.map((componentDef) => { - const IconComponent = getIcon(componentDef.icon); - return ( -
handleDragStart(componentDef, e)} - onDragEnd={(e) => { - e.preventDefault(); - e.stopPropagation(); - }} - > -
- -
-
- - {componentDef.name} - -

- {componentDef.description} -

- - {/* Özellikler */} - {componentDef.properties?.length > 0 && ( -
- {componentDef.properties.slice(0, 2).map((prop: PropertyInfo) => ( - - {prop.name} - - ))} - {componentDef.properties.length > 2 && ( - - ... - - )} -
- )} - - {/* Hooklar */} - {componentDef.hooks?.length > 0 && ( -
- {componentDef.hooks.slice(0, 2).map((hook: HookInfo) => ( - - {hook.name} - - ))} - {componentDef.hooks.length > 2 && ( - - ... - - )} -
- )} -
-
- ); - })} -
-
- ))} -
-
-
- ); -}; diff --git a/ui/src/components/codeLayout/ComponentSelector.tsx b/ui/src/components/codeLayout/ComponentSelector.tsx deleted file mode 100644 index 434c876c..00000000 --- a/ui/src/components/codeLayout/ComponentSelector.tsx +++ /dev/null @@ -1,50 +0,0 @@ -import React from 'react'; -import { ComponentInfo } from '../../proxy/developerKit/componentInfo'; -import { Button } from '../ui'; - -interface ComponentSelectorProps { - components: ComponentInfo[]; - selectedComponentId: string | null; - onSelectComponent: (componentId: string | null) => void; - onRefresh: () => void; -} - -const ComponentSelector: React.FC = ({ - components, - selectedComponentId, - onSelectComponent, - onRefresh -}) => { - return ( -
-
- - -
- -
- ); -}; - -export default ComponentSelector; \ No newline at end of file diff --git a/ui/src/components/codeLayout/PanelManager.tsx b/ui/src/components/codeLayout/PanelManager.tsx deleted file mode 100644 index 6fb125ae..00000000 --- a/ui/src/components/codeLayout/PanelManager.tsx +++ /dev/null @@ -1,79 +0,0 @@ -import React from "react"; -import { - FaCog, - FaTimes, - FaBars, - FaEye, - FaEyeSlash -} from 'react-icons/fa'; -import { Button } from "../ui"; -import { PanelState } from "./data/componentDefinitions"; - -interface PanelManagerProps { - isOpen: boolean; - onClose: () => void; - panelState: PanelState; - onPanelToggle: (panel: keyof PanelState) => void; -} - -export const PanelManager: React.FC = ({ - isOpen, - onClose, - panelState, - onPanelToggle, -}) => { - - if (!isOpen) return null; - - const paneller = [ - { key: "toolbox" as keyof PanelState, label: "Toolbox", icon: FaBars }, - { key: "properties" as keyof PanelState, label: "Properties", icon: FaCog }, - ]; - - return ( -
-
-
-
- -

Panel Manager

-
-
-
-

Customize Workspace

-
-

Panels

- {paneller.map(({ key, label, icon: Icon }) => ( -
-
- - {label} -
-
- ))} -
-
-
-
- ); -}; diff --git a/ui/src/components/codeLayout/PropertyPanel.tsx b/ui/src/components/codeLayout/PropertyPanel.tsx deleted file mode 100644 index e19c4e6b..00000000 --- a/ui/src/components/codeLayout/PropertyPanel.tsx +++ /dev/null @@ -1,619 +0,0 @@ -import React, { useState, useEffect } from "react"; -import TailwindModal from "./TailwindModal"; -import { ComponentInfo, HookInfo, PropertyInfo } from "../../proxy/developerKit/componentInfo"; -import { getComponentDefinition } from "./data/componentDefinitions"; -import { Button } from "../ui"; -import { FaCheck, FaCode, FaTimes, FaTrash } from "react-icons/fa"; - -interface PropertyPanelProps { - selectedComponent: ComponentInfo | null; - currentCode: string; - onPropertiesChange: ( - componentId: string, - updates: Record - ) => void; - onHookToggle: ( - componentId: string, - hookType: string, - enabled: boolean - ) => void; - onMultipleHookToggle: ( - toggles: { componentId: string; hookType: string; enabled: boolean }[] - ) => void; - onDeleteComponent: (componentId: string) => void; -} - -const PropertyPanel: React.FC = ({ - selectedComponent, - currentCode, - onPropertiesChange, - onHookToggle, - onMultipleHookToggle, - onDeleteComponent, -}) => { - const [tailwindModalOpen, setTailwindModalOpen] = useState(false); - const [currentTailwindProperty, setCurrentTailwindProperty] = - useState(""); - const [activeHooks, setActiveHooks] = useState>(new Set()); - const [activeTab, setActiveTab] = useState<"props" | "hooks">("props"); - - // Local state for pending changes - const [pendingProperties, setPendingProperties] = useState< - Record - >({}); - const [pendingEvents, setPendingEvents] = useState>( - {} - ); - const [pendingHooks, setPendingHooks] = useState>({}); - const [hasChanges, setHasChanges] = useState(false); - const [hasHookChanges, setHasHookChanges] = useState(false); - - const componentDefinition = selectedComponent - ? getComponentDefinition(selectedComponent.name) - : null; - - // Reset pending changes when component changes - useEffect(() => { - setPendingProperties({}); - setPendingEvents({}); - setPendingHooks({}); - setHasChanges(false); - setHasHookChanges(false); - }, [selectedComponent?.id]); - - // Check which hooks are currently active in the code - useEffect(() => { - if (selectedComponent && currentCode) { - const hooks = new Set(); - - // Check for useState - if ( - currentCode.includes( - `const [state_${selectedComponent.id}, setState_${selectedComponent.id}]` - ) - ) { - hooks.add("useState"); - } - - // Check for useRef - if ( - currentCode.includes(`const ref_${selectedComponent.id}`) && - currentCode.includes(`ref={ref_${selectedComponent.id}`) - ) { - hooks.add("useRef"); - } - - // // Check for useEffect - // if ( - // currentCode.includes("useEffect") && - // currentCode.includes(selectedComponent.id) - // ) { - // hooks.add("useEffect"); - // } - - setActiveHooks(hooks); - } - }, [selectedComponent, currentCode]); - - // Handle local property changes - const handleLocalPropertyChange = (propName: string, value: any) => { - setPendingProperties((prev) => ({ - ...prev, - [propName]: value, - })); - setHasChanges(true); - }; - - // Handle local hook changes - const handleLocalHookToggle = (hookType: string, enabled: boolean) => { - setPendingHooks((prev) => ({ - ...prev, - [hookType]: enabled, - })); - setHasHookChanges(true); - }; - - // Apply only property/event changes - const handleApplyPropChanges = () => { - if (!selectedComponent) return; - - // Combine all changes into a single update object - const allUpdates = { - ...pendingProperties, - ...pendingEvents, - }; - - // Apply property and event changes together - if (Object.keys(allUpdates).length > 0) { - onPropertiesChange(selectedComponent.id, allUpdates); - } - - // Reset pending changes - setPendingProperties({}); - setPendingEvents({}); - setHasChanges(false); - }; - - // Apply only hook changes - const handleApplyHookChanges = () => { - if (!selectedComponent) return; - - const hookToggles = Object.entries(pendingHooks).map( - ([hookType, enabled]) => ({ - componentId: selectedComponent.id, - hookType, - enabled, - }) - ); - if (hookToggles.length > 1) { - onMultipleHookToggle(hookToggles); - } else if (hookToggles.length === 1) { - const { componentId, hookType, enabled } = hookToggles[0]; - onHookToggle(componentId, hookType, enabled); - } - - // Reset pending changes - setPendingHooks({}); - setHasHookChanges(false); - }; - - // Reset all pending changes - const handleResetChanges = () => { - setPendingProperties({}); - setPendingEvents({}); - setPendingHooks({}); - setHasChanges(false); - setHasHookChanges(false); - }; - - const openTailwindModal = (propertyName: string) => { - setCurrentTailwindProperty(propertyName); - setTailwindModalOpen(true); - }; - - const handleTailwindClassSelect = (className: string) => { - const currentValue = - pendingProperties[currentTailwindProperty] || - selectedComponent?.props[currentTailwindProperty] || - ""; - const newValue = currentValue ? `${currentValue} ${className}` : className; - handleLocalPropertyChange(currentTailwindProperty, newValue); - // Don't close modal - let user continue selecting - }; - - const renderPropertyControl = (property: PropertyInfo) => { - // Handle children property specially - get from children, not props - const currentValue = - property.name === "children" - ? typeof selectedComponent?.children === "string" - ? selectedComponent.children - : selectedComponent?.props[property.name] || property.value - : selectedComponent?.props[property.name] || property.value; - - // Use pending value if available, otherwise use current value - const value = - pendingProperties[property.name] !== undefined - ? pendingProperties[property.name] - : currentValue; - const isTailwindProperty = ["className", "class", "css"].includes( - property.name - ); - const isColorProperty = property.name.toLowerCase().includes("color"); - - // Don't show children property if component has nested elements - if ( - property.name === "children" && - Array.isArray(selectedComponent?.children) - ) { - return null; - } - - let arrayError = ""; - let arrayInputValue = ""; - if (property.type === "array") { - try { - arrayInputValue = JSON.stringify(value, null, 2); - } catch { - arrayInputValue = ""; - arrayError = "Array verisi gösterilemiyor."; - } - } - return ( -
- - -
- {property.type === "boolean" && ( - - )} - - {property.type === "select" && property.options && ( - - )} - - {property.type === "function" && ( - <> - - handleLocalPropertyChange(property.name, e.target.value) - } - className="flex-1 px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 dark:bg-gray-800 dark:text-white dark:placeholder-gray-400" - placeholder={`Enter ${property.name}`} - /> - {isTailwindProperty && ( - - )} - {isColorProperty && ( - - handleLocalPropertyChange(property.name, e.target.value) - } - className="w-10 h-10 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-800" - /> - )} - - )} - - {property.type === "string" && ( - <> - - handleLocalPropertyChange(property.name, e.target.value) - } - className="flex-1 px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 dark:bg-gray-800 dark:text-white dark:placeholder-gray-400" - placeholder={`Enter ${property.name}`} - /> - {isTailwindProperty && ( - - )} - {isColorProperty && ( - - handleLocalPropertyChange(property.name, e.target.value) - } - className="w-10 h-10 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-800" - /> - )} - - )} - - {property.type === "number" && ( - - handleLocalPropertyChange(property.name, Number(e.target.value)) - } - className="flex-1 px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 dark:bg-gray-800 dark:text-white dark:placeholder-gray-400" - /> - )} - - {property.type === "array" && ( - <> -