@itwin/core-backend 5.6.0-dev.7 → 5.7.0-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -1
- package/lib/cjs/IModelDb.d.ts +32 -3
- package/lib/cjs/IModelDb.d.ts.map +1 -1
- package/lib/cjs/IModelDb.js +42 -4
- package/lib/cjs/IModelDb.js.map +1 -1
- package/lib/cjs/SQLiteDb.d.ts.map +1 -1
- package/lib/cjs/SQLiteDb.js +0 -1
- package/lib/cjs/SQLiteDb.js.map +1 -1
- package/lib/cjs/SqliteChangesetReader.d.ts +5 -0
- package/lib/cjs/SqliteChangesetReader.d.ts.map +1 -1
- package/lib/cjs/SqliteChangesetReader.js +7 -0
- package/lib/cjs/SqliteChangesetReader.js.map +1 -1
- package/lib/cjs/annotations/TextAnnotationElement.d.ts +1 -1
- package/lib/cjs/annotations/TextAnnotationElement.d.ts.map +1 -1
- package/lib/cjs/annotations/TextAnnotationElement.js +14 -1
- package/lib/cjs/annotations/TextAnnotationElement.js.map +1 -1
- package/lib/cjs/annotations/TextAnnotationGeometry.d.ts +14 -0
- package/lib/cjs/annotations/TextAnnotationGeometry.d.ts.map +1 -1
- package/lib/cjs/annotations/TextAnnotationGeometry.js +29 -10
- package/lib/cjs/annotations/TextAnnotationGeometry.js.map +1 -1
- package/lib/cjs/annotations/TextBlockLayout.js +6 -6
- package/lib/cjs/annotations/TextBlockLayout.js.map +1 -1
- package/lib/cjs/rpc-impl/RpcBriefcaseUtility.d.ts.map +1 -1
- package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js.map +1 -1
- package/lib/esm/IModelDb.d.ts +32 -3
- package/lib/esm/IModelDb.d.ts.map +1 -1
- package/lib/esm/IModelDb.js +42 -4
- package/lib/esm/IModelDb.js.map +1 -1
- package/lib/esm/SQLiteDb.d.ts.map +1 -1
- package/lib/esm/SQLiteDb.js +0 -1
- package/lib/esm/SQLiteDb.js.map +1 -1
- package/lib/esm/SqliteChangesetReader.d.ts +5 -0
- package/lib/esm/SqliteChangesetReader.d.ts.map +1 -1
- package/lib/esm/SqliteChangesetReader.js +7 -0
- package/lib/esm/SqliteChangesetReader.js.map +1 -1
- package/lib/esm/annotations/TextAnnotationElement.d.ts +1 -1
- package/lib/esm/annotations/TextAnnotationElement.d.ts.map +1 -1
- package/lib/esm/annotations/TextAnnotationElement.js +14 -1
- package/lib/esm/annotations/TextAnnotationElement.js.map +1 -1
- package/lib/esm/annotations/TextAnnotationGeometry.d.ts +14 -0
- package/lib/esm/annotations/TextAnnotationGeometry.d.ts.map +1 -1
- package/lib/esm/annotations/TextAnnotationGeometry.js +29 -10
- package/lib/esm/annotations/TextAnnotationGeometry.js.map +1 -1
- package/lib/esm/annotations/TextBlockLayout.js +6 -6
- package/lib/esm/annotations/TextBlockLayout.js.map +1 -1
- package/lib/esm/rpc-impl/RpcBriefcaseUtility.d.ts.map +1 -1
- package/lib/esm/rpc-impl/RpcBriefcaseUtility.js.map +1 -1
- package/lib/esm/test/annotations/LeaderGeometry.test.js +2 -3
- package/lib/esm/test/annotations/LeaderGeometry.test.js.map +1 -1
- package/lib/esm/test/annotations/TextAnnotation.test.js +39 -4
- package/lib/esm/test/annotations/TextAnnotation.test.js.map +1 -1
- package/lib/esm/test/annotations/TextBlock.test.js +49 -42
- package/lib/esm/test/annotations/TextBlock.test.js.map +1 -1
- package/lib/esm/test/hubaccess/Rebase.test.js +345 -10
- package/lib/esm/test/hubaccess/Rebase.test.js.map +1 -1
- package/lib/esm/test/imodel/SchemaXmlImport.test.js +87 -44
- package/lib/esm/test/imodel/SchemaXmlImport.test.js.map +1 -1
- package/lib/esm/test/schema/SchemaImportCallbacks.test.js +4 -4
- package/lib/esm/test/schema/SchemaImportCallbacks.test.js.map +1 -1
- package/package.json +15 -15
|
@@ -811,9 +811,9 @@ describe("AnnotationTextStyle", () => {
|
|
|
811
811
|
}
|
|
812
812
|
expect(migratedStyle.settings.leader.terminatorShape).to.not.be.undefined;
|
|
813
813
|
});
|
|
814
|
-
it("should return same data when version is 1.0.
|
|
814
|
+
it("should return same data when version is 1.0.2", () => {
|
|
815
815
|
const styleData = {
|
|
816
|
-
version: "1.0.
|
|
816
|
+
version: "1.0.2",
|
|
817
817
|
data: TextStyleSettings.defaultProps
|
|
818
818
|
};
|
|
819
819
|
const migratedStyle = makeStyle({
|
|
@@ -829,10 +829,35 @@ describe("AnnotationTextStyle", () => {
|
|
|
829
829
|
expect(parsedJson.data).to.deep.equal(styleData.data);
|
|
830
830
|
}
|
|
831
831
|
});
|
|
832
|
+
it("should migrate text style settings to 1.0.2", () => {
|
|
833
|
+
const oldStyleData = {
|
|
834
|
+
...TextStyleSettings.defaultProps,
|
|
835
|
+
textHeight: 0.5,
|
|
836
|
+
margins: {
|
|
837
|
+
left: 0.25,
|
|
838
|
+
right: 0.25,
|
|
839
|
+
top: 0.25,
|
|
840
|
+
bottom: 0.25
|
|
841
|
+
}
|
|
842
|
+
};
|
|
843
|
+
const migratedStyle = makeStyle({
|
|
844
|
+
settings: JSON.stringify({
|
|
845
|
+
version: "1.0.1",
|
|
846
|
+
data: oldStyleData
|
|
847
|
+
}),
|
|
848
|
+
});
|
|
849
|
+
const jsonStyleData = migratedStyle.toJSON();
|
|
850
|
+
if (jsonStyleData.settings) {
|
|
851
|
+
const jsonVersion = JSON.parse(jsonStyleData.settings).version;
|
|
852
|
+
expect(jsonVersion).to.equal(TEXT_STYLE_SETTINGS_JSON_VERSION);
|
|
853
|
+
}
|
|
854
|
+
// Margins should be converted back to margin factors i.e 0.25/0.5=0.5
|
|
855
|
+
expect(migratedStyle.settings.margins).to.deep.equal({ left: 0.5, right: 0.5, top: 0.5, bottom: 0.5 });
|
|
856
|
+
});
|
|
832
857
|
it("should return defaultProps when styleData is unrecognized", () => {
|
|
833
858
|
const textStyle = makeStyle({
|
|
834
859
|
settings: JSON.stringify({
|
|
835
|
-
version: "1.0.
|
|
860
|
+
version: "1.0.2",
|
|
836
861
|
data: { invalid: "data" }
|
|
837
862
|
}),
|
|
838
863
|
});
|
|
@@ -891,6 +916,7 @@ describe("appendTextAnnotationGeometry", () => {
|
|
|
891
916
|
let seedCategoryId;
|
|
892
917
|
let seedStyleId;
|
|
893
918
|
let seedStyleId2;
|
|
919
|
+
let annotationRenderPriority;
|
|
894
920
|
before(async () => {
|
|
895
921
|
imodel = await createIModel("DefaultTextStyle");
|
|
896
922
|
const jobSubjectId = createJobSubjectElement(imodel, "Job").insert();
|
|
@@ -908,8 +934,9 @@ describe("appendTextAnnotationGeometry", () => {
|
|
|
908
934
|
seedCategoryId = category;
|
|
909
935
|
seedStyleId = styleId;
|
|
910
936
|
seedStyleId2 = differentStyleId;
|
|
937
|
+
annotationRenderPriority = { annotation: 100, annotationLabels: 110 };
|
|
911
938
|
});
|
|
912
|
-
function runAppendTextAnnotationGeometry(annotation, styleId, scaleFactor = 1) {
|
|
939
|
+
function runAppendTextAnnotationGeometry(annotation, styleId, scaleFactor = 1, renderPriority) {
|
|
913
940
|
const builder = new MockBuilder();
|
|
914
941
|
const resolver = new TextStyleResolver({
|
|
915
942
|
textBlock: annotation.textBlock,
|
|
@@ -928,6 +955,7 @@ describe("appendTextAnnotationGeometry", () => {
|
|
|
928
955
|
scaleFactor,
|
|
929
956
|
builder,
|
|
930
957
|
categoryId: seedCategoryId,
|
|
958
|
+
renderPriority
|
|
931
959
|
});
|
|
932
960
|
expect(result).to.be.true;
|
|
933
961
|
return builder;
|
|
@@ -977,6 +1005,13 @@ describe("appendTextAnnotationGeometry", () => {
|
|
|
977
1005
|
expect(builder1.geometries).to.not.deep.equal(builder2.geometries);
|
|
978
1006
|
expect(builder1.textStrings).to.not.deep.equal(builder2.textStrings);
|
|
979
1007
|
});
|
|
1008
|
+
it("applies render priority correctly", () => {
|
|
1009
|
+
const annotation = createAnnotation();
|
|
1010
|
+
const builder = runAppendTextAnnotationGeometry(annotation, seedStyleId, 1, annotationRenderPriority);
|
|
1011
|
+
expect(builder.params.length).to.equal(2);
|
|
1012
|
+
expect(builder.params[0].elmPriority).to.equal(annotationRenderPriority.annotationLabels);
|
|
1013
|
+
expect(builder.params[1].elmPriority).to.equal(annotationRenderPriority.annotation);
|
|
1014
|
+
});
|
|
980
1015
|
it("accounts for style overrides in the text", () => {
|
|
981
1016
|
const block = TextBlock.create();
|
|
982
1017
|
block.styleOverrides = { margins: { left: 0, right: 1, top: 2, bottom: 3 } };
|