@fluid-experimental/property-properties 0.56.5 → 0.57.0

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.
@@ -1 +1 @@
1
- {"version":3,"file":"stringProperty.d.ts","sourceRoot":"","sources":["../../src/properties/stringProperty.js"],"names":[],"mappings":"AAgDA;;GAEG;AACH;IACI;;;;;;;OAOG;IACH,wBAEC;IA6FD;;;;OAIG;IACH,0BAHW,MAAM,YACN,MAAM,QAMhB;IAgJD;;;OAGG;IACH,mBAHW,MAAM,QAMhB;IA4BD;;;;;;;;OAQG;IACH,oBANW,MAAM,oBACN,OAAO,GAGN,OAAO,CA0BlB;IA4OD,uBAEC;IAND,oBAEC;CAeJ"}
1
+ {"version":3,"file":"stringProperty.d.ts","sourceRoot":"","sources":["../../src/properties/stringProperty.js"],"names":[],"mappings":"AAuDA;;GAEG;AACH;IACI;;;;;;;OAOG;IACH,wBAEC;IA8FD;;;;OAIG;IACH,0BAHW,MAAM,YACN,MAAM,QAMhB;IAgJD;;;OAGG;IACH,mBAHW,MAAM,QAMhB;IA4BD;;;;;;;;OAQG;IACH,oBANW,MAAM,oBACN,OAAO,GAGN,OAAO,CA0BlB;IAqPD,uBAEC;IAND,oBAEC;CAeJ"}
@@ -33,9 +33,16 @@ var NO_DIRTY_AND_PENDING_SET_TO_PROPERTY_VALUE = {
33
33
  flags: MODIFIED_STATE_FLAGS.PENDING_CHANGE
34
34
  };
35
35
  var DIRTY_AND_NO_PENDING_SET_TO_PROPERTY_VALUE = {
36
- pending: 'setAsLiteral',
37
- dirty: undefined,
38
- flags: MODIFIED_STATE_FLAGS.DIRTY
36
+ pending: undefined,
37
+ dirty: 'setAsLiteral',
38
+ _flags: MODIFIED_STATE_FLAGS.DIRTY,
39
+ set flags(flags) {
40
+ this._flags = flags;
41
+ console.log('flags was changed!');
42
+ },
43
+ get flags() {
44
+ return this._flags;
45
+ }
39
46
  };
40
47
  var STRING_PROPERTY_SET_PROPERTY_VALUE_STATE_FLAGS = [
41
48
  undefined,
@@ -108,7 +115,8 @@ class StringProperty extends ValueArrayProperty {
108
115
  }
109
116
  ;
110
117
  _getDirtyChanges() {
111
- if (this._dirty === PENDING_AND_DIRTY_SET_TO_PROPERTY_VALUE) {
118
+ if (this._dirty === PENDING_AND_DIRTY_SET_TO_PROPERTY_VALUE ||
119
+ this._dirty === DIRTY_AND_NO_PENDING_SET_TO_PROPERTY_VALUE) {
112
120
  return this.getValue();
113
121
  }
114
122
  else if (this._dirty === NO_DIRTY_AND_PENDING_SET_TO_PROPERTY_VALUE) {
@@ -368,10 +376,17 @@ class StringProperty extends ValueArrayProperty {
368
376
  * applied. undefined indicates that the changes should be reset
369
377
  */
370
378
  _setChanges(in_pending, in_dirty) {
371
- if ((this._dirty === PENDING_AND_DIRTY_SET_TO_PROPERTY_VALUE ||
372
- this._dirty === NO_DIRTY_AND_PENDING_SET_TO_PROPERTY_VALUE) &&
373
- in_pending === null && in_dirty === undefined) {
374
- this._dirty = NO_DIRTY_AND_PENDING_SET_TO_PROPERTY_VALUE;
379
+ if (this._dirty === PENDING_AND_DIRTY_SET_TO_PROPERTY_VALUE ||
380
+ this._dirty === NO_DIRTY_AND_PENDING_SET_TO_PROPERTY_VALUE ||
381
+ this._dirty === DIRTY_AND_NO_PENDING_SET_TO_PROPERTY_VALUE) {
382
+ let newFlags = this._dirty.flags;
383
+ if (in_pending === undefined) {
384
+ newFlags &= 0xFFFFFFFF ^ BaseProperty.MODIFIED_STATE_FLAGS.PENDING_CHANGE;
385
+ }
386
+ if (in_dirty === undefined) {
387
+ newFlags &= 0xFFFFFFFF ^ BaseProperty.MODIFIED_STATE_FLAGS.DIRTY;
388
+ }
389
+ this._dirty = STRING_PROPERTY_SET_PROPERTY_VALUE_STATE_FLAGS[newFlags];
375
390
  }
376
391
  else {
377
392
  ArrayProperty.prototype._setChanges.call(this, in_pending, in_dirty);
@@ -384,7 +399,8 @@ class StringProperty extends ValueArrayProperty {
384
399
  */
385
400
  _setDirtyFlags(in_flags) {
386
401
  if (this._dirty === PENDING_AND_DIRTY_SET_TO_PROPERTY_VALUE ||
387
- this._dirty === NO_DIRTY_AND_PENDING_SET_TO_PROPERTY_VALUE) {
402
+ this._dirty === NO_DIRTY_AND_PENDING_SET_TO_PROPERTY_VALUE ||
403
+ this._dirty === DIRTY_AND_NO_PENDING_SET_TO_PROPERTY_VALUE) {
388
404
  this._dirty = STRING_PROPERTY_SET_PROPERTY_VALUE_STATE_FLAGS[in_flags];
389
405
  return;
390
406
  }
@@ -397,7 +413,8 @@ class StringProperty extends ValueArrayProperty {
397
413
  */
398
414
  _getDirtyFlags() {
399
415
  if (this._dirty === PENDING_AND_DIRTY_SET_TO_PROPERTY_VALUE ||
400
- this._dirty === NO_DIRTY_AND_PENDING_SET_TO_PROPERTY_VALUE) {
416
+ this._dirty === NO_DIRTY_AND_PENDING_SET_TO_PROPERTY_VALUE ||
417
+ this._dirty === DIRTY_AND_NO_PENDING_SET_TO_PROPERTY_VALUE) {
401
418
  return this._dirty.flags;
402
419
  }
403
420
  return ArrayProperty.prototype._getDirtyFlags.call(this);
@@ -1 +1 @@
1
- {"version":3,"file":"stringProperty.js","sourceRoot":"","sources":["../../src/properties/stringProperty.js"],"names":[],"mappings":";AAAA;;;GAGG;AACH;;GAEG;;;AAEH,MAAM,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AAC5B,MAAM,EAAE,kBAAkB,EAAE,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAC;AAC/D,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AACrD,MAAM,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,qCAAqC,CAAC,CAAC,SAAS,CAAC;AACzE,MAAM,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC,wCAAwC,CAAC,CAAC;AACxE,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,qCAAqC,CAAC,CAAC;AACxE,M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,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IAClC,CAAC;IAED,kBAAkB;IAClB,SAAS,CAAC,WAAW,EAAE,yBAAyB;QAC5C,OAAO,SAAS,CAAC;IACrB,CAAC;IAED,kBAAkB;IAClB,yBAAyB,CAAC,WAAW,EAAE,yBAAyB;QAC5D,OAAO,SAAS,CAAC;IACrB,CAAC;CACJ;AA9jBD,wCA8jBC;AAED,cAAc,CAAC,SAAS,CAAC,OAAO,GAAG,QAAQ,CAAC;AAC5C,cAAc,CAAC,SAAS,CAAC,QAAQ,GAAG,QAAQ,CAAC;AAC7C,cAAc,CAAC,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n/**\n * @fileoverview Definition of the StringProperty class\n */\n\nconst _ = require('lodash');\nconst { ValueArrayProperty } = require('./valueArrayProperty');\nconst { ArrayProperty } = require('./arrayProperty');\nconst { MSG } = require('@fluid-experimental/property-common').constants;\nconst { ChangeSet } = require('@fluid-experimental/property-changeset');\nconst { ConsoleUtils } = require('@fluid-experimental/property-common');\nconst { BaseProperty } = require('./baseProperty');\n\nvar MODIFIED_STATE_FLAGS = BaseProperty.MODIFIED_STATE_FLAGS;\n\n// Some global constant objects that are used to indicate a few special\n// cases for the dirty object. If the string was directly set to a literal,\n// we don't need to store any ChangeSet, we only need to store the information\n// that it was updated to a literal and the dirty flags.\n// By using these special objects we avoid the memory overhead of having a separate\n// object for each array in this state.\nvar PENDING_AND_DIRTY_SET_TO_PROPERTY_VALUE = {\n pending: 'setAsLiteral',\n dirty: 'setAsLiteral',\n flags: MODIFIED_STATE_FLAGS.PENDING_CHANGE | MODIFIED_STATE_FLAGS.DIRTY\n};\nvar NO_DIRTY_AND_PENDING_SET_TO_PROPERTY_VALUE = {\n pending: 'setAsLiteral',\n dirty: undefined,\n flags: MODIFIED_STATE_FLAGS.PENDING_CHANGE\n};\n\nvar DIRTY_AND_NO_PENDING_SET_TO_PROPERTY_VALUE = {\n pending: 'setAsLiteral',\n dirty: undefined,\n flags: MODIFIED_STATE_FLAGS.DIRTY\n};\n\nvar STRING_PROPERTY_SET_PROPERTY_VALUE_STATE_FLAGS = [\n undefined,\n NO_DIRTY_AND_PENDING_SET_TO_PROPERTY_VALUE,\n DIRTY_AND_NO_PENDING_SET_TO_PROPERTY_VALUE,\n PENDING_AND_DIRTY_SET_TO_PROPERTY_VALUE\n];\n\n/**\n * A primitive property for a string value.\n */\nexport class StringProperty extends ValueArrayProperty {\n /**\n * @param {Object=} in_params - the parameters\n * @constructor\n * @protected\n * @extends property-properties.ValueArrayProperty\n * @alias property-properties.StringProperty\n * @category Arrays\n */\n constructor(in_params) {\n super(in_params);\n };\n\n /**\n * Get the string value\n * @return {string} the JavaScript string primitive value of this StringProperty\n */\n getValue() {\n return this._dataArrayRef;\n };\n\n /**\n * Private helper function to update the internal dirty and pending changes\n *\n * @param {property-properties.SerializedChangeSet} in_changeSet - The changeset to apply\n * @private\n */\n _updateChanges(in_changeSet) {\n // we need to convert the format to allow the application of the changes\n // since _performApplyAfterOnPropertyArray only understands insert/modify/remove commands\n var pendingChangesWereSetBefore = false;\n var pendingChanges = this._getPendingChanges();\n\n if (_.isString(pendingChanges)) {\n pendingChanges = { insert: [[0, pendingChanges]] };\n pendingChangesWereSetBefore = true;\n }\n ChangeSet.prototype._performApplyAfterOnPropertyArray(pendingChanges,\n in_changeSet, this.getFullTypeid(true));\n if (pendingChangesWereSetBefore) {\n pendingChanges = pendingChanges.insert[0][1];\n }\n\n var dirtyChangesWereSetBefore = false;\n var dirtyChanges = this._getDirtyChanges();\n\n if (_.isString(dirtyChanges)) {\n dirtyChanges = { insert: [[0, dirtyChanges]] };\n dirtyChangesWereSetBefore = true;\n }\n ChangeSet.prototype._performApplyAfterOnPropertyArray(dirtyChanges,\n in_changeSet, this.getFullTypeid(true));\n if (dirtyChangesWereSetBefore) {\n dirtyChanges = dirtyChanges.insert[0][1];\n }\n\n this._setChanges(pendingChanges, dirtyChanges);\n };\n\n _getPendingChanges() {\n if (this._dirty === PENDING_AND_DIRTY_SET_TO_PROPERTY_VALUE ||\n this._dirty === NO_DIRTY_AND_PENDING_SET_TO_PROPERTY_VALUE) {\n return this.getValue();\n }\n\n return (this._dirty && this._dirty.pending) || {};\n };\n\n _getDirtyChanges() {\n if (this._dirty === PENDING_AND_DIRTY_SET_TO_PROPERTY_VALUE) {\n return this.getValue();\n } else if (this._dirty === NO_DIRTY_AND_PENDING_SET_TO_PROPERTY_VALUE) {\n return {};\n }\n\n return (this._dirty && this._dirty.dirty) || {};\n };\n\n /**\n * inserts a string starting at a position and shifts the rest of\n * the String to the right. Will not overwrite existing values.\n * @param {number} in_position target index\n * @param {string} in_value value to be inserted\n * @throws if in_position is smaller than zero, larger than the length of the string or not a number\n * @throws if in_value is not a string\n */\n insert(in_position, in_value) {\n ConsoleUtils.assert(_.isString(in_value), MSG.IN_VALUE_MUST_BE_STRING + in_value);\n this._insertRange(in_position, in_value);\n };\n\n /**\n * Adds letters to the end of the string\n * @param {string} in_value the string to be pushed\n * @throws if in_value is not a string\n * @return {number} the new length of the string.\n */\n push(in_value) {\n ConsoleUtils.assert(_.isString(in_value), MSG.IN_VALUE_MUST_BE_STRING + in_value);\n this._insertRange(this._dataArrayRef.length, in_value);\n return this.getLength();\n };\n\n\n /**\n * inserts values\n * @param {number} in_position target index\n * @param {string} in_value the string to be inserted\n */\n _insertRange(in_position, in_value) {\n this._checkIsNotReadOnly(true);\n this._insertRangeWithoutDirtying(in_position, in_value);\n this._setDirty();\n };\n\n /**\n * Returns the full property type identifier for the ChangeSet including the enum type id\n * @param {boolean} [in_hideCollection=false] - if true the collection type (if applicable) will be omitted\n * since that is not aplicable here, this param is ignored\n * @return {string} The typeid\n */\n getFullTypeid(in_hideCollection) {\n return this._typeid;\n };\n\n /**\n * returns the String to an empty string.\n */\n clear() {\n this.setValue('');\n };\n\n /**\n * removes a given number of elements from the array property and shifts\n * remaining values to the left.\n * @param {number} in_offset target start index\n * @param {number} in_deleteCount number of elements to be deleted\n * @throws if in_offset is not a number\n * @throws if in_deleteCount is not a number\n * @throws if trying to remove an item with a parent\n * @throws if in_offset is smaller than zero or if in_offset + in_delete count is larger than the length of the array\n * @return {String} the part of the string that was removed.\n */\n removeRange(in_offset, in_deleteCount) {\n ConsoleUtils.assert(_.isNumber(in_offset),\n MSG.NOT_NUMBER + 'in_offset, method: StringProperty.remove or .removeRange');\n ConsoleUtils.assert(_.isNumber(in_deleteCount),\n MSG.NOT_NUMBER + 'in_deleteCount, method: StringProperty.remove or .removeRange');\n ConsoleUtils.assert(in_offset + in_deleteCount < this.length + 1 && in_offset >= 0 && in_deleteCount > 0,\n MSG.REMOVE_OUT_OF_BOUNDS + 'Cannot remove ' + in_deleteCount + ' items starting at index ' + in_offset);\n var result = '';\n for (var i = in_offset; i < in_offset + in_deleteCount; i++) {\n result += this.get(i);\n }\n this._checkIsNotReadOnly(true);\n this._removeRangeWithoutDirtying(in_offset, in_deleteCount);\n this._setDirty();\n return result;\n };\n\n\n /**\n * @inheritdoc\n */\n _deserialize(in_serializedObj, in_reportToView,\n in_filteringOptions, in_createChangeSet) {\n if ((in_serializedObj.remove && in_serializedObj.remove.length > 0) ||\n (in_serializedObj.modify && in_serializedObj.modify.length > 0) ||\n (in_serializedObj.insert &&\n (in_serializedObj.insert.length > 1 ||\n (in_serializedObj.insert.length === 1 &&\n (in_serializedObj.insert[0][0] !== 0 ||\n !_.isString(in_serializedObj.insert[0][1])))))) {\n throw new Error(MSG.NO_NORMALIZED_CHANGESET);\n }\n\n var oldStringLength = this._dataArrayRef.length;\n var newStringData;\n if (_.isString(in_serializedObj)) {\n if (this._setValue(in_serializedObj, in_reportToView)) {\n return in_serializedObj;\n } else {\n return {};\n }\n } else {\n if (!in_serializedObj.insert ||\n !in_serializedObj.insert[0]) {\n // we've got an empty object, so we have to wipe everything we've got\n if (oldStringLength > 0) {\n this.removeRange(0, oldStringLength, in_reportToView);\n return {\n remove: [[0, oldStringLength]]\n };\n } else {\n // the string was already empty, nothing has changed\n return {};\n }\n } else {\n newStringData = in_serializedObj.insert[0][1];\n }\n }\n\n if (newStringData === this._dataArrayRef) {\n // nothing changed\n return {};\n }\n\n // check if something was attached (very common case)\n if (newStringData.length > oldStringLength) {\n if (newStringData.substring(0, oldStringLength) === this._dataArrayRef) {\n var appendChanges = {\n insert: [[oldStringLength, newStringData.substring(oldStringLength)]]\n };\n this.insertRange(oldStringLength, newStringData.substring(oldStringLength), in_reportToView);\n return appendChanges;\n }\n }\n\n // most simplistic diff method: Remove all existing data and insert the new data\n var simpleChanges = {\n insert: [[0, newStringData]]\n };\n if (oldStringLength > 0) {\n simpleChanges.remove = [[0, oldStringLength]];\n this._removeRangeWithoutDirtying(0, oldStringLength, in_reportToView);\n }\n this.insertRange(0, newStringData, in_reportToView);\n return simpleChanges;\n };\n\n /**\n * Serialize the property\n *\n * @param {boolean} in_dirtyOnly -\n * Only include dirty entries in the serialization\n * @param {boolean} in_includeRootTypeid -\n * Include the typeid of the root of the hierarchy - has no effect for ArrayProperty\n * @param {property-properties.BaseProperty.MODIFIED_STATE_FLAGS} [in_dirtinessType] -\n * The type of dirtiness to use when reporting dirty changes. By default this is\n * PENDING_CHANGE\n * @param {boolean} [in_includeReferencedRepositories=false] - If this is set to true, the serialize\n * function will descend into referenced repositories. WARNING: if there are loops in the references\n * this can result in an infinite loop\n *\n * @return {Object} The serialized representation of this property\n * @private\n */\n _serialize(in_dirtyOnly, in_includeRootTypeid,\n in_dirtinessType, in_includeReferencedRepositories) {\n if (in_dirtyOnly) {\n return ArrayProperty.prototype._serialize.call(this, in_dirtyOnly, in_includeRootTypeid, in_dirtinessType);\n } else {\n // returns just the current data\n return this._dataArrayRef;\n }\n };\n\n /**\n * @param {string} in_value the new value\n * @throws if string property is read only\n */\n setValue(in_value) {\n this._checkIsNotReadOnly(true);\n this._setValue(in_value, true);\n };\n\n /**\n * @param {string} in_values the new values\n * @param {Bool} in_initial - Whether we are setting default/initial values\n * or if the function is called directly with the values to set.\n * @see {setValues}\n */\n _setValues(in_values, in_initial) {\n throw new Error(MSG.NO_VALUE_PROPERTY_SETVALUES);\n };\n\n /**\n * @param {string} in_values the new values\n * @throws always - cannot use .setValues on a StringProperty. Use .setValue() instead.\n */\n setValues(in_values) {\n StringProperty.prototype._setValues.call(this, in_values, false);\n };\n\n /**\n * @throws always - cannot call .getValues on a string. Use .getValue() instead\n */\n getValues() {\n throw new Error(MSG.NO_VALUE_PROPERTY_GETVALUES);\n };\n\n\n /**\n * Internal function to update the value of a property\n *\n * @param {string} in_value the new value\n * @param {boolean} [in_reportToView = true] - By default, the dirtying will always be reported to the checkout view\n * and trigger a modified event there. When batching updates, this\n * can be prevented via this flag.\n * @return {boolean} true if the value was actually changed\n */\n _setValue(in_value, in_reportToView) {\n var oldValue = this._dataArrayRef;\n var castedValue = String(in_value);\n var changed = castedValue !== oldValue;\n if (changed) {\n\n var stringLength = this._dataArrayRef.length;\n if (stringLength > 0) {\n this._dataArrayRemoveRange(0, stringLength);\n }\n this._dataArrayInsertRange(0, castedValue);\n\n this._dirty = PENDING_AND_DIRTY_SET_TO_PROPERTY_VALUE;\n\n // The assignment in the line above already set this property to\n // dirty, so we only update the parent (instead of calling\n // setDirty on this property)\n if (this._parent) {\n this._parent._setDirty(in_reportToView, this);\n } else if (in_reportToView === true || in_reportToView === undefined) {\n this._reportDirtinessToView();\n }\n }\n return changed;\n };\n\n /**\n * Sets the pending and dirty changesets\n *\n * @param {property-properties.SerializedChangeSet|undefined|null} in_pending\n * The pending changeset. If null is passed, no change will be\n * applied. undefined indicates that the changes should be reset\n * @param {property-properties.SerializedChangeSet|undefined|null} in_dirty\n * The dirty changeset. If null is passed, no change will be\n * applied. undefined indicates that the changes should be reset\n */\n _setChanges(in_pending, in_dirty) {\n if ((this._dirty === PENDING_AND_DIRTY_SET_TO_PROPERTY_VALUE ||\n this._dirty === NO_DIRTY_AND_PENDING_SET_TO_PROPERTY_VALUE) &&\n in_pending === null && in_dirty === undefined) {\n this._dirty = NO_DIRTY_AND_PENDING_SET_TO_PROPERTY_VALUE;\n } else {\n ArrayProperty.prototype._setChanges.call(this, in_pending, in_dirty);\n }\n };\n\n /**\n * Sets the dirty flags for this property\n * @param {Number} in_flags The dirty flags\n */\n _setDirtyFlags(in_flags) {\n if (this._dirty === PENDING_AND_DIRTY_SET_TO_PROPERTY_VALUE ||\n this._dirty === NO_DIRTY_AND_PENDING_SET_TO_PROPERTY_VALUE) {\n this._dirty = STRING_PROPERTY_SET_PROPERTY_VALUE_STATE_FLAGS[in_flags];\n return;\n }\n\n ArrayProperty.prototype._setDirtyFlags.call(this, in_flags);\n };\n\n /**\n * Gets the dirty flags for this property\n * @return {Number} The dirty flags\n */\n _getDirtyFlags() {\n if (this._dirty === PENDING_AND_DIRTY_SET_TO_PROPERTY_VALUE ||\n this._dirty === NO_DIRTY_AND_PENDING_SET_TO_PROPERTY_VALUE) {\n return this._dirty.flags;\n }\n\n return ArrayProperty.prototype._getDirtyFlags.call(this);\n };\n\n /**\n * @inheritdoc\n */\n _applyChangeset(in_changeSet, in_reportToView) {\n // It is unfortunate, but because StringProperty derives from ArrayProperty, it can happen\n // that we receive here a ChangeSet that is formatted for an Array. We must be able to\n // distinguish it from a reversible changeset and from a simple changeset...\n // TODO: We need a formal way to know what kind of content we are to expect in a ChangeSet,\n // we should never have to guess that.\n if (typeof in_changeSet === 'string') {\n // Let's consider it's a simple changeset.\n this._setValue(in_changeSet, in_reportToView);\n } else if (in_changeSet.value !== undefined) {\n // Let's consider it's a reversible changeset.\n this._setValue(in_changeSet.value, in_reportToView);\n } else {\n // Let's consider it's an ArrayProperty-like changeset\n ArrayProperty.prototype._applyChangeset.call(this, in_changeSet, in_reportToView);\n }\n };\n\n /**\n * Calls back the given function with a human-readable string\n * representation of the property.\n * @param {string} indent - Leading spaces to create the tree representation\n * @param {string} externalId - Name of the current property at the upper level.\n * Used for arrays.\n * @param {function} printFct - Function to call for printing each property\n */\n _prettyPrint(indent, externalId, printFct) {\n printFct(indent + externalId + this.getId() + ' (' + this.getTypeid() + '): \"' + this.value + '\"');\n };\n\n /**\n * Return a JSON representation of the property.\n * @return {object} A JSON representation of the property.\n * @private\n */\n _toJson() {\n return {\n id: this.getId(),\n context: this._context,\n typeid: this.getTypeid(),\n isConstant: this._isConstant,\n value: this.value\n };\n };\n\n /**\n * Sets the value of a character at a single index.\n * For example, if you have a string of value 'AAAA' and do .set(1, 'a') => 'AaAA'\n * @param {number} in_index the index you wish to set\n * @param {string} in_character the character you wish to set\n * @throws if length of in_character is longer than one character\n */\n set(in_index, in_character) {\n ConsoleUtils.assert(_.isNumber(in_index), MSG.STRING_SET_NEEDS_INDEX + in_index);\n\n if (in_character.length !== 1) {\n throw new Error(MSG.STRING_SET_ONE_CHAR);\n }\n\n this.setRange(in_index, in_character);\n };\n\n /**\n * sets values in a string starting at an index.\n * For example, if you have a string of Value 'AAAA' and do .setRange(1, 'aa') => AaaA\n * It will set as many letters as are in in_string.\n * @param {number} in_index the index at which you wish to start setting\n * @param {string} in_string the string you wish to set\n * @throws if in_index + length of in_string is longer than the original string\n */\n setRange(in_index, in_string) {\n ArrayProperty.prototype.setRange.call(this, in_index, in_string);\n };\n\n /**\n * get a letter at a given index\n * @param {number} in_index the index\n * @return {string} the single letter found at in_index\n */\n get(in_index) {\n return ArrayProperty.prototype.get.call(this, in_index);\n };\n\n /**\n * inserts a string starting at a position and shifts the rest of the String to the right.\n * Will not overwrite existing values.\n * For StringProperty, insert and insertRange work the same, except that .insert\n * checks that in_value is a string and .insertRange will accept an array of strings.\n * @param {number} in_position target index\n * @param {string | array<string>} in_value value to be inserted\n * @throws if in_position is smaller than zero, larger than the length of the string or not a number\n */\n insertRange(in_position, in_value) {\n if (_.isArray(in_value)) {\n in_value = in_value.join('');\n }\n this._insertRange(in_position, in_value);\n };\n\n /**\n * Creates and initializes the data array\n * @param {Number} in_length the initial length of the array\n */\n _dataArrayCreate(in_length) {\n this._dataArrayRef = '';\n };\n\n /**\n * Returns the length of the data array\n * @return {Number} The length\n */\n _dataArrayGetLength() {\n return this._dataArrayRef.length;\n };\n\n /**\n * Returns the data array's internal buffer\n * @return {Array} The buffer\n */\n _dataArrayGetBuffer() {\n return this._dataArrayRef;\n };\n\n /**\n * Returns an entry from the data array\n * @param {Number} in_i - Position in the array\n *\n * @return {*} The value at index in_i\n */\n _dataArrayGetValue(in_i) {\n in_i = in_i === undefined ? 0 : in_i;\n if (in_i >= this._size || in_i < 0) {\n throw new Error('Trying to access out of bounds!');\n }\n\n return this._dataArrayRef[in_i];\n };\n\n /**\n * Set the array to the given new array\n * @param {String} in_newString - The new contents of the array\n */\n _dataArrayDeserialize(in_newString) {\n this._dataArrayRef = in_newString;\n };\n\n /**\n * Inserts a range into the data array\n * @param {Number} in_position - Position at which the insert should be done\n * @param {String} in_range - The array to insert\n */\n _dataArrayInsertRange(in_position, in_range) {\n this._dataArrayRef = this._dataArrayRef.substr(0, in_position) + in_range + this._dataArrayRef.substr(in_position);\n };\n\n /**\n * Removes a range from the data array\n * @param {Number} in_position - Position at which to start the removal\n * @param {Number} in_length - The number of entries to remove\n */\n _dataArrayRemoveRange(in_position, in_length) {\n if (in_position + in_length < this._dataArrayRef.length + 1) {\n this._dataArrayRef = this._dataArrayRef.substr(0, in_position) +\n this._dataArrayRef.substr(in_position + in_length);\n } else {\n throw Error('DataArray removeRange in_offset + in_deleteCount is out of bounds.');\n }\n };\n\n /**\n * Overwrites a range in the data array\n * @param {Number} in_position - Position at which to start the removal\n * @param {String} in_values - The string with which the range is overwritten\n */\n _dataArraySetRange(in_position, in_values) {\n this._dataArrayRef = this._dataArrayRef.substr(0, in_position) + in_values +\n this._dataArrayRef.substr(in_position + in_values.length);\n };\n\n\n get value() {\n return this.getValue();\n }\n\n set value(val) {\n this.setValue.call(this, val);\n }\n\n /** @inheritdoc */\n _traverse(in_callback, in_pathFromTraversalStart) {\n return undefined;\n }\n\n /** @inheritdoc */\n _traverseStaticProperties(in_callback, in_pathFromTraversalStart) {\n return undefined;\n }\n}\n\nStringProperty.prototype._typeid = 'String';\nStringProperty.prototype._context = 'single';\nStringProperty.prototype._noDirtyInBase = true;\n"]}
1
+ {"version":3,"file":"stringProperty.js","sourceRoot":"","sources":["../../src/properties/stringProperty.js"],"names":[],"mappings":";AAAA;;;GAGG;AACH;;GAEG;;;AAEH,MAAM,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AAC5B,MAAM,EAAE,kBAAkB,EAAE,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAC;AAC/D,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AACrD,MAAM,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,qCAAqC,CAAC,CAAC,SAAS,CAAC;AACzE,MAAM,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC,wCAAwC,CAAC,CAAC;AACxE,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,qCAAqC,CAAC,CAAC;AACxE,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;AAEnD,IAAI,oBAAoB,GAAG,YAAY,CAAC,oBAAoB,CAAC;AAE7D,uEAAuE;AACvE,2EAA2E;AAC3E,8EAA8E;AAC9E,wDAAwD;AACxD,mFAAmF;AACnF,uCAAuC;AACvC,IAAI,uCAAuC,GAAG;IAC1C,OAAO,EAAE,cAAc;IACvB,KAAK,EAAE,cAAc;IACrB,KAAK,EAAE,oBAAoB,CAAC,cAAc,GAAG,oBAAoB,CAAC,KAAK;CAC1E,CAAC;AACF,IAAI,0CAA0C,GAAG;IAC7C,OAAO,EAAE,cAAc;IACvB,KAAK,EAAE,SAAS;IAChB,KAAK,EAAE,oBAAoB,CAAC,cAAc;CAC7C,CAAC;AAEF,IAAI,0CAA0C,GAAG;IAC7C,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,cAA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,KAAK,CAAC,GAAG;QACT,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IAClC,CAAC;IAED,kBAAkB;IAClB,SAAS,CAAC,WAAW,EAAE,yBAAyB;QAC5C,OAAO,SAAS,CAAC;IACrB,CAAC;IAED,kBAAkB;IAClB,yBAAyB,CAAC,WAAW,EAAE,yBAAyB;QAC5D,OAAO,SAAS,CAAC;IACrB,CAAC;CACJ;AAxkBD,wCAwkBC;AAED,cAAc,CAAC,SAAS,CAAC,OAAO,GAAG,QAAQ,CAAC;AAC5C,cAAc,CAAC,SAAS,CAAC,QAAQ,GAAG,QAAQ,CAAC;AAC7C,cAAc,CAAC,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n/**\n * @fileoverview Definition of the StringProperty class\n */\n\nconst _ = require('lodash');\nconst { ValueArrayProperty } = require('./valueArrayProperty');\nconst { ArrayProperty } = require('./arrayProperty');\nconst { MSG } = require('@fluid-experimental/property-common').constants;\nconst { ChangeSet } = require('@fluid-experimental/property-changeset');\nconst { ConsoleUtils } = require('@fluid-experimental/property-common');\nconst { BaseProperty } = require('./baseProperty');\n\nvar MODIFIED_STATE_FLAGS = BaseProperty.MODIFIED_STATE_FLAGS;\n\n// Some global constant objects that are used to indicate a few special\n// cases for the dirty object. If the string was directly set to a literal,\n// we don't need to store any ChangeSet, we only need to store the information\n// that it was updated to a literal and the dirty flags.\n// By using these special objects we avoid the memory overhead of having a separate\n// object for each array in this state.\nvar PENDING_AND_DIRTY_SET_TO_PROPERTY_VALUE = {\n pending: 'setAsLiteral',\n dirty: 'setAsLiteral',\n flags: MODIFIED_STATE_FLAGS.PENDING_CHANGE | MODIFIED_STATE_FLAGS.DIRTY\n};\nvar NO_DIRTY_AND_PENDING_SET_TO_PROPERTY_VALUE = {\n pending: 'setAsLiteral',\n dirty: undefined,\n flags: MODIFIED_STATE_FLAGS.PENDING_CHANGE\n};\n\nvar DIRTY_AND_NO_PENDING_SET_TO_PROPERTY_VALUE = {\n pending: undefined,\n dirty: 'setAsLiteral',\n _flags: MODIFIED_STATE_FLAGS.DIRTY,\n set flags(flags) {\n this._flags = flags;\n console.log('flags was changed!');\n },\n get flags() {\n return this._flags;\n }\n};\n\nvar STRING_PROPERTY_SET_PROPERTY_VALUE_STATE_FLAGS = [\n undefined,\n NO_DIRTY_AND_PENDING_SET_TO_PROPERTY_VALUE,\n DIRTY_AND_NO_PENDING_SET_TO_PROPERTY_VALUE,\n PENDING_AND_DIRTY_SET_TO_PROPERTY_VALUE\n];\n\n/**\n * A primitive property for a string value.\n */\nexport class StringProperty extends ValueArrayProperty {\n /**\n * @param {Object=} in_params - the parameters\n * @constructor\n * @protected\n * @extends property-properties.ValueArrayProperty\n * @alias property-properties.StringProperty\n * @category Arrays\n */\n constructor(in_params) {\n super(in_params);\n };\n\n /**\n * Get the string value\n * @return {string} the JavaScript string primitive value of this StringProperty\n */\n getValue() {\n return this._dataArrayRef;\n };\n\n /**\n * Private helper function to update the internal dirty and pending changes\n *\n * @param {property-properties.SerializedChangeSet} in_changeSet - The changeset to apply\n * @private\n */\n _updateChanges(in_changeSet) {\n // we need to convert the format to allow the application of the changes\n // since _performApplyAfterOnPropertyArray only understands insert/modify/remove commands\n var pendingChangesWereSetBefore = false;\n var pendingChanges = this._getPendingChanges();\n\n if (_.isString(pendingChanges)) {\n pendingChanges = { insert: [[0, pendingChanges]] };\n pendingChangesWereSetBefore = true;\n }\n ChangeSet.prototype._performApplyAfterOnPropertyArray(pendingChanges,\n in_changeSet, this.getFullTypeid(true));\n if (pendingChangesWereSetBefore) {\n pendingChanges = pendingChanges.insert[0][1];\n }\n\n var dirtyChangesWereSetBefore = false;\n var dirtyChanges = this._getDirtyChanges();\n\n if (_.isString(dirtyChanges)) {\n dirtyChanges = { insert: [[0, dirtyChanges]] };\n dirtyChangesWereSetBefore = true;\n }\n ChangeSet.prototype._performApplyAfterOnPropertyArray(dirtyChanges,\n in_changeSet, this.getFullTypeid(true));\n if (dirtyChangesWereSetBefore) {\n dirtyChanges = dirtyChanges.insert[0][1];\n }\n\n this._setChanges(pendingChanges, dirtyChanges);\n };\n\n _getPendingChanges() {\n if (this._dirty === PENDING_AND_DIRTY_SET_TO_PROPERTY_VALUE ||\n this._dirty === NO_DIRTY_AND_PENDING_SET_TO_PROPERTY_VALUE) {\n return this.getValue();\n }\n\n return (this._dirty && this._dirty.pending) || {};\n };\n\n _getDirtyChanges() {\n if (this._dirty === PENDING_AND_DIRTY_SET_TO_PROPERTY_VALUE ||\n this._dirty === DIRTY_AND_NO_PENDING_SET_TO_PROPERTY_VALUE) {\n return this.getValue();\n } else if (this._dirty === NO_DIRTY_AND_PENDING_SET_TO_PROPERTY_VALUE) {\n return {};\n }\n\n return (this._dirty && this._dirty.dirty) || {};\n };\n\n /**\n * inserts a string starting at a position and shifts the rest of\n * the String to the right. Will not overwrite existing values.\n * @param {number} in_position target index\n * @param {string} in_value value to be inserted\n * @throws if in_position is smaller than zero, larger than the length of the string or not a number\n * @throws if in_value is not a string\n */\n insert(in_position, in_value) {\n ConsoleUtils.assert(_.isString(in_value), MSG.IN_VALUE_MUST_BE_STRING + in_value);\n this._insertRange(in_position, in_value);\n };\n\n /**\n * Adds letters to the end of the string\n * @param {string} in_value the string to be pushed\n * @throws if in_value is not a string\n * @return {number} the new length of the string.\n */\n push(in_value) {\n ConsoleUtils.assert(_.isString(in_value), MSG.IN_VALUE_MUST_BE_STRING + in_value);\n this._insertRange(this._dataArrayRef.length, in_value);\n return this.getLength();\n };\n\n\n /**\n * inserts values\n * @param {number} in_position target index\n * @param {string} in_value the string to be inserted\n */\n _insertRange(in_position, in_value) {\n this._checkIsNotReadOnly(true);\n this._insertRangeWithoutDirtying(in_position, in_value);\n this._setDirty();\n };\n\n /**\n * Returns the full property type identifier for the ChangeSet including the enum type id\n * @param {boolean} [in_hideCollection=false] - if true the collection type (if applicable) will be omitted\n * since that is not aplicable here, this param is ignored\n * @return {string} The typeid\n */\n getFullTypeid(in_hideCollection) {\n return this._typeid;\n };\n\n /**\n * returns the String to an empty string.\n */\n clear() {\n this.setValue('');\n };\n\n /**\n * removes a given number of elements from the array property and shifts\n * remaining values to the left.\n * @param {number} in_offset target start index\n * @param {number} in_deleteCount number of elements to be deleted\n * @throws if in_offset is not a number\n * @throws if in_deleteCount is not a number\n * @throws if trying to remove an item with a parent\n * @throws if in_offset is smaller than zero or if in_offset + in_delete count is larger than the length of the array\n * @return {String} the part of the string that was removed.\n */\n removeRange(in_offset, in_deleteCount) {\n ConsoleUtils.assert(_.isNumber(in_offset),\n MSG.NOT_NUMBER + 'in_offset, method: StringProperty.remove or .removeRange');\n ConsoleUtils.assert(_.isNumber(in_deleteCount),\n MSG.NOT_NUMBER + 'in_deleteCount, method: StringProperty.remove or .removeRange');\n ConsoleUtils.assert(in_offset + in_deleteCount < this.length + 1 && in_offset >= 0 && in_deleteCount > 0,\n MSG.REMOVE_OUT_OF_BOUNDS + 'Cannot remove ' + in_deleteCount + ' items starting at index ' + in_offset);\n var result = '';\n for (var i = in_offset; i < in_offset + in_deleteCount; i++) {\n result += this.get(i);\n }\n this._checkIsNotReadOnly(true);\n this._removeRangeWithoutDirtying(in_offset, in_deleteCount);\n this._setDirty();\n return result;\n };\n\n\n /**\n * @inheritdoc\n */\n _deserialize(in_serializedObj, in_reportToView,\n in_filteringOptions, in_createChangeSet) {\n if ((in_serializedObj.remove && in_serializedObj.remove.length > 0) ||\n (in_serializedObj.modify && in_serializedObj.modify.length > 0) ||\n (in_serializedObj.insert &&\n (in_serializedObj.insert.length > 1 ||\n (in_serializedObj.insert.length === 1 &&\n (in_serializedObj.insert[0][0] !== 0 ||\n !_.isString(in_serializedObj.insert[0][1])))))) {\n throw new Error(MSG.NO_NORMALIZED_CHANGESET);\n }\n\n var oldStringLength = this._dataArrayRef.length;\n var newStringData;\n if (_.isString(in_serializedObj)) {\n if (this._setValue(in_serializedObj, in_reportToView)) {\n return in_serializedObj;\n } else {\n return {};\n }\n } else {\n if (!in_serializedObj.insert ||\n !in_serializedObj.insert[0]) {\n // we've got an empty object, so we have to wipe everything we've got\n if (oldStringLength > 0) {\n this.removeRange(0, oldStringLength, in_reportToView);\n return {\n remove: [[0, oldStringLength]]\n };\n } else {\n // the string was already empty, nothing has changed\n return {};\n }\n } else {\n newStringData = in_serializedObj.insert[0][1];\n }\n }\n\n if (newStringData === this._dataArrayRef) {\n // nothing changed\n return {};\n }\n\n // check if something was attached (very common case)\n if (newStringData.length > oldStringLength) {\n if (newStringData.substring(0, oldStringLength) === this._dataArrayRef) {\n var appendChanges = {\n insert: [[oldStringLength, newStringData.substring(oldStringLength)]]\n };\n this.insertRange(oldStringLength, newStringData.substring(oldStringLength), in_reportToView);\n return appendChanges;\n }\n }\n\n // most simplistic diff method: Remove all existing data and insert the new data\n var simpleChanges = {\n insert: [[0, newStringData]]\n };\n if (oldStringLength > 0) {\n simpleChanges.remove = [[0, oldStringLength]];\n this._removeRangeWithoutDirtying(0, oldStringLength, in_reportToView);\n }\n this.insertRange(0, newStringData, in_reportToView);\n return simpleChanges;\n };\n\n /**\n * Serialize the property\n *\n * @param {boolean} in_dirtyOnly -\n * Only include dirty entries in the serialization\n * @param {boolean} in_includeRootTypeid -\n * Include the typeid of the root of the hierarchy - has no effect for ArrayProperty\n * @param {property-properties.BaseProperty.MODIFIED_STATE_FLAGS} [in_dirtinessType] -\n * The type of dirtiness to use when reporting dirty changes. By default this is\n * PENDING_CHANGE\n * @param {boolean} [in_includeReferencedRepositories=false] - If this is set to true, the serialize\n * function will descend into referenced repositories. WARNING: if there are loops in the references\n * this can result in an infinite loop\n *\n * @return {Object} The serialized representation of this property\n * @private\n */\n _serialize(in_dirtyOnly, in_includeRootTypeid,\n in_dirtinessType, in_includeReferencedRepositories) {\n if (in_dirtyOnly) {\n return ArrayProperty.prototype._serialize.call(this, in_dirtyOnly, in_includeRootTypeid, in_dirtinessType);\n } else {\n // returns just the current data\n return this._dataArrayRef;\n }\n };\n\n /**\n * @param {string} in_value the new value\n * @throws if string property is read only\n */\n setValue(in_value) {\n this._checkIsNotReadOnly(true);\n this._setValue(in_value, true);\n };\n\n /**\n * @param {string} in_values the new values\n * @param {Bool} in_initial - Whether we are setting default/initial values\n * or if the function is called directly with the values to set.\n * @see {setValues}\n */\n _setValues(in_values, in_initial) {\n throw new Error(MSG.NO_VALUE_PROPERTY_SETVALUES);\n };\n\n /**\n * @param {string} in_values the new values\n * @throws always - cannot use .setValues on a StringProperty. Use .setValue() instead.\n */\n setValues(in_values) {\n StringProperty.prototype._setValues.call(this, in_values, false);\n };\n\n /**\n * @throws always - cannot call .getValues on a string. Use .getValue() instead\n */\n getValues() {\n throw new Error(MSG.NO_VALUE_PROPERTY_GETVALUES);\n };\n\n\n /**\n * Internal function to update the value of a property\n *\n * @param {string} in_value the new value\n * @param {boolean} [in_reportToView = true] - By default, the dirtying will always be reported to the checkout view\n * and trigger a modified event there. When batching updates, this\n * can be prevented via this flag.\n * @return {boolean} true if the value was actually changed\n */\n _setValue(in_value, in_reportToView) {\n var oldValue = this._dataArrayRef;\n var castedValue = String(in_value);\n var changed = castedValue !== oldValue;\n if (changed) {\n\n var stringLength = this._dataArrayRef.length;\n if (stringLength > 0) {\n this._dataArrayRemoveRange(0, stringLength);\n }\n this._dataArrayInsertRange(0, castedValue);\n\n this._dirty = PENDING_AND_DIRTY_SET_TO_PROPERTY_VALUE;\n\n // The assignment in the line above already set this property to\n // dirty, so we only update the parent (instead of calling\n // setDirty on this property)\n if (this._parent) {\n this._parent._setDirty(in_reportToView, this);\n } else if (in_reportToView === true || in_reportToView === undefined) {\n this._reportDirtinessToView();\n }\n }\n return changed;\n };\n\n /**\n * Sets the pending and dirty changesets\n *\n * @param {property-properties.SerializedChangeSet|undefined|null} in_pending\n * The pending changeset. If null is passed, no change will be\n * applied. undefined indicates that the changes should be reset\n * @param {property-properties.SerializedChangeSet|undefined|null} in_dirty\n * The dirty changeset. If null is passed, no change will be\n * applied. undefined indicates that the changes should be reset\n */\n _setChanges(in_pending, in_dirty) {\n if (this._dirty === PENDING_AND_DIRTY_SET_TO_PROPERTY_VALUE ||\n this._dirty === NO_DIRTY_AND_PENDING_SET_TO_PROPERTY_VALUE ||\n this._dirty === DIRTY_AND_NO_PENDING_SET_TO_PROPERTY_VALUE) {\n let newFlags = this._dirty.flags;\n if (in_pending === undefined) {\n newFlags &= 0xFFFFFFFF ^ BaseProperty.MODIFIED_STATE_FLAGS.PENDING_CHANGE;\n }\n if (in_dirty === undefined) {\n newFlags &= 0xFFFFFFFF ^ BaseProperty.MODIFIED_STATE_FLAGS.DIRTY;\n }\n this._dirty = STRING_PROPERTY_SET_PROPERTY_VALUE_STATE_FLAGS[newFlags];\n } else {\n ArrayProperty.prototype._setChanges.call(this, in_pending, in_dirty);\n }\n };\n\n /**\n * Sets the dirty flags for this property\n * @param {Number} in_flags The dirty flags\n */\n _setDirtyFlags(in_flags) {\n if (this._dirty === PENDING_AND_DIRTY_SET_TO_PROPERTY_VALUE ||\n this._dirty === NO_DIRTY_AND_PENDING_SET_TO_PROPERTY_VALUE ||\n this._dirty === DIRTY_AND_NO_PENDING_SET_TO_PROPERTY_VALUE) {\n this._dirty = STRING_PROPERTY_SET_PROPERTY_VALUE_STATE_FLAGS[in_flags];\n return;\n }\n\n ArrayProperty.prototype._setDirtyFlags.call(this, in_flags);\n };\n\n /**\n * Gets the dirty flags for this property\n * @return {Number} The dirty flags\n */\n _getDirtyFlags() {\n if (this._dirty === PENDING_AND_DIRTY_SET_TO_PROPERTY_VALUE ||\n this._dirty === NO_DIRTY_AND_PENDING_SET_TO_PROPERTY_VALUE ||\n this._dirty === DIRTY_AND_NO_PENDING_SET_TO_PROPERTY_VALUE) {\n return this._dirty.flags;\n }\n\n return ArrayProperty.prototype._getDirtyFlags.call(this);\n };\n\n /**\n * @inheritdoc\n */\n _applyChangeset(in_changeSet, in_reportToView) {\n // It is unfortunate, but because StringProperty derives from ArrayProperty, it can happen\n // that we receive here a ChangeSet that is formatted for an Array. We must be able to\n // distinguish it from a reversible changeset and from a simple changeset...\n // TODO: We need a formal way to know what kind of content we are to expect in a ChangeSet,\n // we should never have to guess that.\n if (typeof in_changeSet === 'string') {\n // Let's consider it's a simple changeset.\n this._setValue(in_changeSet, in_reportToView);\n } else if (in_changeSet.value !== undefined) {\n // Let's consider it's a reversible changeset.\n this._setValue(in_changeSet.value, in_reportToView);\n } else {\n // Let's consider it's an ArrayProperty-like changeset\n ArrayProperty.prototype._applyChangeset.call(this, in_changeSet, in_reportToView);\n }\n };\n\n /**\n * Calls back the given function with a human-readable string\n * representation of the property.\n * @param {string} indent - Leading spaces to create the tree representation\n * @param {string} externalId - Name of the current property at the upper level.\n * Used for arrays.\n * @param {function} printFct - Function to call for printing each property\n */\n _prettyPrint(indent, externalId, printFct) {\n printFct(indent + externalId + this.getId() + ' (' + this.getTypeid() + '): \"' + this.value + '\"');\n };\n\n /**\n * Return a JSON representation of the property.\n * @return {object} A JSON representation of the property.\n * @private\n */\n _toJson() {\n return {\n id: this.getId(),\n context: this._context,\n typeid: this.getTypeid(),\n isConstant: this._isConstant,\n value: this.value\n };\n };\n\n /**\n * Sets the value of a character at a single index.\n * For example, if you have a string of value 'AAAA' and do .set(1, 'a') => 'AaAA'\n * @param {number} in_index the index you wish to set\n * @param {string} in_character the character you wish to set\n * @throws if length of in_character is longer than one character\n */\n set(in_index, in_character) {\n ConsoleUtils.assert(_.isNumber(in_index), MSG.STRING_SET_NEEDS_INDEX + in_index);\n\n if (in_character.length !== 1) {\n throw new Error(MSG.STRING_SET_ONE_CHAR);\n }\n\n this.setRange(in_index, in_character);\n };\n\n /**\n * sets values in a string starting at an index.\n * For example, if you have a string of Value 'AAAA' and do .setRange(1, 'aa') => AaaA\n * It will set as many letters as are in in_string.\n * @param {number} in_index the index at which you wish to start setting\n * @param {string} in_string the string you wish to set\n * @throws if in_index + length of in_string is longer than the original string\n */\n setRange(in_index, in_string) {\n ArrayProperty.prototype.setRange.call(this, in_index, in_string);\n };\n\n /**\n * get a letter at a given index\n * @param {number} in_index the index\n * @return {string} the single letter found at in_index\n */\n get(in_index) {\n return ArrayProperty.prototype.get.call(this, in_index);\n };\n\n /**\n * inserts a string starting at a position and shifts the rest of the String to the right.\n * Will not overwrite existing values.\n * For StringProperty, insert and insertRange work the same, except that .insert\n * checks that in_value is a string and .insertRange will accept an array of strings.\n * @param {number} in_position target index\n * @param {string | array<string>} in_value value to be inserted\n * @throws if in_position is smaller than zero, larger than the length of the string or not a number\n */\n insertRange(in_position, in_value) {\n if (_.isArray(in_value)) {\n in_value = in_value.join('');\n }\n this._insertRange(in_position, in_value);\n };\n\n /**\n * Creates and initializes the data array\n * @param {Number} in_length the initial length of the array\n */\n _dataArrayCreate(in_length) {\n this._dataArrayRef = '';\n };\n\n /**\n * Returns the length of the data array\n * @return {Number} The length\n */\n _dataArrayGetLength() {\n return this._dataArrayRef.length;\n };\n\n /**\n * Returns the data array's internal buffer\n * @return {Array} The buffer\n */\n _dataArrayGetBuffer() {\n return this._dataArrayRef;\n };\n\n /**\n * Returns an entry from the data array\n * @param {Number} in_i - Position in the array\n *\n * @return {*} The value at index in_i\n */\n _dataArrayGetValue(in_i) {\n in_i = in_i === undefined ? 0 : in_i;\n if (in_i >= this._size || in_i < 0) {\n throw new Error('Trying to access out of bounds!');\n }\n\n return this._dataArrayRef[in_i];\n };\n\n /**\n * Set the array to the given new array\n * @param {String} in_newString - The new contents of the array\n */\n _dataArrayDeserialize(in_newString) {\n this._dataArrayRef = in_newString;\n };\n\n /**\n * Inserts a range into the data array\n * @param {Number} in_position - Position at which the insert should be done\n * @param {String} in_range - The array to insert\n */\n _dataArrayInsertRange(in_position, in_range) {\n this._dataArrayRef = this._dataArrayRef.substr(0, in_position) + in_range + this._dataArrayRef.substr(in_position);\n };\n\n /**\n * Removes a range from the data array\n * @param {Number} in_position - Position at which to start the removal\n * @param {Number} in_length - The number of entries to remove\n */\n _dataArrayRemoveRange(in_position, in_length) {\n if (in_position + in_length < this._dataArrayRef.length + 1) {\n this._dataArrayRef = this._dataArrayRef.substr(0, in_position) +\n this._dataArrayRef.substr(in_position + in_length);\n } else {\n throw Error('DataArray removeRange in_offset + in_deleteCount is out of bounds.');\n }\n };\n\n /**\n * Overwrites a range in the data array\n * @param {Number} in_position - Position at which to start the removal\n * @param {String} in_values - The string with which the range is overwritten\n */\n _dataArraySetRange(in_position, in_values) {\n this._dataArrayRef = this._dataArrayRef.substr(0, in_position) + in_values +\n this._dataArrayRef.substr(in_position + in_values.length);\n };\n\n\n get value() {\n return this.getValue();\n }\n\n set value(val) {\n this.setValue.call(this, val);\n }\n\n /** @inheritdoc */\n _traverse(in_callback, in_pathFromTraversalStart) {\n return undefined;\n }\n\n /** @inheritdoc */\n _traverseStaticProperties(in_callback, in_pathFromTraversalStart) {\n return undefined;\n }\n}\n\nStringProperty.prototype._typeid = 'String';\nStringProperty.prototype._context = 'single';\nStringProperty.prototype._noDirtyInBase = true;\n"]}
@@ -147,6 +147,22 @@ describe('StringProperty', function () {
147
147
  testString.insertRange(1, 'BB');
148
148
  expect(testString.getValue()).to.equal('ABBAAAA');
149
149
  });
150
+ it('Should report dirtiness correctly when introducing a modification in certain order', function () {
151
+ testString = PropertyFactory.create('String');
152
+ let newValue = "test";
153
+ const node = PropertyFactory.create('NodeProperty');
154
+ node.insert('stringProp', testString);
155
+ // Ignore insert changeset
156
+ node.cleanDirty();
157
+ node.applyChangeSet(JSON.parse(`{"modify":{"String":{"stringProp":{"value":"${newValue}","oldValue": ""}}}}`));
158
+ node.cleanDirty(BaseProperty.MODIFIED_STATE_FLAGS.PENDING_CHANGE);
159
+ node.cleanDirty();
160
+ let oldValue = newValue;
161
+ newValue = "test1";
162
+ node.applyChangeSet(JSON.parse(`{"modify":{"String":{"stringProp":{"value":"${newValue}","oldValue": "${oldValue}"}}}}`));
163
+ node.cleanDirty(BaseProperty.MODIFIED_STATE_FLAGS.PENDING_CHANGE);
164
+ expect(Object.keys(node._serialize(true, false, 2))).to.have.length(1);
165
+ });
150
166
  it('.insertRange should also accept an array with a single string', function () {
151
167
  var testString = PropertyFactory.create('String');
152
168
  testString.setValue('AAAAA');
@@ -1 +1 @@
1
- {"version":3,"file":"stringProperty.spec.js","sourceRoot":"","sources":["../../../src/test/properties/stringProperty.spec.js"],"names":[],"mappings":"AAAA;;;GAGG;AACH,yCAAyC;AACzC;;;GAGG;AAEH,MAAM,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AAC5B,MAAM,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AAC7C,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AAC1C,MAAM,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC,wCAAwC,CAAC,CAAC;AACxE,MAAM,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,qCAAqC,CAAC,CAAC,SAAS,CAAC;AACzE,MAAM,QAAQ,GAAG,CAAC,CAAC,SAAS,CAAC;AAE7B,QAAQ,CAAC,gBAAgB,EAAE;IACvB,IAAI,oBAAoB,EAAE,gBAAgB,CAAC;IAC3C,IAAI,YAAY,CAAC;IAEjB,MAAM,CAAC;QACH,wDAAwD;QACxD,IAAI,gCAAgC,GAAG;YACnC,MAAM,EAAE,+CAA+C;YACvD,UAAU,EAAE;gBACR,EAAE,EAAE,EAAE,gBAAgB,EAAE,MAAM,EAAE,QAAQ,EAAE;aAC7C;SACJ,CAAC;QACF,eAAe,CAAC,WAAW,CAAC,gCAAgC,CAAC,CAAC;QAE9D,YAAY,GAAG,eAAe,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IACpD,CAAC,CAAC,CAAC;IAEH,iCAAiC;IACjC,IAAI,UAAU,GAAG,UAAU,UAAU;QACjC,UAAU,CAAC,WAAW,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IACnC,CAAC,CAAC;IAEF,yC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C,MAAM,CAAC,4BAA4B,CAAC,MAAM,CAAC,CAAC;QACvE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAC/D,CAAC,CAAC,CAAC;AAGP,CAAC,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n/* eslint-disable no-unused-expressions*/\n/**\n * @fileoverview In this file, we will test the string property\n * object described in /src/properties/stringProperty.js\n */\n\nconst _ = require('lodash');\nconst { PropertyFactory } = require('../..');\nconst { BaseProperty } = require('../..');\nconst { ChangeSet } = require('@fluid-experimental/property-changeset');\nconst { MSG } = require('@fluid-experimental/property-common').constants;\nconst deepCopy = _.cloneDeep;\n\ndescribe('StringProperty', function () {\n var changeSetWithEntries, removalChangeSet;\n var myStringProp;\n\n before(function () {\n // Register a template with a set property for the tests\n var SimpleStringTestPropertyTemplate = {\n typeid: 'autodesk.tests:SimpleStringTestProperty-1.0.0',\n properties: [\n { id: 'stringProperty', typeid: 'String' }\n ]\n };\n PropertyFactory._reregister(SimpleStringTestPropertyTemplate);\n\n myStringProp = PropertyFactory.create('String');\n });\n\n // Inserts a char into the string\n var insertText = function (stringProp) {\n stringProp.insertRange(0, 'x');\n };\n\n // Removes the first char from the string\n var removeText = function (stringProp) {\n stringProp.removeRange(0, 1);\n };\n\n // Modifies the text\n var modifyText = function (stringProp) {\n stringProp.setRange(0, 'y');\n };\n\n // set the text to a given string\n var setText = function (stringProp) {\n stringProp.value = 's';\n };\n\n\n\n describe('Testing creation, assignment and serialization', function () {\n\n it('should be empty at the beginning', function () {\n expect(myStringProp.value).to.equal('');\n expect(myStringProp.getValue()).to.equal('');\n expect(myStringProp.serialize({ 'dirtyOnly': true })).to.be.empty;\n expect(myStringProp.serialize({ 'dirtyOnly': false })).to.equal('');\n });\n\n it('should be possible to insert into the string', function () {\n // Text insertion\n myStringProp.insertRange(0, 'abef');\n expect(myStringProp.value).to.equal('abef');\n expect(myStringProp.getValue()).to.equal('abef');\n myStringProp.insertRange(2, 'cd');\n expect(myStringProp.value).to.equal('abcdef');\n expect(myStringProp.getValue()).to.equal('abcdef');\n changeSetWithEntries = myStringProp.serialize({ 'dirtyOnly': true });\n expect(myStringProp.serialize({ 'dirtyOnly': false })).to.equal('abcdef');\n var CS = myStringProp.serialize({ 'dirtyOnly': true });\n expect(CS.insert &&\n CS.insert[0] &&\n CS.insert[0][1] === 'abcdef').to.be.ok;\n });\n\n it('Should handle removals correctly', function () {\n myStringProp.cleanDirty(BaseProperty.MODIFIED_STATE_FLAGS.DIRTY);\n myStringProp.removeRange(3, 2);\n expect(myStringProp.value).to.equal('abcf');\n expect(myStringProp.getValue()).to.equal('abcf');\n removalChangeSet = myStringProp._serialize(true, false, BaseProperty.MODIFIED_STATE_FLAGS.DIRTY);\n expect(removalChangeSet).to.have.all.keys(['remove']);\n expect(removalChangeSet.remove).to.have.length(1);\n expect(removalChangeSet.remove[0]).to.deep.equal([3, 2]);\n });\n\n it('Should support deserialization', function () {\n var deserializedNode = PropertyFactory.create('String');\n var deserializedChanges1 = deserializedNode.deserialize(changeSetWithEntries);\n expect(deserializedChanges1).to.deep.equal(changeSetWithEntries);\n\n var deserializedChanges2 = deserializedNode.deserialize(changeSetWithEntries);\n expect(ChangeSet.isEmptyChangeSet(deserializedChanges2)).to.be.ok;\n\n var deserializedChanges3 = deserializedNode.deserialize({});\n expect(deserializedChanges3).to.deep.equal({ remove: [[0, 6]] });\n\n deserializedNode.deserialize(changeSetWithEntries); // refill\n var deserializedChanges4 = deserializedNode.deserialize('');\n expect(deserializedChanges4).to.deep.equal('');\n\n });\n\n it('inserting at a bad position should throw an exception', function () {\n expect(function () {\n myStringProp.insertRange(2242, 'x');\n }).to.throw();\n });\n\n it('insert after set should work', function () {\n var testString = PropertyFactory.create('String');\n testString.value = 'A';\n testString.insertRange(0, 'B');\n expect(testString.value).to.equal('BA');\n expect(testString.getValue()).to.equal('BA');\n expect(testString.serialize({ 'dirtyOnly': true })).to.equal('BA');\n });\n\n it('remove after set should work', function () {\n var testString = PropertyFactory.create('String');\n testString.value = 'ABCD';\n testString.removeRange(1, 2);\n expect(testString.value).to.equal('AD');\n expect(testString.getValue()).to.equal('AD');\n expect(testString.serialize({ 'dirtyOnly': true })).to.equal('AD');\n });\n\n it('modify after set should work', function () {\n var testString = PropertyFactory.create('String');\n testString.value = 'ABCD';\n testString.setRange(1, 'XY');\n expect(testString.value).to.equal('AXYD');\n expect(testString.getValue()).to.equal('AXYD');\n expect(testString.serialize({ 'dirtyOnly': true })).to.equal('AXYD');\n });\n\n it('set must stay a set', function () {\n var testString = PropertyFactory.create('String');\n testString.value = 'ABCD';\n expect(testString.serialize({ 'dirtyOnly': true })).to.equal('ABCD');\n testString.cleanDirty();\n testString.value = 'XY';\n expect(testString.serialize({ 'dirtyOnly': true })).to.equal('XY');\n testString.insertRange(2, 'Z');\n expect(testString.serialize({ 'dirtyOnly': true })).to.equal('XYZ');\n });\n\n it('.get should return a single letter', function () {\n var testString = PropertyFactory.create('String');\n testString.value = 'ABCD';\n expect(testString.get(2)).to.equal('C');\n });\n\n it('.getFullTypeid should return a string of the typeid', function () {\n var testString = PropertyFactory.create('String');\n expect(testString.getFullTypeid()).to.equal('String');\n });\n\n it('.insert should insert a string', function () {\n var testString = PropertyFactory.create('String');\n testString.setValue('AAAAA');\n testString.insert(1, 'BB');\n expect(testString.getValue()).to.equal('ABBAAAA');\n });\n\n it('.insertRange should insert a string', function () {\n var testString = PropertyFactory.create('String');\n testString.setValue('AAAAA');\n testString.insertRange(1, 'BB');\n expect(testString.getValue()).to.equal('ABBAAAA');\n });\n\n it('.insertRange should also accept an array with a single string', function () {\n var testString = PropertyFactory.create('String');\n testString.setValue('AAAAA');\n testString.insertRange(1, ['BC']);\n expect(testString.getValue()).to.equal('ABCAAAA');\n });\n\n it('.insertRange should join an array with more than one string', function () {\n var testString = PropertyFactory.create('String');\n testString.setValue('AAAAA');\n testString.insertRange(1, ['B', 'C', 'D']);\n expect(testString.getValue()).to.equal('ABCDAAAA');\n });\n\n it('.push should add a string to the end of the original string and return the length of the string', function () {\n var testString = PropertyFactory.create('String');\n testString.setValue('AAAAA');\n testString.push('BB');\n expect(testString.getValue()).to.equal('AAAAABB');\n expect(testString.push('CC')).to.equal(9);\n });\n });\n\n describe('inherited API methods', function () {\n it('.clear should remove all values from the string', function () {\n var testString = PropertyFactory.create('String');\n testString.setValue('AAAAA');\n expect(testString.getValue()).to.equal('AAAAA');\n testString.clear();\n expect(testString.getValue()).to.equal('');\n });\n\n it('.getEntriesReadOnly should return a string', function () {\n var testString = PropertyFactory.create('String');\n testString.setValue('AAAAA');\n expect(testString.getEntriesReadOnly()).to.equal('AAAAA');\n });\n\n it('.getIds should return an array of string ids', function () {\n var testString = PropertyFactory.create('String');\n testString.setValue('AAAAA');\n expect(testString.getIds()).to.deep.equal(['0', '1', '2', '3', '4']);\n });\n\n it('.getLength should return the length of the string', function () {\n var testString = PropertyFactory.create('String');\n expect(testString.getLength()).to.equal(0);\n testString.setValue('AAAAA');\n expect(testString.getLength()).to.equal(5);\n });\n\n it('.pop should remove the last letter', function () {\n var testString = PropertyFactory.create('String');\n testString.setValue('ABCDE');\n testString.pop();\n expect(testString.getValue()).to.equal('ABCD');\n });\n\n it('.remove should remove a single letter', function () {\n var testString = PropertyFactory.create('String');\n testString.setValue('ABCDE');\n testString.remove(2);\n expect(testString.getValue()).to.equal('ABDE');\n expect(testString.remove(1)).to.equal('B');\n });\n\n it('removeRange should remove a range of letters', function () {\n var testString = PropertyFactory.create('String');\n testString.setValue('ABCDEFG');\n testString.removeRange(1, 2);\n expect(testString.getValue()).to.equal('ADEFG');\n expect(testString.removeRange(2, 3)).to.equal('EFG');\n });\n\n it('@regression removeRange should clear a value longer than the special value \"setAsLiteral\"', function () {\n var testString = PropertyFactory.create('String');\n testString.setValue('AAAAAAAAAAAAAAAAAA');\n testString.removeRange(0, testString.getValue().length);\n expect(testString.getValue()).to.equal('');\n });\n\n it('set should set a single character', function () {\n var testString = PropertyFactory.create('String');\n testString.setValue('ABCDEFG');\n testString.set(3, 'x');\n expect(testString.getValue()).to.equal('ABCxEFG');\n });\n\n it('set should not allow setting more than one character', function () {\n var testString = PropertyFactory.create('String');\n testString.setValue('ABCDEFG');\n\n expect(function () { testString.set(0, 'ab'); }).to.throw(MSG.STRING_SET_ONE_CHAR);\n });\n\n it('set should throw if in_offset is not an integer', function () {\n var testString = PropertyFactory.create('String');\n testString.setValue('ABCDEFG');\n\n expect(function () { testString.set('test', 'a'); }).to.throw(MSG.STRING_SET_NEEDS_INDEX);\n });\n\n it('setRange should replace a range of letters', function () {\n var testString = PropertyFactory.create('String');\n testString.setValue('ABCDEFG');\n testString.setRange(3, 'xx');\n expect(testString.getValue()).to.equal('ABCxxFG');\n });\n\n it('setRange should throw if trying to set out of range', function () {\n var testString = PropertyFactory.create('String');\n testString.setValue('ABCDEFG');\n var fn = function () {\n testString.setRange(5, 'xxxxxx');\n };\n expect(fn).to.throw();\n });\n\n it('setRange should throw if in_offset is not an integer', function () {\n var testString = PropertyFactory.create('String');\n testString.setValue('ABCDEFG');\n var fn = function () {\n testString.setRange('test', 'xx');\n };\n expect(fn).to.throw(MSG.NOT_NUMBER);\n });\n\n it('shift should remove a single letter at the beginning of the string', function () {\n var testString = PropertyFactory.create('String');\n testString.setValue('ABCDEFG');\n testString.shift();\n expect(testString.getValue()).to.equal('BCDEFG');\n expect(testString.shift()).to.equal('B');\n });\n\n it('unshift should add letters at the beginning of a string and return the length of the string', function () {\n var testString = PropertyFactory.create('String');\n testString.setValue('ABC');\n testString.unshift('DE');\n expect(testString.getValue()).to.equal('DEABC');\n expect(testString.unshift('FGH')).to.equal(8);\n });\n });\n\n describe('change set specification should be met', function () {\n it('Should handle inserts correctly', function () {\n var t = PropertyFactory.create('String');\n t.value = 'test';\n t.cleanDirty();\n t.insert(2, '_test_');\n expect(t.serialize({ 'dirtyOnly': true })).to.deep.equal(\n {\n 'insert': [[2, '_test_']]\n }\n );\n });\n\n it('Should handle push correctly', function () {\n var t = PropertyFactory.create('String');\n t.value = 'test';\n t.cleanDirty();\n t.push('_test_');\n expect(t.serialize({ 'dirtyOnly': true })).to.deep.equal(\n {\n 'insert': [[4, '_test_']]\n }\n );\n });\n\n it('Should handle modifies correctly', function () {\n var t = PropertyFactory.create('String');\n t.value = 'test';\n t.cleanDirty();\n t.setRange(1, '_x_');\n expect(t.serialize({ 'dirtyOnly': true })).to.deep.equal(\n {\n 'modify': [[1, '_x_']]\n }\n );\n });\n });\n\n\n describe('squashing', function () {\n // Helper function to test the squashing for different containers\n var innerTestChangeSetSquashing = function (io_testProperty, io_stringProperty,\n io_initialChangeset, in_options, in_collection) {\n var squashedChangeset = new ChangeSet();\n io_testProperty.cleanDirty(BaseProperty.MODIFIED_STATE_FLAGS.DIRTY |\n BaseProperty.MODIFIED_STATE_FLAGS.PENDING_CHANGE);\n var callbacks = in_options.callbacks;\n for (var i = 0; i < callbacks.length; i++) {\n callbacks[i](io_stringProperty);\n var changes = io_testProperty.serialize({ 'dirtyOnly': true });\n io_testProperty.cleanDirty(BaseProperty.MODIFIED_STATE_FLAGS.DIRTY |\n BaseProperty.MODIFIED_STATE_FLAGS.PENDING_CHANGE);\n squashedChangeset.applyChangeSet(changes);\n }\n\n if (in_options.post) {\n var SC = squashedChangeset.getSerializedChangeSet();\n if (in_collection && SC.modify) {\n SC = SC.modify;\n }\n in_options.post(SC);\n }\n io_initialChangeset.applyChangeSet(squashedChangeset.getSerializedChangeSet());\n };\n\n //\n // Helper function which takes a sequence of callbacks that are successively executed\n // and the changes applied by the callbacks are separately tracked and squashed in a\n // a ChangeSet. This ChangeSet is then compared to the state in the property object\n //\n // Optionally, a a callback which controls the initial state before the squashing can\n // be given as first parameter\n //\n var testChangeSetSquashing = function (in_options) {\n\n var testProperty = PropertyFactory.create('autodesk.tests:SimpleStringTestProperty-1.0.0');\n var nodeTestProperty = PropertyFactory.create('NodeProperty');\n var stringInNodeProperty = PropertyFactory.create('String');\n nodeTestProperty.insert('stringProperty', stringInNodeProperty);\n var mapTestProperty = PropertyFactory.create('map<>');\n var stringInMapProperty = PropertyFactory.create('String');\n mapTestProperty.insert('stringProperty', stringInMapProperty);\n\n if (in_options.pre) {\n in_options.pre(testProperty._properties.stringProperty);\n in_options.pre(stringInNodeProperty);\n in_options.pre(stringInMapProperty);\n }\n\n var initialChangeset = new ChangeSet(testProperty.serialize());\n initialChangeset.setIsNormalized(true);\n var initialChangesetNode = new ChangeSet(nodeTestProperty.serialize());\n initialChangesetNode.setIsNormalized(true);\n var initialChangesetMap = new ChangeSet(mapTestProperty.serialize());\n initialChangesetMap.setIsNormalized(true);\n\n innerTestChangeSetSquashing(testProperty,\n testProperty._properties.stringProperty, initialChangeset, in_options);\n innerTestChangeSetSquashing(nodeTestProperty,\n stringInNodeProperty, initialChangesetNode, in_options, true);\n innerTestChangeSetSquashing(mapTestProperty,\n stringInMapProperty, initialChangesetMap, in_options, true);\n\n if (!initialChangeset.getSerializedChangeSet().String) {\n // empty changeset\n expect(testProperty.serialize().String.stringProperty).to.equal('');\n } else {\n // according to the spec, the String changeset can either be a string or (insert|modify|remove) style\n var initialChangesetString = initialChangeset.getSerializedChangeSet().String.stringProperty;\n if (!_.isString(initialChangesetString)) {\n initialChangesetString = initialChangesetString.insert[0][1];\n }\n expect(initialChangesetString).to.deep.equal(testProperty.serialize().String.stringProperty);\n }\n\n if (!initialChangesetNode.getSerializedChangeSet().insert) {\n // empty changeset\n expect(nodeTestProperty.serialize().insert.String.stringProperty).to.equal('');\n } else {\n // according to the spec, the String changeset can either be a string or (insert|modify|remove) style\n var nodeInitialChangesetString = initialChangesetNode.getSerializedChangeSet()\n .insert.String.stringProperty;\n if (!_.isString(nodeInitialChangesetString)) {\n nodeInitialChangesetString = nodeInitialChangesetString.insert[0][1];\n }\n expect(nodeInitialChangesetString).to.deep.equal(nodeTestProperty.serialize()\n .insert.String.stringProperty);\n }\n\n if (!initialChangesetMap.getSerializedChangeSet().insert) {\n // empty changeset\n expect(mapTestProperty.serialize().insert.String.stringProperty).to.equal('');\n } else {\n // according to the spec, the String changeset can either be a string or (insert|modify|remove) style\n var mapInitialChangesetString = initialChangesetMap.getSerializedChangeSet()\n .insert.String.stringProperty;\n if (!_.isString(mapInitialChangesetString)) {\n mapInitialChangesetString = mapInitialChangesetString.insert[0][1];\n }\n expect(mapInitialChangesetString).to.deep.equal(mapTestProperty.serialize().insert.String.stringProperty);\n }\n\n };\n\n it('should work for multiple independent inserts', function () {\n testChangeSetSquashing({ callbacks: [insertText, insertText, insertText] });\n });\n\n it('should work for inserts followed by removes', function () {\n testChangeSetSquashing({\n callbacks: [insertText, insertText, removeText, removeText],\n post: function (changeset) {\n expect(changeset).to.be.empty;\n }\n });\n });\n\n it('should work for mixed modifies and inserts', function () {\n testChangeSetSquashing({\n callbacks: [insertText, modifyText, insertText, modifyText]\n });\n });\n\n it('an insert, modify and a remove should give an empty changeset', function () {\n testChangeSetSquashing({\n callbacks: [insertText, modifyText, removeText],\n post: function (changeset) {\n expect(changeset).to.be.empty;\n }\n });\n });\n it('work for modifies after an already existing insert', function () {\n testChangeSetSquashing({\n pre: insertText,\n callbacks: [modifyText, modifyText]\n });\n });\n it('of modify and remove after an already existing insert should work', function () {\n testChangeSetSquashing({\n pre: insertText,\n callbacks: [modifyText, removeText],\n post: function (changeset) {\n expect(changeset.String.stringProperty).to.have.all.keys('remove');\n }\n });\n });\n\n it('modify after set should work', function () {\n testChangeSetSquashing({\n callbacks: [setText, modifyText],\n post: function (changeset) {\n expect(changeset.String.stringProperty).to.equal('y');\n }\n });\n });\n\n it('set after pre-insert and insert should work', function () {\n testChangeSetSquashing({\n pre: insertText,\n callbacks: [insertText, modifyText, setText],\n post: function (changeset) {\n expect(changeset.String.stringProperty).to.equal('s');\n }\n });\n });\n\n it('insert after set should work', function () {\n testChangeSetSquashing({\n callbacks: [setText, insertText],\n post: function (changeset) {\n expect(changeset.String.stringProperty).to.equal('xs');\n }\n });\n });\n\n it('insert, set, insert/modify should work', function () {\n testChangeSetSquashing({\n callbacks: [insertText, setText, insertText, modifyText],\n post: function (changeset) {\n expect(changeset.String.stringProperty).to.equal('ys');\n }\n });\n });\n\n it('insert, set, insert/modify, set should work', function () {\n testChangeSetSquashing({\n callbacks: [insertText, setText, insertText, modifyText, setText],\n post: function (changeset) {\n expect(changeset.String.stringProperty).to.equal('s');\n }\n });\n });\n });\n\n\n describe('Rebasing', function () {\n\n var createPropertyForRebaseTestByTemplate = function () {\n return PropertyFactory.create('autodesk.tests:SimpleStringTestProperty-1.0.0');\n };\n\n var createNodePropertyForRebase = function () {\n var nodeTestProperty = PropertyFactory.create('NodeProperty');\n var stringInNodeProperty = PropertyFactory.create('String');\n nodeTestProperty.insert('stringProperty', stringInNodeProperty);\n return nodeTestProperty;\n };\n\n var createMapPropertyForRebase = function () {\n var mapTestProperty = PropertyFactory.create('map<>');\n var stringInNodeProperty = PropertyFactory.create('String');\n mapTestProperty.insert('stringProperty', stringInNodeProperty);\n return mapTestProperty;\n };\n\n var getStringPropertyFromNode = function (in_testProperty) {\n return in_testProperty._properties.stringProperty;\n };\n\n var getStringPropertyFromMap = function (in_testProperty) {\n return in_testProperty.get('stringProperty');\n };\n\n var testRebasingInner = function (in_creator, in_getInnerProperty, in_options, in_isCollection) {\n // Prepare the initial state\n var baseProperty1 = in_creator();\n if (in_options.prepare) {\n in_options.prepare(in_getInnerProperty(baseProperty1));\n }\n // Create two copies of this state\n var baseProperty2 = in_creator();\n baseProperty2.deserialize(baseProperty1._serialize(false));\n var baseProperty3 = in_creator();\n baseProperty3.deserialize(baseProperty1._serialize(false));\n\n // Make sure the states are clear\n baseProperty1.cleanDirty(BaseProperty.MODIFIED_STATE_FLAGS.DIRTY |\n BaseProperty.MODIFIED_STATE_FLAGS.PENDING_CHANGE);\n baseProperty2.cleanDirty(BaseProperty.MODIFIED_STATE_FLAGS.DIRTY |\n BaseProperty.MODIFIED_STATE_FLAGS.PENDING_CHANGE);\n baseProperty3.cleanDirty(BaseProperty.MODIFIED_STATE_FLAGS.DIRTY |\n BaseProperty.MODIFIED_STATE_FLAGS.PENDING_CHANGE);\n\n var initialChangeSet = baseProperty1._serialize(false);\n\n // Apply the operations to the two properties in parallel\n if (in_options.op1) {\n in_options.op1(in_getInnerProperty(baseProperty1));\n }\n if (in_options.op2) {\n in_options.op2(in_getInnerProperty(baseProperty2));\n }\n\n // Get the ChangeSets\n var changeSet1 = new ChangeSet(baseProperty1._serialize(true));\n var changeSet2 = baseProperty2._serialize(true);\n\n // Perform the actual rebase\n var conflicts = [];\n changeSet1._rebaseChangeSet(changeSet2, conflicts);\n\n var combinedChangeSet = new ChangeSet(initialChangeSet).clone();\n combinedChangeSet.setIsNormalized(true);\n combinedChangeSet.applyChangeSet(changeSet1);\n combinedChangeSet.applyChangeSet(changeSet2);\n\n if (in_options.compareToSequential) {\n if (in_options.op1) {\n in_options.op1(in_getInnerProperty(baseProperty3));\n }\n if (in_options.op2) {\n in_options.op2(in_getInnerProperty(baseProperty3));\n }\n var finalChangeSet = baseProperty3._serialize(false);\n if (in_isCollection && finalChangeSet.insert) {\n finalChangeSet = finalChangeSet.insert;\n }\n\n var combinedSerialized = combinedChangeSet.getSerializedChangeSet();\n if (in_isCollection && combinedSerialized.insert) {\n combinedSerialized = combinedSerialized.insert;\n }\n\n if (!combinedSerialized.String) {\n // empty changeset\n expect(finalChangeSet.String.stringProperty).to.equal('');\n } else {\n // according to the spec, the String changeset can either be a string or (insert|modify|remove) style\n var combinedChangeSetString = combinedSerialized.String.stringProperty;\n if (!_.isString(combinedChangeSetString)) {\n combinedChangeSetString = combinedChangeSetString.insert[0][1];\n }\n expect(combinedChangeSetString).to.deep.equal(finalChangeSet.String.stringProperty);\n }\n }\n\n if (in_options.checkResult) {\n if (in_isCollection && changeSet2.modify) {\n changeSet2 = changeSet2.modify;\n }\n combinedChangeSet = combinedChangeSet.getSerializedChangeSet();\n if (in_isCollection && combinedChangeSet.insert) {\n combinedChangeSet = combinedChangeSet.insert;\n }\n in_options.checkResult(conflicts, changeSet2, combinedChangeSet);\n }\n };\n\n var testRebasing = function (in_options) {\n testRebasingInner(createPropertyForRebaseTestByTemplate, getStringPropertyFromNode, in_options);\n testRebasingInner(createNodePropertyForRebase, getStringPropertyFromNode, in_options, true);\n testRebasingInner(createMapPropertyForRebase, getStringPropertyFromMap, in_options, true);\n };\n\n it('with a NOP should be possible', function () {\n testRebasing({\n op2: insertText,\n compareToSequential: true\n });\n });\n\n it('with independent inserts should be possible', function () {\n testRebasing({\n op1: insertText,\n op2: insertText,\n compareToSequential: true\n });\n });\n\n it('with independent removes should be possible', function () {\n testRebasing({\n prepare: function (root) {\n insertText(root);\n insertText(root);\n },\n op1: function (root) {\n root.removeRange(1, 1);\n },\n op2: function (root) {\n root.removeRange(0, 1);\n },\n compareToSequential: true\n });\n });\n\n it('with a modify and a remove should possible', function () {\n testRebasing({\n prepare: insertText,\n op1: modifyText,\n op2: removeText,\n compareToSequential: true\n });\n });\n\n it('with a remove and a modify should possible', function () {\n\n testRebasing({\n prepare: insertText,\n op1: removeText,\n op2: modifyText,\n compareToSequential: false,\n checkResult: function (conflicts, changeSet) {\n expect(conflicts).to.have.length(1);\n expect(conflicts[0].type).to.be.equal(ChangeSet.ConflictType.ENTRY_MODIFIED_AFTER_REMOVE);\n expect(conflicts[0].path).to.be.equal('stringProperty');\n }\n });\n });\n\n it('with two compatible removes should be possible', function () {\n testRebasing({\n prepare: insertText,\n op1: removeText,\n op2: removeText,\n compareToSequential: false,\n checkResult: function (conflicts, changeSet) {\n expect(ChangeSet.isEmptyChangeSet(changeSet)).to.be.ok;\n }\n });\n });\n\n it('with two independent modifies should be possible', function () {\n testRebasing({\n prepare: function (root) {\n root.insertRange(0, 'ab');\n },\n op1: modifyText,\n op2: function (root) {\n root.setRange(1, 'z');\n },\n compareToSequential: true,\n checkResult: function (conflicts, changeSet) {\n expect(conflicts).to.be.empty;\n }\n });\n });\n // TODO: test with the same value\n it('with two conflicting modifies should be possible and report a conflict', function () {\n testRebasing({\n prepare: insertText,\n op1: function (stringProp) {\n stringProp.setRange(0, 'j');\n },\n op2: modifyText,\n compareToSequential: true,\n checkResult: function (conflicts, changeSet) {\n expect(conflicts).to.have.length(1);\n expect(changeSet.String.stringProperty.modify[0][1]).to.equal('y');\n expect(conflicts[0].type).to.be.equal(ChangeSet.ConflictType.COLLIDING_SET);\n expect(conflicts[0].path).to.be.equal('stringProperty');\n }\n });\n });\n\n it('with modify followed by remove+insert should work', function () {\n testRebasing({\n prepare: insertText,\n op1: modifyText,\n op2: function (root) {\n removeText(root);\n insertText(root);\n },\n compareToSequential: true,\n checkResult: function (conflicts, changeSet) {\n expect(conflicts).to.have.length(1);\n expect(conflicts[0].type).to.be.equal(ChangeSet.ConflictType.REMOVE_AFTER_MODIFY);\n expect(conflicts[0].path).to.be.equal('stringProperty');\n expect(changeSet.String.stringProperty).to.have.all.keys('remove', 'insert');\n }\n });\n });\n\n it('with remove + insert followed by modify should report conflict', function () {\n testRebasing({\n prepare: insertText,\n op1: function (root) {\n removeText(root);\n insertText(root);\n },\n op2: modifyText,\n compareToSequential: false,\n checkResult: function (conflicts, changeSet) {\n expect(conflicts).to.have.length(1);\n expect(conflicts[0].type).to.be.equal(ChangeSet.ConflictType.ENTRY_MODIFIED_AFTER_REMOVE);\n expect(conflicts[0].path).to.be.equal('stringProperty');\n }\n });\n });\n\n it('with conflicting inserts should report conflict', function () {\n testRebasing({\n prepare: insertText,\n op1: insertText,\n op2: insertText,\n compareToSequential: false,\n checkResult: function (conflicts, changeSet) {\n expect(conflicts).to.have.length(1);\n expect(conflicts[0].type).to.be.equal(ChangeSet.ConflictType.INSERTED_ENTRY_WITH_SAME_KEY);\n expect(conflicts[0].path).to.be.equal('stringProperty');\n }\n });\n });\n\n it('with conflicting remove and insert should keep the insert and move it to the correct position', function () {\n testRebasing({\n prepare: function (p) {\n p.insertRange(0, '0123456');\n },\n op1: function (p) {\n p.removeRange(2, 5);\n },\n op2: function (p) {\n p.insertRange(5, 't');\n },\n compareToSequential: false,\n checkResult: function (conflicts, changeSet) {\n expect(conflicts).to.have.length(0);\n expect(changeSet).to.deep.equal({\n 'String': { stringProperty: { insert: [[2, 't']] } }\n });\n }\n });\n });\n\n it('with touching remove and insert should not report conflict and keep them', function () {\n testRebasing({\n prepare: function (p) {\n p.insertRange(0, '0123456');\n },\n op1: function (p) {\n p.removeRange(2, 3);\n },\n op2: function (p) {\n p.insertRange(5, 'b');\n p.insertRange(2, 'a');\n },\n compareToSequential: false,\n checkResult: function (conflicts, rebasedCS2, combinedChangeSet) {\n expect(conflicts).to.have.length(0);\n expect(rebasedCS2).to.deep.equal({ 'String': { stringProperty: { insert: [[2, 'ab']] } } });\n expect(combinedChangeSet).to.deep.equal({ 'String': { 'stringProperty': '01ab56' } });\n }\n });\n });\n\n it('with conflicting set and insert should report a conflict', function () {\n testRebasing({\n prepare: insertText,\n op1: setText,\n op2: insertText,\n compareToSequential: false,\n checkResult: function (conflicts, changeSet) {\n expect(conflicts).to.have.length(1);\n expect(conflicts[0].type).to.be.equal(ChangeSet.ConflictType.COLLIDING_SET);\n expect(conflicts[0].path).to.be.equal('stringProperty');\n expect(changeSet.String.stringProperty).to.be.equal('s');\n }\n });\n });\n\n it('with conflicting insert and set should report a conflict', function () {\n testRebasing({\n prepare: insertText,\n op1: insertText,\n op2: setText,\n compareToSequential: false,\n checkResult: function (conflicts, changeSet) {\n expect(conflicts).to.have.length(1);\n expect(conflicts[0].type).to.be.equal(ChangeSet.ConflictType.COLLIDING_SET);\n expect(conflicts[0].path).to.be.equal('stringProperty');\n expect(changeSet.String.stringProperty).to.be.equal('s');\n }\n });\n });\n\n it('should correctly handle boundary cases', function () {\n var testChangeSet = function (in_CS, in_CS2) {\n var root = PropertyFactory.create('NodeProperty');\n var initialString = PropertyFactory.create('String');\n root.insert('str', initialString);\n initialString.value = 'AAAAAA';\n root.applyChangeSet(in_CS);\n if (in_CS2) {\n root.applyChangeSet(in_CS2);\n }\n return initialString.value;\n };\n\n var CS1 = new ChangeSet({ modify: { String: { str: { 'remove': [[2, 2]] } } } });\n var CS2 = new ChangeSet({ modify: { String: { str: { 'insert': [[2, '-'], [4, '-']] } } } });\n\n expect(testChangeSet(CS1.getSerializedChangeSet())).to.equal('AAAA');\n expect(testChangeSet(CS2.getSerializedChangeSet())).to.equal('AA-AA-AA');\n\n var conflicts = [];\n var rebasedCS1 = CS2._rebaseChangeSet(deepCopy(CS1.getSerializedChangeSet()), conflicts);\n var rebasedCS2 = CS1._rebaseChangeSet(deepCopy(CS2.getSerializedChangeSet()), conflicts);\n\n expect(rebasedCS1.modify.String.str.remove.length).to.equal(1);\n expect(testChangeSet(CS2.getSerializedChangeSet(), rebasedCS1)).to.equal('AA--AA');\n expect(testChangeSet(CS1.getSerializedChangeSet(), rebasedCS2)).to.equal('AA--AA');\n });\n\n });\n\n it('field \"length\" in schema should be ignored', function () {\n var SchemaStringWithLength = {\n typeid: 'autodesk.tests:SchemaStringWithLength-1.0.0',\n properties: [\n { id: 'stringProperty', typeid: 'String', length: 4 }\n ]\n };\n PropertyFactory.register(SchemaStringWithLength);\n\n var prop = PropertyFactory.create(SchemaStringWithLength.typeid);\n expect(prop.get('stringProperty').getValue()).to.equal('');\n });\n\n it.skip('@bugfix field \"length\" not a number in schema should be ignored', function () {\n var SchemaStringWithStringLength = {\n typeid: 'autodesk.tests:SchemaStringWithStringLength-1.0.0',\n properties: [\n { id: 'stringProperty', typeid: 'String', length: '4' }\n ]\n };\n PropertyFactory.register(SchemaStringWithStringLength);\n\n var prop = PropertyFactory.create(SchemaStringWithStringLength.typeid);\n expect(prop.get('stringProperty').getValue()).to.equal('');\n });\n\n\n});\n"]}
1
+ {"version":3,"file":"stringProperty.spec.js","sourceRoot":"","sources":["../../../src/test/properties/stringProperty.spec.js"],"names":[],"mappings":"AAAA;;;GAGG;AACH,yCAAyC;A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;gBACR,EAAE,EAAE,EAAE,gBAAgB,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,EAAE;aACxD;SACJ,CAAC;QACF,eAAe,CAAC,QAAQ,CAAC,sBAAsB,CAAC,CAAC;QAEjD,IAAI,IAAI,GAAG,eAAe,CAAC,MAAM,CAAC,sBAAsB,CAAC,MAAM,CAAC,CAAC;QACjE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAC/D,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,IAAI,CAAC,iEAAiE,EAAE;QACvE,IAAI,4BAA4B,GAAG;YAC/B,MAAM,EAAE,mDAAmD;YAC3D,UAAU,EAAE;gBACR,EAAE,EAAE,EAAE,gBAAgB,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE;aAC1D;SACJ,CAAC;QACF,eAAe,CAAC,QAAQ,CAAC,4BAA4B,CAAC,CAAC;QAEvD,IAAI,IAAI,GAAG,eAAe,CAAC,MAAM,CAAC,4BAA4B,CAAC,MAAM,CAAC,CAAC;QACvE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAC/D,CAAC,CAAC,CAAC;AAGP,CAAC,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n/* eslint-disable no-unused-expressions*/\n/**\n * @fileoverview In this file, we will test the string property\n * object described in /src/properties/stringProperty.js\n */\n\nconst _ = require('lodash');\nconst { PropertyFactory } = require('../..');\nconst { BaseProperty } = require('../..');\nconst { ChangeSet } = require('@fluid-experimental/property-changeset');\nconst { MSG } = require('@fluid-experimental/property-common').constants;\nconst deepCopy = _.cloneDeep;\n\ndescribe('StringProperty', function () {\n var changeSetWithEntries, removalChangeSet;\n var myStringProp;\n\n before(function () {\n // Register a template with a set property for the tests\n var SimpleStringTestPropertyTemplate = {\n typeid: 'autodesk.tests:SimpleStringTestProperty-1.0.0',\n properties: [\n { id: 'stringProperty', typeid: 'String' }\n ]\n };\n PropertyFactory._reregister(SimpleStringTestPropertyTemplate);\n\n myStringProp = PropertyFactory.create('String');\n });\n\n // Inserts a char into the string\n var insertText = function (stringProp) {\n stringProp.insertRange(0, 'x');\n };\n\n // Removes the first char from the string\n var removeText = function (stringProp) {\n stringProp.removeRange(0, 1);\n };\n\n // Modifies the text\n var modifyText = function (stringProp) {\n stringProp.setRange(0, 'y');\n };\n\n // set the text to a given string\n var setText = function (stringProp) {\n stringProp.value = 's';\n };\n\n\n\n describe('Testing creation, assignment and serialization', function () {\n\n it('should be empty at the beginning', function () {\n expect(myStringProp.value).to.equal('');\n expect(myStringProp.getValue()).to.equal('');\n expect(myStringProp.serialize({ 'dirtyOnly': true })).to.be.empty;\n expect(myStringProp.serialize({ 'dirtyOnly': false })).to.equal('');\n });\n\n it('should be possible to insert into the string', function () {\n // Text insertion\n myStringProp.insertRange(0, 'abef');\n expect(myStringProp.value).to.equal('abef');\n expect(myStringProp.getValue()).to.equal('abef');\n myStringProp.insertRange(2, 'cd');\n expect(myStringProp.value).to.equal('abcdef');\n expect(myStringProp.getValue()).to.equal('abcdef');\n changeSetWithEntries = myStringProp.serialize({ 'dirtyOnly': true });\n expect(myStringProp.serialize({ 'dirtyOnly': false })).to.equal('abcdef');\n var CS = myStringProp.serialize({ 'dirtyOnly': true });\n expect(CS.insert &&\n CS.insert[0] &&\n CS.insert[0][1] === 'abcdef').to.be.ok;\n });\n\n it('Should handle removals correctly', function () {\n myStringProp.cleanDirty(BaseProperty.MODIFIED_STATE_FLAGS.DIRTY);\n myStringProp.removeRange(3, 2);\n expect(myStringProp.value).to.equal('abcf');\n expect(myStringProp.getValue()).to.equal('abcf');\n removalChangeSet = myStringProp._serialize(true, false, BaseProperty.MODIFIED_STATE_FLAGS.DIRTY);\n expect(removalChangeSet).to.have.all.keys(['remove']);\n expect(removalChangeSet.remove).to.have.length(1);\n expect(removalChangeSet.remove[0]).to.deep.equal([3, 2]);\n });\n\n it('Should support deserialization', function () {\n var deserializedNode = PropertyFactory.create('String');\n var deserializedChanges1 = deserializedNode.deserialize(changeSetWithEntries);\n expect(deserializedChanges1).to.deep.equal(changeSetWithEntries);\n\n var deserializedChanges2 = deserializedNode.deserialize(changeSetWithEntries);\n expect(ChangeSet.isEmptyChangeSet(deserializedChanges2)).to.be.ok;\n\n var deserializedChanges3 = deserializedNode.deserialize({});\n expect(deserializedChanges3).to.deep.equal({ remove: [[0, 6]] });\n\n deserializedNode.deserialize(changeSetWithEntries); // refill\n var deserializedChanges4 = deserializedNode.deserialize('');\n expect(deserializedChanges4).to.deep.equal('');\n\n });\n\n it('inserting at a bad position should throw an exception', function () {\n expect(function () {\n myStringProp.insertRange(2242, 'x');\n }).to.throw();\n });\n\n it('insert after set should work', function () {\n var testString = PropertyFactory.create('String');\n testString.value = 'A';\n testString.insertRange(0, 'B');\n expect(testString.value).to.equal('BA');\n expect(testString.getValue()).to.equal('BA');\n expect(testString.serialize({ 'dirtyOnly': true })).to.equal('BA');\n });\n\n it('remove after set should work', function () {\n var testString = PropertyFactory.create('String');\n testString.value = 'ABCD';\n testString.removeRange(1, 2);\n expect(testString.value).to.equal('AD');\n expect(testString.getValue()).to.equal('AD');\n expect(testString.serialize({ 'dirtyOnly': true })).to.equal('AD');\n });\n\n it('modify after set should work', function () {\n var testString = PropertyFactory.create('String');\n testString.value = 'ABCD';\n testString.setRange(1, 'XY');\n expect(testString.value).to.equal('AXYD');\n expect(testString.getValue()).to.equal('AXYD');\n expect(testString.serialize({ 'dirtyOnly': true })).to.equal('AXYD');\n });\n\n it('set must stay a set', function () {\n var testString = PropertyFactory.create('String');\n testString.value = 'ABCD';\n expect(testString.serialize({ 'dirtyOnly': true })).to.equal('ABCD');\n testString.cleanDirty();\n testString.value = 'XY';\n expect(testString.serialize({ 'dirtyOnly': true })).to.equal('XY');\n testString.insertRange(2, 'Z');\n expect(testString.serialize({ 'dirtyOnly': true })).to.equal('XYZ');\n });\n\n it('.get should return a single letter', function () {\n var testString = PropertyFactory.create('String');\n testString.value = 'ABCD';\n expect(testString.get(2)).to.equal('C');\n });\n\n it('.getFullTypeid should return a string of the typeid', function () {\n var testString = PropertyFactory.create('String');\n expect(testString.getFullTypeid()).to.equal('String');\n });\n\n it('.insert should insert a string', function () {\n var testString = PropertyFactory.create('String');\n testString.setValue('AAAAA');\n testString.insert(1, 'BB');\n expect(testString.getValue()).to.equal('ABBAAAA');\n });\n\n it('.insertRange should insert a string', function () {\n var testString = PropertyFactory.create('String');\n testString.setValue('AAAAA');\n testString.insertRange(1, 'BB');\n expect(testString.getValue()).to.equal('ABBAAAA');\n });\n\n it('Should report dirtiness correctly when introducing a modification in certain order', function () {\n testString = PropertyFactory.create('String');\n let newValue = \"test\";\n const node = PropertyFactory.create('NodeProperty');\n node.insert('stringProp', testString);\n // Ignore insert changeset\n node.cleanDirty();\n node.applyChangeSet(JSON.parse(`{\"modify\":{\"String\":{\"stringProp\":{\"value\":\"${newValue}\",\"oldValue\": \"\"}}}}`));\n node.cleanDirty(BaseProperty.MODIFIED_STATE_FLAGS.PENDING_CHANGE);\n node.cleanDirty();\n let oldValue = newValue;\n newValue = \"test1\";\n node.applyChangeSet(JSON.parse(`{\"modify\":{\"String\":{\"stringProp\":{\"value\":\"${newValue}\",\"oldValue\": \"${oldValue}\"}}}}`));\n node.cleanDirty(BaseProperty.MODIFIED_STATE_FLAGS.PENDING_CHANGE);\n expect(Object.keys(node._serialize(true, false, 2))).to.have.length(1);\n });\n\n it('.insertRange should also accept an array with a single string', function () {\n var testString = PropertyFactory.create('String');\n testString.setValue('AAAAA');\n testString.insertRange(1, ['BC']);\n expect(testString.getValue()).to.equal('ABCAAAA');\n });\n\n it('.insertRange should join an array with more than one string', function () {\n var testString = PropertyFactory.create('String');\n testString.setValue('AAAAA');\n testString.insertRange(1, ['B', 'C', 'D']);\n expect(testString.getValue()).to.equal('ABCDAAAA');\n });\n\n it('.push should add a string to the end of the original string and return the length of the string', function () {\n var testString = PropertyFactory.create('String');\n testString.setValue('AAAAA');\n testString.push('BB');\n expect(testString.getValue()).to.equal('AAAAABB');\n expect(testString.push('CC')).to.equal(9);\n });\n });\n\n describe('inherited API methods', function () {\n it('.clear should remove all values from the string', function () {\n var testString = PropertyFactory.create('String');\n testString.setValue('AAAAA');\n expect(testString.getValue()).to.equal('AAAAA');\n testString.clear();\n expect(testString.getValue()).to.equal('');\n });\n\n it('.getEntriesReadOnly should return a string', function () {\n var testString = PropertyFactory.create('String');\n testString.setValue('AAAAA');\n expect(testString.getEntriesReadOnly()).to.equal('AAAAA');\n });\n\n it('.getIds should return an array of string ids', function () {\n var testString = PropertyFactory.create('String');\n testString.setValue('AAAAA');\n expect(testString.getIds()).to.deep.equal(['0', '1', '2', '3', '4']);\n });\n\n it('.getLength should return the length of the string', function () {\n var testString = PropertyFactory.create('String');\n expect(testString.getLength()).to.equal(0);\n testString.setValue('AAAAA');\n expect(testString.getLength()).to.equal(5);\n });\n\n it('.pop should remove the last letter', function () {\n var testString = PropertyFactory.create('String');\n testString.setValue('ABCDE');\n testString.pop();\n expect(testString.getValue()).to.equal('ABCD');\n });\n\n it('.remove should remove a single letter', function () {\n var testString = PropertyFactory.create('String');\n testString.setValue('ABCDE');\n testString.remove(2);\n expect(testString.getValue()).to.equal('ABDE');\n expect(testString.remove(1)).to.equal('B');\n });\n\n it('removeRange should remove a range of letters', function () {\n var testString = PropertyFactory.create('String');\n testString.setValue('ABCDEFG');\n testString.removeRange(1, 2);\n expect(testString.getValue()).to.equal('ADEFG');\n expect(testString.removeRange(2, 3)).to.equal('EFG');\n });\n\n it('@regression removeRange should clear a value longer than the special value \"setAsLiteral\"', function () {\n var testString = PropertyFactory.create('String');\n testString.setValue('AAAAAAAAAAAAAAAAAA');\n testString.removeRange(0, testString.getValue().length);\n expect(testString.getValue()).to.equal('');\n });\n\n it('set should set a single character', function () {\n var testString = PropertyFactory.create('String');\n testString.setValue('ABCDEFG');\n testString.set(3, 'x');\n expect(testString.getValue()).to.equal('ABCxEFG');\n });\n\n it('set should not allow setting more than one character', function () {\n var testString = PropertyFactory.create('String');\n testString.setValue('ABCDEFG');\n\n expect(function () { testString.set(0, 'ab'); }).to.throw(MSG.STRING_SET_ONE_CHAR);\n });\n\n it('set should throw if in_offset is not an integer', function () {\n var testString = PropertyFactory.create('String');\n testString.setValue('ABCDEFG');\n\n expect(function () { testString.set('test', 'a'); }).to.throw(MSG.STRING_SET_NEEDS_INDEX);\n });\n\n it('setRange should replace a range of letters', function () {\n var testString = PropertyFactory.create('String');\n testString.setValue('ABCDEFG');\n testString.setRange(3, 'xx');\n expect(testString.getValue()).to.equal('ABCxxFG');\n });\n\n it('setRange should throw if trying to set out of range', function () {\n var testString = PropertyFactory.create('String');\n testString.setValue('ABCDEFG');\n var fn = function () {\n testString.setRange(5, 'xxxxxx');\n };\n expect(fn).to.throw();\n });\n\n it('setRange should throw if in_offset is not an integer', function () {\n var testString = PropertyFactory.create('String');\n testString.setValue('ABCDEFG');\n var fn = function () {\n testString.setRange('test', 'xx');\n };\n expect(fn).to.throw(MSG.NOT_NUMBER);\n });\n\n it('shift should remove a single letter at the beginning of the string', function () {\n var testString = PropertyFactory.create('String');\n testString.setValue('ABCDEFG');\n testString.shift();\n expect(testString.getValue()).to.equal('BCDEFG');\n expect(testString.shift()).to.equal('B');\n });\n\n it('unshift should add letters at the beginning of a string and return the length of the string', function () {\n var testString = PropertyFactory.create('String');\n testString.setValue('ABC');\n testString.unshift('DE');\n expect(testString.getValue()).to.equal('DEABC');\n expect(testString.unshift('FGH')).to.equal(8);\n });\n });\n\n describe('change set specification should be met', function () {\n it('Should handle inserts correctly', function () {\n var t = PropertyFactory.create('String');\n t.value = 'test';\n t.cleanDirty();\n t.insert(2, '_test_');\n expect(t.serialize({ 'dirtyOnly': true })).to.deep.equal(\n {\n 'insert': [[2, '_test_']]\n }\n );\n });\n\n it('Should handle push correctly', function () {\n var t = PropertyFactory.create('String');\n t.value = 'test';\n t.cleanDirty();\n t.push('_test_');\n expect(t.serialize({ 'dirtyOnly': true })).to.deep.equal(\n {\n 'insert': [[4, '_test_']]\n }\n );\n });\n\n it('Should handle modifies correctly', function () {\n var t = PropertyFactory.create('String');\n t.value = 'test';\n t.cleanDirty();\n t.setRange(1, '_x_');\n expect(t.serialize({ 'dirtyOnly': true })).to.deep.equal(\n {\n 'modify': [[1, '_x_']]\n }\n );\n });\n });\n\n\n describe('squashing', function () {\n // Helper function to test the squashing for different containers\n var innerTestChangeSetSquashing = function (io_testProperty, io_stringProperty,\n io_initialChangeset, in_options, in_collection) {\n var squashedChangeset = new ChangeSet();\n io_testProperty.cleanDirty(BaseProperty.MODIFIED_STATE_FLAGS.DIRTY |\n BaseProperty.MODIFIED_STATE_FLAGS.PENDING_CHANGE);\n var callbacks = in_options.callbacks;\n for (var i = 0; i < callbacks.length; i++) {\n callbacks[i](io_stringProperty);\n var changes = io_testProperty.serialize({ 'dirtyOnly': true });\n io_testProperty.cleanDirty(BaseProperty.MODIFIED_STATE_FLAGS.DIRTY |\n BaseProperty.MODIFIED_STATE_FLAGS.PENDING_CHANGE);\n squashedChangeset.applyChangeSet(changes);\n }\n\n if (in_options.post) {\n var SC = squashedChangeset.getSerializedChangeSet();\n if (in_collection && SC.modify) {\n SC = SC.modify;\n }\n in_options.post(SC);\n }\n io_initialChangeset.applyChangeSet(squashedChangeset.getSerializedChangeSet());\n };\n\n //\n // Helper function which takes a sequence of callbacks that are successively executed\n // and the changes applied by the callbacks are separately tracked and squashed in a\n // a ChangeSet. This ChangeSet is then compared to the state in the property object\n //\n // Optionally, a a callback which controls the initial state before the squashing can\n // be given as first parameter\n //\n var testChangeSetSquashing = function (in_options) {\n\n var testProperty = PropertyFactory.create('autodesk.tests:SimpleStringTestProperty-1.0.0');\n var nodeTestProperty = PropertyFactory.create('NodeProperty');\n var stringInNodeProperty = PropertyFactory.create('String');\n nodeTestProperty.insert('stringProperty', stringInNodeProperty);\n var mapTestProperty = PropertyFactory.create('map<>');\n var stringInMapProperty = PropertyFactory.create('String');\n mapTestProperty.insert('stringProperty', stringInMapProperty);\n\n if (in_options.pre) {\n in_options.pre(testProperty._properties.stringProperty);\n in_options.pre(stringInNodeProperty);\n in_options.pre(stringInMapProperty);\n }\n\n var initialChangeset = new ChangeSet(testProperty.serialize());\n initialChangeset.setIsNormalized(true);\n var initialChangesetNode = new ChangeSet(nodeTestProperty.serialize());\n initialChangesetNode.setIsNormalized(true);\n var initialChangesetMap = new ChangeSet(mapTestProperty.serialize());\n initialChangesetMap.setIsNormalized(true);\n\n innerTestChangeSetSquashing(testProperty,\n testProperty._properties.stringProperty, initialChangeset, in_options);\n innerTestChangeSetSquashing(nodeTestProperty,\n stringInNodeProperty, initialChangesetNode, in_options, true);\n innerTestChangeSetSquashing(mapTestProperty,\n stringInMapProperty, initialChangesetMap, in_options, true);\n\n if (!initialChangeset.getSerializedChangeSet().String) {\n // empty changeset\n expect(testProperty.serialize().String.stringProperty).to.equal('');\n } else {\n // according to the spec, the String changeset can either be a string or (insert|modify|remove) style\n var initialChangesetString = initialChangeset.getSerializedChangeSet().String.stringProperty;\n if (!_.isString(initialChangesetString)) {\n initialChangesetString = initialChangesetString.insert[0][1];\n }\n expect(initialChangesetString).to.deep.equal(testProperty.serialize().String.stringProperty);\n }\n\n if (!initialChangesetNode.getSerializedChangeSet().insert) {\n // empty changeset\n expect(nodeTestProperty.serialize().insert.String.stringProperty).to.equal('');\n } else {\n // according to the spec, the String changeset can either be a string or (insert|modify|remove) style\n var nodeInitialChangesetString = initialChangesetNode.getSerializedChangeSet()\n .insert.String.stringProperty;\n if (!_.isString(nodeInitialChangesetString)) {\n nodeInitialChangesetString = nodeInitialChangesetString.insert[0][1];\n }\n expect(nodeInitialChangesetString).to.deep.equal(nodeTestProperty.serialize()\n .insert.String.stringProperty);\n }\n\n if (!initialChangesetMap.getSerializedChangeSet().insert) {\n // empty changeset\n expect(mapTestProperty.serialize().insert.String.stringProperty).to.equal('');\n } else {\n // according to the spec, the String changeset can either be a string or (insert|modify|remove) style\n var mapInitialChangesetString = initialChangesetMap.getSerializedChangeSet()\n .insert.String.stringProperty;\n if (!_.isString(mapInitialChangesetString)) {\n mapInitialChangesetString = mapInitialChangesetString.insert[0][1];\n }\n expect(mapInitialChangesetString).to.deep.equal(mapTestProperty.serialize().insert.String.stringProperty);\n }\n\n };\n\n it('should work for multiple independent inserts', function () {\n testChangeSetSquashing({ callbacks: [insertText, insertText, insertText] });\n });\n\n it('should work for inserts followed by removes', function () {\n testChangeSetSquashing({\n callbacks: [insertText, insertText, removeText, removeText],\n post: function (changeset) {\n expect(changeset).to.be.empty;\n }\n });\n });\n\n it('should work for mixed modifies and inserts', function () {\n testChangeSetSquashing({\n callbacks: [insertText, modifyText, insertText, modifyText]\n });\n });\n\n it('an insert, modify and a remove should give an empty changeset', function () {\n testChangeSetSquashing({\n callbacks: [insertText, modifyText, removeText],\n post: function (changeset) {\n expect(changeset).to.be.empty;\n }\n });\n });\n it('work for modifies after an already existing insert', function () {\n testChangeSetSquashing({\n pre: insertText,\n callbacks: [modifyText, modifyText]\n });\n });\n it('of modify and remove after an already existing insert should work', function () {\n testChangeSetSquashing({\n pre: insertText,\n callbacks: [modifyText, removeText],\n post: function (changeset) {\n expect(changeset.String.stringProperty).to.have.all.keys('remove');\n }\n });\n });\n\n it('modify after set should work', function () {\n testChangeSetSquashing({\n callbacks: [setText, modifyText],\n post: function (changeset) {\n expect(changeset.String.stringProperty).to.equal('y');\n }\n });\n });\n\n it('set after pre-insert and insert should work', function () {\n testChangeSetSquashing({\n pre: insertText,\n callbacks: [insertText, modifyText, setText],\n post: function (changeset) {\n expect(changeset.String.stringProperty).to.equal('s');\n }\n });\n });\n\n it('insert after set should work', function () {\n testChangeSetSquashing({\n callbacks: [setText, insertText],\n post: function (changeset) {\n expect(changeset.String.stringProperty).to.equal('xs');\n }\n });\n });\n\n it('insert, set, insert/modify should work', function () {\n testChangeSetSquashing({\n callbacks: [insertText, setText, insertText, modifyText],\n post: function (changeset) {\n expect(changeset.String.stringProperty).to.equal('ys');\n }\n });\n });\n\n it('insert, set, insert/modify, set should work', function () {\n testChangeSetSquashing({\n callbacks: [insertText, setText, insertText, modifyText, setText],\n post: function (changeset) {\n expect(changeset.String.stringProperty).to.equal('s');\n }\n });\n });\n });\n\n\n describe('Rebasing', function () {\n\n var createPropertyForRebaseTestByTemplate = function () {\n return PropertyFactory.create('autodesk.tests:SimpleStringTestProperty-1.0.0');\n };\n\n var createNodePropertyForRebase = function () {\n var nodeTestProperty = PropertyFactory.create('NodeProperty');\n var stringInNodeProperty = PropertyFactory.create('String');\n nodeTestProperty.insert('stringProperty', stringInNodeProperty);\n return nodeTestProperty;\n };\n\n var createMapPropertyForRebase = function () {\n var mapTestProperty = PropertyFactory.create('map<>');\n var stringInNodeProperty = PropertyFactory.create('String');\n mapTestProperty.insert('stringProperty', stringInNodeProperty);\n return mapTestProperty;\n };\n\n var getStringPropertyFromNode = function (in_testProperty) {\n return in_testProperty._properties.stringProperty;\n };\n\n var getStringPropertyFromMap = function (in_testProperty) {\n return in_testProperty.get('stringProperty');\n };\n\n var testRebasingInner = function (in_creator, in_getInnerProperty, in_options, in_isCollection) {\n // Prepare the initial state\n var baseProperty1 = in_creator();\n if (in_options.prepare) {\n in_options.prepare(in_getInnerProperty(baseProperty1));\n }\n // Create two copies of this state\n var baseProperty2 = in_creator();\n baseProperty2.deserialize(baseProperty1._serialize(false));\n var baseProperty3 = in_creator();\n baseProperty3.deserialize(baseProperty1._serialize(false));\n\n // Make sure the states are clear\n baseProperty1.cleanDirty(BaseProperty.MODIFIED_STATE_FLAGS.DIRTY |\n BaseProperty.MODIFIED_STATE_FLAGS.PENDING_CHANGE);\n baseProperty2.cleanDirty(BaseProperty.MODIFIED_STATE_FLAGS.DIRTY |\n BaseProperty.MODIFIED_STATE_FLAGS.PENDING_CHANGE);\n baseProperty3.cleanDirty(BaseProperty.MODIFIED_STATE_FLAGS.DIRTY |\n BaseProperty.MODIFIED_STATE_FLAGS.PENDING_CHANGE);\n\n var initialChangeSet = baseProperty1._serialize(false);\n\n // Apply the operations to the two properties in parallel\n if (in_options.op1) {\n in_options.op1(in_getInnerProperty(baseProperty1));\n }\n if (in_options.op2) {\n in_options.op2(in_getInnerProperty(baseProperty2));\n }\n\n // Get the ChangeSets\n var changeSet1 = new ChangeSet(baseProperty1._serialize(true));\n var changeSet2 = baseProperty2._serialize(true);\n\n // Perform the actual rebase\n var conflicts = [];\n changeSet1._rebaseChangeSet(changeSet2, conflicts);\n\n var combinedChangeSet = new ChangeSet(initialChangeSet).clone();\n combinedChangeSet.setIsNormalized(true);\n combinedChangeSet.applyChangeSet(changeSet1);\n combinedChangeSet.applyChangeSet(changeSet2);\n\n if (in_options.compareToSequential) {\n if (in_options.op1) {\n in_options.op1(in_getInnerProperty(baseProperty3));\n }\n if (in_options.op2) {\n in_options.op2(in_getInnerProperty(baseProperty3));\n }\n var finalChangeSet = baseProperty3._serialize(false);\n if (in_isCollection && finalChangeSet.insert) {\n finalChangeSet = finalChangeSet.insert;\n }\n\n var combinedSerialized = combinedChangeSet.getSerializedChangeSet();\n if (in_isCollection && combinedSerialized.insert) {\n combinedSerialized = combinedSerialized.insert;\n }\n\n if (!combinedSerialized.String) {\n // empty changeset\n expect(finalChangeSet.String.stringProperty).to.equal('');\n } else {\n // according to the spec, the String changeset can either be a string or (insert|modify|remove) style\n var combinedChangeSetString = combinedSerialized.String.stringProperty;\n if (!_.isString(combinedChangeSetString)) {\n combinedChangeSetString = combinedChangeSetString.insert[0][1];\n }\n expect(combinedChangeSetString).to.deep.equal(finalChangeSet.String.stringProperty);\n }\n }\n\n if (in_options.checkResult) {\n if (in_isCollection && changeSet2.modify) {\n changeSet2 = changeSet2.modify;\n }\n combinedChangeSet = combinedChangeSet.getSerializedChangeSet();\n if (in_isCollection && combinedChangeSet.insert) {\n combinedChangeSet = combinedChangeSet.insert;\n }\n in_options.checkResult(conflicts, changeSet2, combinedChangeSet);\n }\n };\n\n var testRebasing = function (in_options) {\n testRebasingInner(createPropertyForRebaseTestByTemplate, getStringPropertyFromNode, in_options);\n testRebasingInner(createNodePropertyForRebase, getStringPropertyFromNode, in_options, true);\n testRebasingInner(createMapPropertyForRebase, getStringPropertyFromMap, in_options, true);\n };\n\n it('with a NOP should be possible', function () {\n testRebasing({\n op2: insertText,\n compareToSequential: true\n });\n });\n\n it('with independent inserts should be possible', function () {\n testRebasing({\n op1: insertText,\n op2: insertText,\n compareToSequential: true\n });\n });\n\n it('with independent removes should be possible', function () {\n testRebasing({\n prepare: function (root) {\n insertText(root);\n insertText(root);\n },\n op1: function (root) {\n root.removeRange(1, 1);\n },\n op2: function (root) {\n root.removeRange(0, 1);\n },\n compareToSequential: true\n });\n });\n\n it('with a modify and a remove should possible', function () {\n testRebasing({\n prepare: insertText,\n op1: modifyText,\n op2: removeText,\n compareToSequential: true\n });\n });\n\n it('with a remove and a modify should possible', function () {\n\n testRebasing({\n prepare: insertText,\n op1: removeText,\n op2: modifyText,\n compareToSequential: false,\n checkResult: function (conflicts, changeSet) {\n expect(conflicts).to.have.length(1);\n expect(conflicts[0].type).to.be.equal(ChangeSet.ConflictType.ENTRY_MODIFIED_AFTER_REMOVE);\n expect(conflicts[0].path).to.be.equal('stringProperty');\n }\n });\n });\n\n it('with two compatible removes should be possible', function () {\n testRebasing({\n prepare: insertText,\n op1: removeText,\n op2: removeText,\n compareToSequential: false,\n checkResult: function (conflicts, changeSet) {\n expect(ChangeSet.isEmptyChangeSet(changeSet)).to.be.ok;\n }\n });\n });\n\n it('with two independent modifies should be possible', function () {\n testRebasing({\n prepare: function (root) {\n root.insertRange(0, 'ab');\n },\n op1: modifyText,\n op2: function (root) {\n root.setRange(1, 'z');\n },\n compareToSequential: true,\n checkResult: function (conflicts, changeSet) {\n expect(conflicts).to.be.empty;\n }\n });\n });\n // TODO: test with the same value\n it('with two conflicting modifies should be possible and report a conflict', function () {\n testRebasing({\n prepare: insertText,\n op1: function (stringProp) {\n stringProp.setRange(0, 'j');\n },\n op2: modifyText,\n compareToSequential: true,\n checkResult: function (conflicts, changeSet) {\n expect(conflicts).to.have.length(1);\n expect(changeSet.String.stringProperty.modify[0][1]).to.equal('y');\n expect(conflicts[0].type).to.be.equal(ChangeSet.ConflictType.COLLIDING_SET);\n expect(conflicts[0].path).to.be.equal('stringProperty');\n }\n });\n });\n\n it('with modify followed by remove+insert should work', function () {\n testRebasing({\n prepare: insertText,\n op1: modifyText,\n op2: function (root) {\n removeText(root);\n insertText(root);\n },\n compareToSequential: true,\n checkResult: function (conflicts, changeSet) {\n expect(conflicts).to.have.length(1);\n expect(conflicts[0].type).to.be.equal(ChangeSet.ConflictType.REMOVE_AFTER_MODIFY);\n expect(conflicts[0].path).to.be.equal('stringProperty');\n expect(changeSet.String.stringProperty).to.have.all.keys('remove', 'insert');\n }\n });\n });\n\n it('with remove + insert followed by modify should report conflict', function () {\n testRebasing({\n prepare: insertText,\n op1: function (root) {\n removeText(root);\n insertText(root);\n },\n op2: modifyText,\n compareToSequential: false,\n checkResult: function (conflicts, changeSet) {\n expect(conflicts).to.have.length(1);\n expect(conflicts[0].type).to.be.equal(ChangeSet.ConflictType.ENTRY_MODIFIED_AFTER_REMOVE);\n expect(conflicts[0].path).to.be.equal('stringProperty');\n }\n });\n });\n\n it('with conflicting inserts should report conflict', function () {\n testRebasing({\n prepare: insertText,\n op1: insertText,\n op2: insertText,\n compareToSequential: false,\n checkResult: function (conflicts, changeSet) {\n expect(conflicts).to.have.length(1);\n expect(conflicts[0].type).to.be.equal(ChangeSet.ConflictType.INSERTED_ENTRY_WITH_SAME_KEY);\n expect(conflicts[0].path).to.be.equal('stringProperty');\n }\n });\n });\n\n it('with conflicting remove and insert should keep the insert and move it to the correct position', function () {\n testRebasing({\n prepare: function (p) {\n p.insertRange(0, '0123456');\n },\n op1: function (p) {\n p.removeRange(2, 5);\n },\n op2: function (p) {\n p.insertRange(5, 't');\n },\n compareToSequential: false,\n checkResult: function (conflicts, changeSet) {\n expect(conflicts).to.have.length(0);\n expect(changeSet).to.deep.equal({\n 'String': { stringProperty: { insert: [[2, 't']] } }\n });\n }\n });\n });\n\n it('with touching remove and insert should not report conflict and keep them', function () {\n testRebasing({\n prepare: function (p) {\n p.insertRange(0, '0123456');\n },\n op1: function (p) {\n p.removeRange(2, 3);\n },\n op2: function (p) {\n p.insertRange(5, 'b');\n p.insertRange(2, 'a');\n },\n compareToSequential: false,\n checkResult: function (conflicts, rebasedCS2, combinedChangeSet) {\n expect(conflicts).to.have.length(0);\n expect(rebasedCS2).to.deep.equal({ 'String': { stringProperty: { insert: [[2, 'ab']] } } });\n expect(combinedChangeSet).to.deep.equal({ 'String': { 'stringProperty': '01ab56' } });\n }\n });\n });\n\n it('with conflicting set and insert should report a conflict', function () {\n testRebasing({\n prepare: insertText,\n op1: setText,\n op2: insertText,\n compareToSequential: false,\n checkResult: function (conflicts, changeSet) {\n expect(conflicts).to.have.length(1);\n expect(conflicts[0].type).to.be.equal(ChangeSet.ConflictType.COLLIDING_SET);\n expect(conflicts[0].path).to.be.equal('stringProperty');\n expect(changeSet.String.stringProperty).to.be.equal('s');\n }\n });\n });\n\n it('with conflicting insert and set should report a conflict', function () {\n testRebasing({\n prepare: insertText,\n op1: insertText,\n op2: setText,\n compareToSequential: false,\n checkResult: function (conflicts, changeSet) {\n expect(conflicts).to.have.length(1);\n expect(conflicts[0].type).to.be.equal(ChangeSet.ConflictType.COLLIDING_SET);\n expect(conflicts[0].path).to.be.equal('stringProperty');\n expect(changeSet.String.stringProperty).to.be.equal('s');\n }\n });\n });\n\n it('should correctly handle boundary cases', function () {\n var testChangeSet = function (in_CS, in_CS2) {\n var root = PropertyFactory.create('NodeProperty');\n var initialString = PropertyFactory.create('String');\n root.insert('str', initialString);\n initialString.value = 'AAAAAA';\n root.applyChangeSet(in_CS);\n if (in_CS2) {\n root.applyChangeSet(in_CS2);\n }\n return initialString.value;\n };\n\n var CS1 = new ChangeSet({ modify: { String: { str: { 'remove': [[2, 2]] } } } });\n var CS2 = new ChangeSet({ modify: { String: { str: { 'insert': [[2, '-'], [4, '-']] } } } });\n\n expect(testChangeSet(CS1.getSerializedChangeSet())).to.equal('AAAA');\n expect(testChangeSet(CS2.getSerializedChangeSet())).to.equal('AA-AA-AA');\n\n var conflicts = [];\n var rebasedCS1 = CS2._rebaseChangeSet(deepCopy(CS1.getSerializedChangeSet()), conflicts);\n var rebasedCS2 = CS1._rebaseChangeSet(deepCopy(CS2.getSerializedChangeSet()), conflicts);\n\n expect(rebasedCS1.modify.String.str.remove.length).to.equal(1);\n expect(testChangeSet(CS2.getSerializedChangeSet(), rebasedCS1)).to.equal('AA--AA');\n expect(testChangeSet(CS1.getSerializedChangeSet(), rebasedCS2)).to.equal('AA--AA');\n });\n\n });\n\n it('field \"length\" in schema should be ignored', function () {\n var SchemaStringWithLength = {\n typeid: 'autodesk.tests:SchemaStringWithLength-1.0.0',\n properties: [\n { id: 'stringProperty', typeid: 'String', length: 4 }\n ]\n };\n PropertyFactory.register(SchemaStringWithLength);\n\n var prop = PropertyFactory.create(SchemaStringWithLength.typeid);\n expect(prop.get('stringProperty').getValue()).to.equal('');\n });\n\n it.skip('@bugfix field \"length\" not a number in schema should be ignored', function () {\n var SchemaStringWithStringLength = {\n typeid: 'autodesk.tests:SchemaStringWithStringLength-1.0.0',\n properties: [\n { id: 'stringProperty', typeid: 'String', length: '4' }\n ]\n };\n PropertyFactory.register(SchemaStringWithStringLength);\n\n var prop = PropertyFactory.create(SchemaStringWithStringLength.typeid);\n expect(prop.get('stringProperty').getValue()).to.equal('');\n });\n\n\n});\n"]}
@@ -882,7 +882,7 @@
882
882
  "affectsGlobalScope": true
883
883
  },
884
884
  "../../src/test/properties/stringProperty.spec.js": {
885
- "version": "c0b46e24497a7a3157f74ba84ef42779af240c1f48dfcd710912a573d2e838aa",
885
+ "version": "aeb6aff5abb9dd84560cb90db9188cf28b0760ac6a611eece2fd2c832e79817e",
886
886
  "signature": "8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881",
887
887
  "affectsGlobalScope": true
888
888
  },
@@ -30,9 +30,16 @@ var NO_DIRTY_AND_PENDING_SET_TO_PROPERTY_VALUE = {
30
30
  flags: MODIFIED_STATE_FLAGS.PENDING_CHANGE
31
31
  };
32
32
  var DIRTY_AND_NO_PENDING_SET_TO_PROPERTY_VALUE = {
33
- pending: 'setAsLiteral',
34
- dirty: undefined,
35
- flags: MODIFIED_STATE_FLAGS.DIRTY
33
+ pending: undefined,
34
+ dirty: 'setAsLiteral',
35
+ _flags: MODIFIED_STATE_FLAGS.DIRTY,
36
+ set flags(flags) {
37
+ this._flags = flags;
38
+ console.log('flags was changed!');
39
+ },
40
+ get flags() {
41
+ return this._flags;
42
+ }
36
43
  };
37
44
  var STRING_PROPERTY_SET_PROPERTY_VALUE_STATE_FLAGS = [
38
45
  undefined,
@@ -105,7 +112,8 @@ export class StringProperty extends ValueArrayProperty {
105
112
  }
106
113
  ;
107
114
  _getDirtyChanges() {
108
- if (this._dirty === PENDING_AND_DIRTY_SET_TO_PROPERTY_VALUE) {
115
+ if (this._dirty === PENDING_AND_DIRTY_SET_TO_PROPERTY_VALUE ||
116
+ this._dirty === DIRTY_AND_NO_PENDING_SET_TO_PROPERTY_VALUE) {
109
117
  return this.getValue();
110
118
  }
111
119
  else if (this._dirty === NO_DIRTY_AND_PENDING_SET_TO_PROPERTY_VALUE) {
@@ -365,10 +373,17 @@ export class StringProperty extends ValueArrayProperty {
365
373
  * applied. undefined indicates that the changes should be reset
366
374
  */
367
375
  _setChanges(in_pending, in_dirty) {
368
- if ((this._dirty === PENDING_AND_DIRTY_SET_TO_PROPERTY_VALUE ||
369
- this._dirty === NO_DIRTY_AND_PENDING_SET_TO_PROPERTY_VALUE) &&
370
- in_pending === null && in_dirty === undefined) {
371
- this._dirty = NO_DIRTY_AND_PENDING_SET_TO_PROPERTY_VALUE;
376
+ if (this._dirty === PENDING_AND_DIRTY_SET_TO_PROPERTY_VALUE ||
377
+ this._dirty === NO_DIRTY_AND_PENDING_SET_TO_PROPERTY_VALUE ||
378
+ this._dirty === DIRTY_AND_NO_PENDING_SET_TO_PROPERTY_VALUE) {
379
+ let newFlags = this._dirty.flags;
380
+ if (in_pending === undefined) {
381
+ newFlags &= 0xFFFFFFFF ^ BaseProperty.MODIFIED_STATE_FLAGS.PENDING_CHANGE;
382
+ }
383
+ if (in_dirty === undefined) {
384
+ newFlags &= 0xFFFFFFFF ^ BaseProperty.MODIFIED_STATE_FLAGS.DIRTY;
385
+ }
386
+ this._dirty = STRING_PROPERTY_SET_PROPERTY_VALUE_STATE_FLAGS[newFlags];
372
387
  }
373
388
  else {
374
389
  ArrayProperty.prototype._setChanges.call(this, in_pending, in_dirty);
@@ -381,7 +396,8 @@ export class StringProperty extends ValueArrayProperty {
381
396
  */
382
397
  _setDirtyFlags(in_flags) {
383
398
  if (this._dirty === PENDING_AND_DIRTY_SET_TO_PROPERTY_VALUE ||
384
- this._dirty === NO_DIRTY_AND_PENDING_SET_TO_PROPERTY_VALUE) {
399
+ this._dirty === NO_DIRTY_AND_PENDING_SET_TO_PROPERTY_VALUE ||
400
+ this._dirty === DIRTY_AND_NO_PENDING_SET_TO_PROPERTY_VALUE) {
385
401
  this._dirty = STRING_PROPERTY_SET_PROPERTY_VALUE_STATE_FLAGS[in_flags];
386
402
  return;
387
403
  }
@@ -394,7 +410,8 @@ export class StringProperty extends ValueArrayProperty {
394
410
  */
395
411
  _getDirtyFlags() {
396
412
  if (this._dirty === PENDING_AND_DIRTY_SET_TO_PROPERTY_VALUE ||
397
- this._dirty === NO_DIRTY_AND_PENDING_SET_TO_PROPERTY_VALUE) {
413
+ this._dirty === NO_DIRTY_AND_PENDING_SET_TO_PROPERTY_VALUE ||
414
+ this._dirty === DIRTY_AND_NO_PENDING_SET_TO_PROPERTY_VALUE) {
398
415
  return this._dirty.flags;
399
416
  }
400
417
  return ArrayProperty.prototype._getDirtyFlags.call(this);
@@ -1 +1 @@
1
- {"version":3,"file":"stringProperty.js","sourceRoot":"","sources":["../../src/properties/stringProperty.js"],"names":[],"mappings":"AAAA;;;GAGG;AACH;;GAEG;AAEH,MAAM,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AAC5B,MAAM,EAAE,kBAAkB,EAAE,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAC;AAC/D,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AACrD,MAAM,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,qCAAqC,CAAC,CAAC,SAAS,CAAC;AACzE,MAAM,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC,wCAAwC,CAAC,CAAC;AACxE,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,qCAAqC,CAAC,CAAC;AACxE,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;AAEnD,IAAI,oBAAoB,GAAG,YAAY,CAAC,oBAAoB,CAAC;AAE7D,uEAAuE;AACvE,2EAA2E;AAC3E,8EAA8E;AAC9E,wDAAwD;AACxD,mFAAmF;AACnF,uCAAuC;AACvC,IAAI,uCAAuC,GAAG;IAC1C,OAAO,EAAE,cAAc;IACvB,KAAK,EAAE,cAAc;IACrB,KAAK,EAAE,oBAAoB,CAAC,cAAc,GAAG,oBAAoB,CAAC,KAAK;CAC1E,CAAC;AACF,IAAI,0CAA0C,GAAG;IAC7C,OAAO,EAAE,cAAc;IACvB,KAAK,EAAE,SAAS;IAChB,KAAK,EAAE,oBAAoB,CAAC,cAAc;CAC7C,CAAC;AAEF,IAAI,0CAA0C,GAAG;IAC7C,OAAO,EAAE,cAAc;IACvB,KAAK,EAAE,SAAS;IAChB,KAAK,EAAE,oBAAoB,CAAC,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AAE;YACzD,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,EAAE,WAAW,CAAC;gBAC1D,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,WAAW,GAAG,SAAS,CAAC,CAAC;SAC1D;aAAM;YACH,MAAM,KAAK,CAAC,oEAAoE,CAAC,CAAC;SACrF;IACL,CAAC;IAAA,CAAC;IAEF;;;;OAIG;IACH,kBAAkB,CAAC,WAAW,EAAE,SAAS;QACrC,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,EAAE,WAAW,CAAC,GAAG,SAAS;YACtE,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,WAAW,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;IAClE,CAAC;IAAA,CAAC;IAGF,IAAI,KAAK;QACL,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC;IAC3B,CAAC;IAED,IAAI,KAAK,CAAC,GAAG;QACT,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IAClC,CAAC;IAED,kBAAkB;IAClB,SAAS,CAAC,WAAW,EAAE,yBAAyB;QAC5C,OAAO,SAAS,CAAC;IACrB,CAAC;IAED,kBAAkB;IAClB,yBAAyB,CAAC,WAAW,EAAE,yBAAyB;QAC5D,OAAO,SAAS,CAAC;IACrB,CAAC;CACJ;AAED,cAAc,CAAC,SAAS,CAAC,OAAO,GAAG,QAAQ,CAAC;AAC5C,cAAc,CAAC,SAAS,CAAC,QAAQ,GAAG,QAAQ,CAAC;AAC7C,cAAc,CAAC,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n/**\n * @fileoverview Definition of the StringProperty class\n */\n\nconst _ = require('lodash');\nconst { ValueArrayProperty } = require('./valueArrayProperty');\nconst { ArrayProperty } = require('./arrayProperty');\nconst { MSG } = require('@fluid-experimental/property-common').constants;\nconst { ChangeSet } = require('@fluid-experimental/property-changeset');\nconst { ConsoleUtils } = require('@fluid-experimental/property-common');\nconst { BaseProperty } = require('./baseProperty');\n\nvar MODIFIED_STATE_FLAGS = BaseProperty.MODIFIED_STATE_FLAGS;\n\n// Some global constant objects that are used to indicate a few special\n// cases for the dirty object. If the string was directly set to a literal,\n// we don't need to store any ChangeSet, we only need to store the information\n// that it was updated to a literal and the dirty flags.\n// By using these special objects we avoid the memory overhead of having a separate\n// object for each array in this state.\nvar PENDING_AND_DIRTY_SET_TO_PROPERTY_VALUE = {\n pending: 'setAsLiteral',\n dirty: 'setAsLiteral',\n flags: MODIFIED_STATE_FLAGS.PENDING_CHANGE | MODIFIED_STATE_FLAGS.DIRTY\n};\nvar NO_DIRTY_AND_PENDING_SET_TO_PROPERTY_VALUE = {\n pending: 'setAsLiteral',\n dirty: undefined,\n flags: MODIFIED_STATE_FLAGS.PENDING_CHANGE\n};\n\nvar DIRTY_AND_NO_PENDING_SET_TO_PROPERTY_VALUE = {\n pending: 'setAsLiteral',\n dirty: undefined,\n flags: MODIFIED_STATE_FLAGS.DIRTY\n};\n\nvar STRING_PROPERTY_SET_PROPERTY_VALUE_STATE_FLAGS = [\n undefined,\n NO_DIRTY_AND_PENDING_SET_TO_PROPERTY_VALUE,\n DIRTY_AND_NO_PENDING_SET_TO_PROPERTY_VALUE,\n PENDING_AND_DIRTY_SET_TO_PROPERTY_VALUE\n];\n\n/**\n * A primitive property for a string value.\n */\nexport class StringProperty extends ValueArrayProperty {\n /**\n * @param {Object=} in_params - the parameters\n * @constructor\n * @protected\n * @extends property-properties.ValueArrayProperty\n * @alias property-properties.StringProperty\n * @category Arrays\n */\n constructor(in_params) {\n super(in_params);\n };\n\n /**\n * Get the string value\n * @return {string} the JavaScript string primitive value of this StringProperty\n */\n getValue() {\n return this._dataArrayRef;\n };\n\n /**\n * Private helper function to update the internal dirty and pending changes\n *\n * @param {property-properties.SerializedChangeSet} in_changeSet - The changeset to apply\n * @private\n */\n _updateChanges(in_changeSet) {\n // we need to convert the format to allow the application of the changes\n // since _performApplyAfterOnPropertyArray only understands insert/modify/remove commands\n var pendingChangesWereSetBefore = false;\n var pendingChanges = this._getPendingChanges();\n\n if (_.isString(pendingChanges)) {\n pendingChanges = { insert: [[0, pendingChanges]] };\n pendingChangesWereSetBefore = true;\n }\n ChangeSet.prototype._performApplyAfterOnPropertyArray(pendingChanges,\n in_changeSet, this.getFullTypeid(true));\n if (pendingChangesWereSetBefore) {\n pendingChanges = pendingChanges.insert[0][1];\n }\n\n var dirtyChangesWereSetBefore = false;\n var dirtyChanges = this._getDirtyChanges();\n\n if (_.isString(dirtyChanges)) {\n dirtyChanges = { insert: [[0, dirtyChanges]] };\n dirtyChangesWereSetBefore = true;\n }\n ChangeSet.prototype._performApplyAfterOnPropertyArray(dirtyChanges,\n in_changeSet, this.getFullTypeid(true));\n if (dirtyChangesWereSetBefore) {\n dirtyChanges = dirtyChanges.insert[0][1];\n }\n\n this._setChanges(pendingChanges, dirtyChanges);\n };\n\n _getPendingChanges() {\n if (this._dirty === PENDING_AND_DIRTY_SET_TO_PROPERTY_VALUE ||\n this._dirty === NO_DIRTY_AND_PENDING_SET_TO_PROPERTY_VALUE) {\n return this.getValue();\n }\n\n return (this._dirty && this._dirty.pending) || {};\n };\n\n _getDirtyChanges() {\n if (this._dirty === PENDING_AND_DIRTY_SET_TO_PROPERTY_VALUE) {\n return this.getValue();\n } else if (this._dirty === NO_DIRTY_AND_PENDING_SET_TO_PROPERTY_VALUE) {\n return {};\n }\n\n return (this._dirty && this._dirty.dirty) || {};\n };\n\n /**\n * inserts a string starting at a position and shifts the rest of\n * the String to the right. Will not overwrite existing values.\n * @param {number} in_position target index\n * @param {string} in_value value to be inserted\n * @throws if in_position is smaller than zero, larger than the length of the string or not a number\n * @throws if in_value is not a string\n */\n insert(in_position, in_value) {\n ConsoleUtils.assert(_.isString(in_value), MSG.IN_VALUE_MUST_BE_STRING + in_value);\n this._insertRange(in_position, in_value);\n };\n\n /**\n * Adds letters to the end of the string\n * @param {string} in_value the string to be pushed\n * @throws if in_value is not a string\n * @return {number} the new length of the string.\n */\n push(in_value) {\n ConsoleUtils.assert(_.isString(in_value), MSG.IN_VALUE_MUST_BE_STRING + in_value);\n this._insertRange(this._dataArrayRef.length, in_value);\n return this.getLength();\n };\n\n\n /**\n * inserts values\n * @param {number} in_position target index\n * @param {string} in_value the string to be inserted\n */\n _insertRange(in_position, in_value) {\n this._checkIsNotReadOnly(true);\n this._insertRangeWithoutDirtying(in_position, in_value);\n this._setDirty();\n };\n\n /**\n * Returns the full property type identifier for the ChangeSet including the enum type id\n * @param {boolean} [in_hideCollection=false] - if true the collection type (if applicable) will be omitted\n * since that is not aplicable here, this param is ignored\n * @return {string} The typeid\n */\n getFullTypeid(in_hideCollection) {\n return this._typeid;\n };\n\n /**\n * returns the String to an empty string.\n */\n clear() {\n this.setValue('');\n };\n\n /**\n * removes a given number of elements from the array property and shifts\n * remaining values to the left.\n * @param {number} in_offset target start index\n * @param {number} in_deleteCount number of elements to be deleted\n * @throws if in_offset is not a number\n * @throws if in_deleteCount is not a number\n * @throws if trying to remove an item with a parent\n * @throws if in_offset is smaller than zero or if in_offset + in_delete count is larger than the length of the array\n * @return {String} the part of the string that was removed.\n */\n removeRange(in_offset, in_deleteCount) {\n ConsoleUtils.assert(_.isNumber(in_offset),\n MSG.NOT_NUMBER + 'in_offset, method: StringProperty.remove or .removeRange');\n ConsoleUtils.assert(_.isNumber(in_deleteCount),\n MSG.NOT_NUMBER + 'in_deleteCount, method: StringProperty.remove or .removeRange');\n ConsoleUtils.assert(in_offset + in_deleteCount < this.length + 1 && in_offset >= 0 && in_deleteCount > 0,\n MSG.REMOVE_OUT_OF_BOUNDS + 'Cannot remove ' + in_deleteCount + ' items starting at index ' + in_offset);\n var result = '';\n for (var i = in_offset; i < in_offset + in_deleteCount; i++) {\n result += this.get(i);\n }\n this._checkIsNotReadOnly(true);\n this._removeRangeWithoutDirtying(in_offset, in_deleteCount);\n this._setDirty();\n return result;\n };\n\n\n /**\n * @inheritdoc\n */\n _deserialize(in_serializedObj, in_reportToView,\n in_filteringOptions, in_createChangeSet) {\n if ((in_serializedObj.remove && in_serializedObj.remove.length > 0) ||\n (in_serializedObj.modify && in_serializedObj.modify.length > 0) ||\n (in_serializedObj.insert &&\n (in_serializedObj.insert.length > 1 ||\n (in_serializedObj.insert.length === 1 &&\n (in_serializedObj.insert[0][0] !== 0 ||\n !_.isString(in_serializedObj.insert[0][1])))))) {\n throw new Error(MSG.NO_NORMALIZED_CHANGESET);\n }\n\n var oldStringLength = this._dataArrayRef.length;\n var newStringData;\n if (_.isString(in_serializedObj)) {\n if (this._setValue(in_serializedObj, in_reportToView)) {\n return in_serializedObj;\n } else {\n return {};\n }\n } else {\n if (!in_serializedObj.insert ||\n !in_serializedObj.insert[0]) {\n // we've got an empty object, so we have to wipe everything we've got\n if (oldStringLength > 0) {\n this.removeRange(0, oldStringLength, in_reportToView);\n return {\n remove: [[0, oldStringLength]]\n };\n } else {\n // the string was already empty, nothing has changed\n return {};\n }\n } else {\n newStringData = in_serializedObj.insert[0][1];\n }\n }\n\n if (newStringData === this._dataArrayRef) {\n // nothing changed\n return {};\n }\n\n // check if something was attached (very common case)\n if (newStringData.length > oldStringLength) {\n if (newStringData.substring(0, oldStringLength) === this._dataArrayRef) {\n var appendChanges = {\n insert: [[oldStringLength, newStringData.substring(oldStringLength)]]\n };\n this.insertRange(oldStringLength, newStringData.substring(oldStringLength), in_reportToView);\n return appendChanges;\n }\n }\n\n // most simplistic diff method: Remove all existing data and insert the new data\n var simpleChanges = {\n insert: [[0, newStringData]]\n };\n if (oldStringLength > 0) {\n simpleChanges.remove = [[0, oldStringLength]];\n this._removeRangeWithoutDirtying(0, oldStringLength, in_reportToView);\n }\n this.insertRange(0, newStringData, in_reportToView);\n return simpleChanges;\n };\n\n /**\n * Serialize the property\n *\n * @param {boolean} in_dirtyOnly -\n * Only include dirty entries in the serialization\n * @param {boolean} in_includeRootTypeid -\n * Include the typeid of the root of the hierarchy - has no effect for ArrayProperty\n * @param {property-properties.BaseProperty.MODIFIED_STATE_FLAGS} [in_dirtinessType] -\n * The type of dirtiness to use when reporting dirty changes. By default this is\n * PENDING_CHANGE\n * @param {boolean} [in_includeReferencedRepositories=false] - If this is set to true, the serialize\n * function will descend into referenced repositories. WARNING: if there are loops in the references\n * this can result in an infinite loop\n *\n * @return {Object} The serialized representation of this property\n * @private\n */\n _serialize(in_dirtyOnly, in_includeRootTypeid,\n in_dirtinessType, in_includeReferencedRepositories) {\n if (in_dirtyOnly) {\n return ArrayProperty.prototype._serialize.call(this, in_dirtyOnly, in_includeRootTypeid, in_dirtinessType);\n } else {\n // returns just the current data\n return this._dataArrayRef;\n }\n };\n\n /**\n * @param {string} in_value the new value\n * @throws if string property is read only\n */\n setValue(in_value) {\n this._checkIsNotReadOnly(true);\n this._setValue(in_value, true);\n };\n\n /**\n * @param {string} in_values the new values\n * @param {Bool} in_initial - Whether we are setting default/initial values\n * or if the function is called directly with the values to set.\n * @see {setValues}\n */\n _setValues(in_values, in_initial) {\n throw new Error(MSG.NO_VALUE_PROPERTY_SETVALUES);\n };\n\n /**\n * @param {string} in_values the new values\n * @throws always - cannot use .setValues on a StringProperty. Use .setValue() instead.\n */\n setValues(in_values) {\n StringProperty.prototype._setValues.call(this, in_values, false);\n };\n\n /**\n * @throws always - cannot call .getValues on a string. Use .getValue() instead\n */\n getValues() {\n throw new Error(MSG.NO_VALUE_PROPERTY_GETVALUES);\n };\n\n\n /**\n * Internal function to update the value of a property\n *\n * @param {string} in_value the new value\n * @param {boolean} [in_reportToView = true] - By default, the dirtying will always be reported to the checkout view\n * and trigger a modified event there. When batching updates, this\n * can be prevented via this flag.\n * @return {boolean} true if the value was actually changed\n */\n _setValue(in_value, in_reportToView) {\n var oldValue = this._dataArrayRef;\n var castedValue = String(in_value);\n var changed = castedValue !== oldValue;\n if (changed) {\n\n var stringLength = this._dataArrayRef.length;\n if (stringLength > 0) {\n this._dataArrayRemoveRange(0, stringLength);\n }\n this._dataArrayInsertRange(0, castedValue);\n\n this._dirty = PENDING_AND_DIRTY_SET_TO_PROPERTY_VALUE;\n\n // The assignment in the line above already set this property to\n // dirty, so we only update the parent (instead of calling\n // setDirty on this property)\n if (this._parent) {\n this._parent._setDirty(in_reportToView, this);\n } else if (in_reportToView === true || in_reportToView === undefined) {\n this._reportDirtinessToView();\n }\n }\n return changed;\n };\n\n /**\n * Sets the pending and dirty changesets\n *\n * @param {property-properties.SerializedChangeSet|undefined|null} in_pending\n * The pending changeset. If null is passed, no change will be\n * applied. undefined indicates that the changes should be reset\n * @param {property-properties.SerializedChangeSet|undefined|null} in_dirty\n * The dirty changeset. If null is passed, no change will be\n * applied. undefined indicates that the changes should be reset\n */\n _setChanges(in_pending, in_dirty) {\n if ((this._dirty === PENDING_AND_DIRTY_SET_TO_PROPERTY_VALUE ||\n this._dirty === NO_DIRTY_AND_PENDING_SET_TO_PROPERTY_VALUE) &&\n in_pending === null && in_dirty === undefined) {\n this._dirty = NO_DIRTY_AND_PENDING_SET_TO_PROPERTY_VALUE;\n } else {\n ArrayProperty.prototype._setChanges.call(this, in_pending, in_dirty);\n }\n };\n\n /**\n * Sets the dirty flags for this property\n * @param {Number} in_flags The dirty flags\n */\n _setDirtyFlags(in_flags) {\n if (this._dirty === PENDING_AND_DIRTY_SET_TO_PROPERTY_VALUE ||\n this._dirty === NO_DIRTY_AND_PENDING_SET_TO_PROPERTY_VALUE) {\n this._dirty = STRING_PROPERTY_SET_PROPERTY_VALUE_STATE_FLAGS[in_flags];\n return;\n }\n\n ArrayProperty.prototype._setDirtyFlags.call(this, in_flags);\n };\n\n /**\n * Gets the dirty flags for this property\n * @return {Number} The dirty flags\n */\n _getDirtyFlags() {\n if (this._dirty === PENDING_AND_DIRTY_SET_TO_PROPERTY_VALUE ||\n this._dirty === NO_DIRTY_AND_PENDING_SET_TO_PROPERTY_VALUE) {\n return this._dirty.flags;\n }\n\n return ArrayProperty.prototype._getDirtyFlags.call(this);\n };\n\n /**\n * @inheritdoc\n */\n _applyChangeset(in_changeSet, in_reportToView) {\n // It is unfortunate, but because StringProperty derives from ArrayProperty, it can happen\n // that we receive here a ChangeSet that is formatted for an Array. We must be able to\n // distinguish it from a reversible changeset and from a simple changeset...\n // TODO: We need a formal way to know what kind of content we are to expect in a ChangeSet,\n // we should never have to guess that.\n if (typeof in_changeSet === 'string') {\n // Let's consider it's a simple changeset.\n this._setValue(in_changeSet, in_reportToView);\n } else if (in_changeSet.value !== undefined) {\n // Let's consider it's a reversible changeset.\n this._setValue(in_changeSet.value, in_reportToView);\n } else {\n // Let's consider it's an ArrayProperty-like changeset\n ArrayProperty.prototype._applyChangeset.call(this, in_changeSet, in_reportToView);\n }\n };\n\n /**\n * Calls back the given function with a human-readable string\n * representation of the property.\n * @param {string} indent - Leading spaces to create the tree representation\n * @param {string} externalId - Name of the current property at the upper level.\n * Used for arrays.\n * @param {function} printFct - Function to call for printing each property\n */\n _prettyPrint(indent, externalId, printFct) {\n printFct(indent + externalId + this.getId() + ' (' + this.getTypeid() + '): \"' + this.value + '\"');\n };\n\n /**\n * Return a JSON representation of the property.\n * @return {object} A JSON representation of the property.\n * @private\n */\n _toJson() {\n return {\n id: this.getId(),\n context: this._context,\n typeid: this.getTypeid(),\n isConstant: this._isConstant,\n value: this.value\n };\n };\n\n /**\n * Sets the value of a character at a single index.\n * For example, if you have a string of value 'AAAA' and do .set(1, 'a') => 'AaAA'\n * @param {number} in_index the index you wish to set\n * @param {string} in_character the character you wish to set\n * @throws if length of in_character is longer than one character\n */\n set(in_index, in_character) {\n ConsoleUtils.assert(_.isNumber(in_index), MSG.STRING_SET_NEEDS_INDEX + in_index);\n\n if (in_character.length !== 1) {\n throw new Error(MSG.STRING_SET_ONE_CHAR);\n }\n\n this.setRange(in_index, in_character);\n };\n\n /**\n * sets values in a string starting at an index.\n * For example, if you have a string of Value 'AAAA' and do .setRange(1, 'aa') => AaaA\n * It will set as many letters as are in in_string.\n * @param {number} in_index the index at which you wish to start setting\n * @param {string} in_string the string you wish to set\n * @throws if in_index + length of in_string is longer than the original string\n */\n setRange(in_index, in_string) {\n ArrayProperty.prototype.setRange.call(this, in_index, in_string);\n };\n\n /**\n * get a letter at a given index\n * @param {number} in_index the index\n * @return {string} the single letter found at in_index\n */\n get(in_index) {\n return ArrayProperty.prototype.get.call(this, in_index);\n };\n\n /**\n * inserts a string starting at a position and shifts the rest of the String to the right.\n * Will not overwrite existing values.\n * For StringProperty, insert and insertRange work the same, except that .insert\n * checks that in_value is a string and .insertRange will accept an array of strings.\n * @param {number} in_position target index\n * @param {string | array<string>} in_value value to be inserted\n * @throws if in_position is smaller than zero, larger than the length of the string or not a number\n */\n insertRange(in_position, in_value) {\n if (_.isArray(in_value)) {\n in_value = in_value.join('');\n }\n this._insertRange(in_position, in_value);\n };\n\n /**\n * Creates and initializes the data array\n * @param {Number} in_length the initial length of the array\n */\n _dataArrayCreate(in_length) {\n this._dataArrayRef = '';\n };\n\n /**\n * Returns the length of the data array\n * @return {Number} The length\n */\n _dataArrayGetLength() {\n return this._dataArrayRef.length;\n };\n\n /**\n * Returns the data array's internal buffer\n * @return {Array} The buffer\n */\n _dataArrayGetBuffer() {\n return this._dataArrayRef;\n };\n\n /**\n * Returns an entry from the data array\n * @param {Number} in_i - Position in the array\n *\n * @return {*} The value at index in_i\n */\n _dataArrayGetValue(in_i) {\n in_i = in_i === undefined ? 0 : in_i;\n if (in_i >= this._size || in_i < 0) {\n throw new Error('Trying to access out of bounds!');\n }\n\n return this._dataArrayRef[in_i];\n };\n\n /**\n * Set the array to the given new array\n * @param {String} in_newString - The new contents of the array\n */\n _dataArrayDeserialize(in_newString) {\n this._dataArrayRef = in_newString;\n };\n\n /**\n * Inserts a range into the data array\n * @param {Number} in_position - Position at which the insert should be done\n * @param {String} in_range - The array to insert\n */\n _dataArrayInsertRange(in_position, in_range) {\n this._dataArrayRef = this._dataArrayRef.substr(0, in_position) + in_range + this._dataArrayRef.substr(in_position);\n };\n\n /**\n * Removes a range from the data array\n * @param {Number} in_position - Position at which to start the removal\n * @param {Number} in_length - The number of entries to remove\n */\n _dataArrayRemoveRange(in_position, in_length) {\n if (in_position + in_length < this._dataArrayRef.length + 1) {\n this._dataArrayRef = this._dataArrayRef.substr(0, in_position) +\n this._dataArrayRef.substr(in_position + in_length);\n } else {\n throw Error('DataArray removeRange in_offset + in_deleteCount is out of bounds.');\n }\n };\n\n /**\n * Overwrites a range in the data array\n * @param {Number} in_position - Position at which to start the removal\n * @param {String} in_values - The string with which the range is overwritten\n */\n _dataArraySetRange(in_position, in_values) {\n this._dataArrayRef = this._dataArrayRef.substr(0, in_position) + in_values +\n this._dataArrayRef.substr(in_position + in_values.length);\n };\n\n\n get value() {\n return this.getValue();\n }\n\n set value(val) {\n this.setValue.call(this, val);\n }\n\n /** @inheritdoc */\n _traverse(in_callback, in_pathFromTraversalStart) {\n return undefined;\n }\n\n /** @inheritdoc */\n _traverseStaticProperties(in_callback, in_pathFromTraversalStart) {\n return undefined;\n }\n}\n\nStringProperty.prototype._typeid = 'String';\nStringProperty.prototype._context = 'single';\nStringProperty.prototype._noDirtyInBase = true;\n"]}
1
+ {"version":3,"file":"stringProperty.js","sourceRoot":"","sources":["../../src/properties/stringProperty.js"],"names":[],"mappings":"AAAA;;;GAGG;AACH;;GAEG;AAEH,MAAM,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AAC5B,MAAM,EAAE,kBAAkB,EAAE,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAC;AAC/D,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AACrD,MAAM,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,qCAAqC,CAAC,CAAC,SAAS,CAAC;AACzE,MAAM,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC,wCAAwC,CAAC,CAAC;AACxE,MAAM,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a,CAAC,MAAM,GAAG,CAAC,EAAE;YACzD,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,EAAE,WAAW,CAAC;gBAC1D,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,WAAW,GAAG,SAAS,CAAC,CAAC;SAC1D;aAAM;YACH,MAAM,KAAK,CAAC,oEAAoE,CAAC,CAAC;SACrF;IACL,CAAC;IAAA,CAAC;IAEF;;;;OAIG;IACH,kBAAkB,CAAC,WAAW,EAAE,SAAS;QACrC,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,EAAE,WAAW,CAAC,GAAG,SAAS;YACtE,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,WAAW,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;IAClE,CAAC;IAAA,CAAC;IAGF,IAAI,KAAK;QACL,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC;IAC3B,CAAC;IAED,IAAI,KAAK,CAAC,GAAG;QACT,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IAClC,CAAC;IAED,kBAAkB;IAClB,SAAS,CAAC,WAAW,EAAE,yBAAyB;QAC5C,OAAO,SAAS,CAAC;IACrB,CAAC;IAED,kBAAkB;IAClB,yBAAyB,CAAC,WAAW,EAAE,yBAAyB;QAC5D,OAAO,SAAS,CAAC;IACrB,CAAC;CACJ;AAED,cAAc,CAAC,SAAS,CAAC,OAAO,GAAG,QAAQ,CAAC;AAC5C,cAAc,CAAC,SAAS,CAAC,QAAQ,GAAG,QAAQ,CAAC;AAC7C,cAAc,CAAC,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n/**\n * @fileoverview Definition of the StringProperty class\n */\n\nconst _ = require('lodash');\nconst { ValueArrayProperty } = require('./valueArrayProperty');\nconst { ArrayProperty } = require('./arrayProperty');\nconst { MSG } = require('@fluid-experimental/property-common').constants;\nconst { ChangeSet } = require('@fluid-experimental/property-changeset');\nconst { ConsoleUtils } = require('@fluid-experimental/property-common');\nconst { BaseProperty } = require('./baseProperty');\n\nvar MODIFIED_STATE_FLAGS = BaseProperty.MODIFIED_STATE_FLAGS;\n\n// Some global constant objects that are used to indicate a few special\n// cases for the dirty object. If the string was directly set to a literal,\n// we don't need to store any ChangeSet, we only need to store the information\n// that it was updated to a literal and the dirty flags.\n// By using these special objects we avoid the memory overhead of having a separate\n// object for each array in this state.\nvar PENDING_AND_DIRTY_SET_TO_PROPERTY_VALUE = {\n pending: 'setAsLiteral',\n dirty: 'setAsLiteral',\n flags: MODIFIED_STATE_FLAGS.PENDING_CHANGE | MODIFIED_STATE_FLAGS.DIRTY\n};\nvar NO_DIRTY_AND_PENDING_SET_TO_PROPERTY_VALUE = {\n pending: 'setAsLiteral',\n dirty: undefined,\n flags: MODIFIED_STATE_FLAGS.PENDING_CHANGE\n};\n\nvar DIRTY_AND_NO_PENDING_SET_TO_PROPERTY_VALUE = {\n pending: undefined,\n dirty: 'setAsLiteral',\n _flags: MODIFIED_STATE_FLAGS.DIRTY,\n set flags(flags) {\n this._flags = flags;\n console.log('flags was changed!');\n },\n get flags() {\n return this._flags;\n }\n};\n\nvar STRING_PROPERTY_SET_PROPERTY_VALUE_STATE_FLAGS = [\n undefined,\n NO_DIRTY_AND_PENDING_SET_TO_PROPERTY_VALUE,\n DIRTY_AND_NO_PENDING_SET_TO_PROPERTY_VALUE,\n PENDING_AND_DIRTY_SET_TO_PROPERTY_VALUE\n];\n\n/**\n * A primitive property for a string value.\n */\nexport class StringProperty extends ValueArrayProperty {\n /**\n * @param {Object=} in_params - the parameters\n * @constructor\n * @protected\n * @extends property-properties.ValueArrayProperty\n * @alias property-properties.StringProperty\n * @category Arrays\n */\n constructor(in_params) {\n super(in_params);\n };\n\n /**\n * Get the string value\n * @return {string} the JavaScript string primitive value of this StringProperty\n */\n getValue() {\n return this._dataArrayRef;\n };\n\n /**\n * Private helper function to update the internal dirty and pending changes\n *\n * @param {property-properties.SerializedChangeSet} in_changeSet - The changeset to apply\n * @private\n */\n _updateChanges(in_changeSet) {\n // we need to convert the format to allow the application of the changes\n // since _performApplyAfterOnPropertyArray only understands insert/modify/remove commands\n var pendingChangesWereSetBefore = false;\n var pendingChanges = this._getPendingChanges();\n\n if (_.isString(pendingChanges)) {\n pendingChanges = { insert: [[0, pendingChanges]] };\n pendingChangesWereSetBefore = true;\n }\n ChangeSet.prototype._performApplyAfterOnPropertyArray(pendingChanges,\n in_changeSet, this.getFullTypeid(true));\n if (pendingChangesWereSetBefore) {\n pendingChanges = pendingChanges.insert[0][1];\n }\n\n var dirtyChangesWereSetBefore = false;\n var dirtyChanges = this._getDirtyChanges();\n\n if (_.isString(dirtyChanges)) {\n dirtyChanges = { insert: [[0, dirtyChanges]] };\n dirtyChangesWereSetBefore = true;\n }\n ChangeSet.prototype._performApplyAfterOnPropertyArray(dirtyChanges,\n in_changeSet, this.getFullTypeid(true));\n if (dirtyChangesWereSetBefore) {\n dirtyChanges = dirtyChanges.insert[0][1];\n }\n\n this._setChanges(pendingChanges, dirtyChanges);\n };\n\n _getPendingChanges() {\n if (this._dirty === PENDING_AND_DIRTY_SET_TO_PROPERTY_VALUE ||\n this._dirty === NO_DIRTY_AND_PENDING_SET_TO_PROPERTY_VALUE) {\n return this.getValue();\n }\n\n return (this._dirty && this._dirty.pending) || {};\n };\n\n _getDirtyChanges() {\n if (this._dirty === PENDING_AND_DIRTY_SET_TO_PROPERTY_VALUE ||\n this._dirty === DIRTY_AND_NO_PENDING_SET_TO_PROPERTY_VALUE) {\n return this.getValue();\n } else if (this._dirty === NO_DIRTY_AND_PENDING_SET_TO_PROPERTY_VALUE) {\n return {};\n }\n\n return (this._dirty && this._dirty.dirty) || {};\n };\n\n /**\n * inserts a string starting at a position and shifts the rest of\n * the String to the right. Will not overwrite existing values.\n * @param {number} in_position target index\n * @param {string} in_value value to be inserted\n * @throws if in_position is smaller than zero, larger than the length of the string or not a number\n * @throws if in_value is not a string\n */\n insert(in_position, in_value) {\n ConsoleUtils.assert(_.isString(in_value), MSG.IN_VALUE_MUST_BE_STRING + in_value);\n this._insertRange(in_position, in_value);\n };\n\n /**\n * Adds letters to the end of the string\n * @param {string} in_value the string to be pushed\n * @throws if in_value is not a string\n * @return {number} the new length of the string.\n */\n push(in_value) {\n ConsoleUtils.assert(_.isString(in_value), MSG.IN_VALUE_MUST_BE_STRING + in_value);\n this._insertRange(this._dataArrayRef.length, in_value);\n return this.getLength();\n };\n\n\n /**\n * inserts values\n * @param {number} in_position target index\n * @param {string} in_value the string to be inserted\n */\n _insertRange(in_position, in_value) {\n this._checkIsNotReadOnly(true);\n this._insertRangeWithoutDirtying(in_position, in_value);\n this._setDirty();\n };\n\n /**\n * Returns the full property type identifier for the ChangeSet including the enum type id\n * @param {boolean} [in_hideCollection=false] - if true the collection type (if applicable) will be omitted\n * since that is not aplicable here, this param is ignored\n * @return {string} The typeid\n */\n getFullTypeid(in_hideCollection) {\n return this._typeid;\n };\n\n /**\n * returns the String to an empty string.\n */\n clear() {\n this.setValue('');\n };\n\n /**\n * removes a given number of elements from the array property and shifts\n * remaining values to the left.\n * @param {number} in_offset target start index\n * @param {number} in_deleteCount number of elements to be deleted\n * @throws if in_offset is not a number\n * @throws if in_deleteCount is not a number\n * @throws if trying to remove an item with a parent\n * @throws if in_offset is smaller than zero or if in_offset + in_delete count is larger than the length of the array\n * @return {String} the part of the string that was removed.\n */\n removeRange(in_offset, in_deleteCount) {\n ConsoleUtils.assert(_.isNumber(in_offset),\n MSG.NOT_NUMBER + 'in_offset, method: StringProperty.remove or .removeRange');\n ConsoleUtils.assert(_.isNumber(in_deleteCount),\n MSG.NOT_NUMBER + 'in_deleteCount, method: StringProperty.remove or .removeRange');\n ConsoleUtils.assert(in_offset + in_deleteCount < this.length + 1 && in_offset >= 0 && in_deleteCount > 0,\n MSG.REMOVE_OUT_OF_BOUNDS + 'Cannot remove ' + in_deleteCount + ' items starting at index ' + in_offset);\n var result = '';\n for (var i = in_offset; i < in_offset + in_deleteCount; i++) {\n result += this.get(i);\n }\n this._checkIsNotReadOnly(true);\n this._removeRangeWithoutDirtying(in_offset, in_deleteCount);\n this._setDirty();\n return result;\n };\n\n\n /**\n * @inheritdoc\n */\n _deserialize(in_serializedObj, in_reportToView,\n in_filteringOptions, in_createChangeSet) {\n if ((in_serializedObj.remove && in_serializedObj.remove.length > 0) ||\n (in_serializedObj.modify && in_serializedObj.modify.length > 0) ||\n (in_serializedObj.insert &&\n (in_serializedObj.insert.length > 1 ||\n (in_serializedObj.insert.length === 1 &&\n (in_serializedObj.insert[0][0] !== 0 ||\n !_.isString(in_serializedObj.insert[0][1])))))) {\n throw new Error(MSG.NO_NORMALIZED_CHANGESET);\n }\n\n var oldStringLength = this._dataArrayRef.length;\n var newStringData;\n if (_.isString(in_serializedObj)) {\n if (this._setValue(in_serializedObj, in_reportToView)) {\n return in_serializedObj;\n } else {\n return {};\n }\n } else {\n if (!in_serializedObj.insert ||\n !in_serializedObj.insert[0]) {\n // we've got an empty object, so we have to wipe everything we've got\n if (oldStringLength > 0) {\n this.removeRange(0, oldStringLength, in_reportToView);\n return {\n remove: [[0, oldStringLength]]\n };\n } else {\n // the string was already empty, nothing has changed\n return {};\n }\n } else {\n newStringData = in_serializedObj.insert[0][1];\n }\n }\n\n if (newStringData === this._dataArrayRef) {\n // nothing changed\n return {};\n }\n\n // check if something was attached (very common case)\n if (newStringData.length > oldStringLength) {\n if (newStringData.substring(0, oldStringLength) === this._dataArrayRef) {\n var appendChanges = {\n insert: [[oldStringLength, newStringData.substring(oldStringLength)]]\n };\n this.insertRange(oldStringLength, newStringData.substring(oldStringLength), in_reportToView);\n return appendChanges;\n }\n }\n\n // most simplistic diff method: Remove all existing data and insert the new data\n var simpleChanges = {\n insert: [[0, newStringData]]\n };\n if (oldStringLength > 0) {\n simpleChanges.remove = [[0, oldStringLength]];\n this._removeRangeWithoutDirtying(0, oldStringLength, in_reportToView);\n }\n this.insertRange(0, newStringData, in_reportToView);\n return simpleChanges;\n };\n\n /**\n * Serialize the property\n *\n * @param {boolean} in_dirtyOnly -\n * Only include dirty entries in the serialization\n * @param {boolean} in_includeRootTypeid -\n * Include the typeid of the root of the hierarchy - has no effect for ArrayProperty\n * @param {property-properties.BaseProperty.MODIFIED_STATE_FLAGS} [in_dirtinessType] -\n * The type of dirtiness to use when reporting dirty changes. By default this is\n * PENDING_CHANGE\n * @param {boolean} [in_includeReferencedRepositories=false] - If this is set to true, the serialize\n * function will descend into referenced repositories. WARNING: if there are loops in the references\n * this can result in an infinite loop\n *\n * @return {Object} The serialized representation of this property\n * @private\n */\n _serialize(in_dirtyOnly, in_includeRootTypeid,\n in_dirtinessType, in_includeReferencedRepositories) {\n if (in_dirtyOnly) {\n return ArrayProperty.prototype._serialize.call(this, in_dirtyOnly, in_includeRootTypeid, in_dirtinessType);\n } else {\n // returns just the current data\n return this._dataArrayRef;\n }\n };\n\n /**\n * @param {string} in_value the new value\n * @throws if string property is read only\n */\n setValue(in_value) {\n this._checkIsNotReadOnly(true);\n this._setValue(in_value, true);\n };\n\n /**\n * @param {string} in_values the new values\n * @param {Bool} in_initial - Whether we are setting default/initial values\n * or if the function is called directly with the values to set.\n * @see {setValues}\n */\n _setValues(in_values, in_initial) {\n throw new Error(MSG.NO_VALUE_PROPERTY_SETVALUES);\n };\n\n /**\n * @param {string} in_values the new values\n * @throws always - cannot use .setValues on a StringProperty. Use .setValue() instead.\n */\n setValues(in_values) {\n StringProperty.prototype._setValues.call(this, in_values, false);\n };\n\n /**\n * @throws always - cannot call .getValues on a string. Use .getValue() instead\n */\n getValues() {\n throw new Error(MSG.NO_VALUE_PROPERTY_GETVALUES);\n };\n\n\n /**\n * Internal function to update the value of a property\n *\n * @param {string} in_value the new value\n * @param {boolean} [in_reportToView = true] - By default, the dirtying will always be reported to the checkout view\n * and trigger a modified event there. When batching updates, this\n * can be prevented via this flag.\n * @return {boolean} true if the value was actually changed\n */\n _setValue(in_value, in_reportToView) {\n var oldValue = this._dataArrayRef;\n var castedValue = String(in_value);\n var changed = castedValue !== oldValue;\n if (changed) {\n\n var stringLength = this._dataArrayRef.length;\n if (stringLength > 0) {\n this._dataArrayRemoveRange(0, stringLength);\n }\n this._dataArrayInsertRange(0, castedValue);\n\n this._dirty = PENDING_AND_DIRTY_SET_TO_PROPERTY_VALUE;\n\n // The assignment in the line above already set this property to\n // dirty, so we only update the parent (instead of calling\n // setDirty on this property)\n if (this._parent) {\n this._parent._setDirty(in_reportToView, this);\n } else if (in_reportToView === true || in_reportToView === undefined) {\n this._reportDirtinessToView();\n }\n }\n return changed;\n };\n\n /**\n * Sets the pending and dirty changesets\n *\n * @param {property-properties.SerializedChangeSet|undefined|null} in_pending\n * The pending changeset. If null is passed, no change will be\n * applied. undefined indicates that the changes should be reset\n * @param {property-properties.SerializedChangeSet|undefined|null} in_dirty\n * The dirty changeset. If null is passed, no change will be\n * applied. undefined indicates that the changes should be reset\n */\n _setChanges(in_pending, in_dirty) {\n if (this._dirty === PENDING_AND_DIRTY_SET_TO_PROPERTY_VALUE ||\n this._dirty === NO_DIRTY_AND_PENDING_SET_TO_PROPERTY_VALUE ||\n this._dirty === DIRTY_AND_NO_PENDING_SET_TO_PROPERTY_VALUE) {\n let newFlags = this._dirty.flags;\n if (in_pending === undefined) {\n newFlags &= 0xFFFFFFFF ^ BaseProperty.MODIFIED_STATE_FLAGS.PENDING_CHANGE;\n }\n if (in_dirty === undefined) {\n newFlags &= 0xFFFFFFFF ^ BaseProperty.MODIFIED_STATE_FLAGS.DIRTY;\n }\n this._dirty = STRING_PROPERTY_SET_PROPERTY_VALUE_STATE_FLAGS[newFlags];\n } else {\n ArrayProperty.prototype._setChanges.call(this, in_pending, in_dirty);\n }\n };\n\n /**\n * Sets the dirty flags for this property\n * @param {Number} in_flags The dirty flags\n */\n _setDirtyFlags(in_flags) {\n if (this._dirty === PENDING_AND_DIRTY_SET_TO_PROPERTY_VALUE ||\n this._dirty === NO_DIRTY_AND_PENDING_SET_TO_PROPERTY_VALUE ||\n this._dirty === DIRTY_AND_NO_PENDING_SET_TO_PROPERTY_VALUE) {\n this._dirty = STRING_PROPERTY_SET_PROPERTY_VALUE_STATE_FLAGS[in_flags];\n return;\n }\n\n ArrayProperty.prototype._setDirtyFlags.call(this, in_flags);\n };\n\n /**\n * Gets the dirty flags for this property\n * @return {Number} The dirty flags\n */\n _getDirtyFlags() {\n if (this._dirty === PENDING_AND_DIRTY_SET_TO_PROPERTY_VALUE ||\n this._dirty === NO_DIRTY_AND_PENDING_SET_TO_PROPERTY_VALUE ||\n this._dirty === DIRTY_AND_NO_PENDING_SET_TO_PROPERTY_VALUE) {\n return this._dirty.flags;\n }\n\n return ArrayProperty.prototype._getDirtyFlags.call(this);\n };\n\n /**\n * @inheritdoc\n */\n _applyChangeset(in_changeSet, in_reportToView) {\n // It is unfortunate, but because StringProperty derives from ArrayProperty, it can happen\n // that we receive here a ChangeSet that is formatted for an Array. We must be able to\n // distinguish it from a reversible changeset and from a simple changeset...\n // TODO: We need a formal way to know what kind of content we are to expect in a ChangeSet,\n // we should never have to guess that.\n if (typeof in_changeSet === 'string') {\n // Let's consider it's a simple changeset.\n this._setValue(in_changeSet, in_reportToView);\n } else if (in_changeSet.value !== undefined) {\n // Let's consider it's a reversible changeset.\n this._setValue(in_changeSet.value, in_reportToView);\n } else {\n // Let's consider it's an ArrayProperty-like changeset\n ArrayProperty.prototype._applyChangeset.call(this, in_changeSet, in_reportToView);\n }\n };\n\n /**\n * Calls back the given function with a human-readable string\n * representation of the property.\n * @param {string} indent - Leading spaces to create the tree representation\n * @param {string} externalId - Name of the current property at the upper level.\n * Used for arrays.\n * @param {function} printFct - Function to call for printing each property\n */\n _prettyPrint(indent, externalId, printFct) {\n printFct(indent + externalId + this.getId() + ' (' + this.getTypeid() + '): \"' + this.value + '\"');\n };\n\n /**\n * Return a JSON representation of the property.\n * @return {object} A JSON representation of the property.\n * @private\n */\n _toJson() {\n return {\n id: this.getId(),\n context: this._context,\n typeid: this.getTypeid(),\n isConstant: this._isConstant,\n value: this.value\n };\n };\n\n /**\n * Sets the value of a character at a single index.\n * For example, if you have a string of value 'AAAA' and do .set(1, 'a') => 'AaAA'\n * @param {number} in_index the index you wish to set\n * @param {string} in_character the character you wish to set\n * @throws if length of in_character is longer than one character\n */\n set(in_index, in_character) {\n ConsoleUtils.assert(_.isNumber(in_index), MSG.STRING_SET_NEEDS_INDEX + in_index);\n\n if (in_character.length !== 1) {\n throw new Error(MSG.STRING_SET_ONE_CHAR);\n }\n\n this.setRange(in_index, in_character);\n };\n\n /**\n * sets values in a string starting at an index.\n * For example, if you have a string of Value 'AAAA' and do .setRange(1, 'aa') => AaaA\n * It will set as many letters as are in in_string.\n * @param {number} in_index the index at which you wish to start setting\n * @param {string} in_string the string you wish to set\n * @throws if in_index + length of in_string is longer than the original string\n */\n setRange(in_index, in_string) {\n ArrayProperty.prototype.setRange.call(this, in_index, in_string);\n };\n\n /**\n * get a letter at a given index\n * @param {number} in_index the index\n * @return {string} the single letter found at in_index\n */\n get(in_index) {\n return ArrayProperty.prototype.get.call(this, in_index);\n };\n\n /**\n * inserts a string starting at a position and shifts the rest of the String to the right.\n * Will not overwrite existing values.\n * For StringProperty, insert and insertRange work the same, except that .insert\n * checks that in_value is a string and .insertRange will accept an array of strings.\n * @param {number} in_position target index\n * @param {string | array<string>} in_value value to be inserted\n * @throws if in_position is smaller than zero, larger than the length of the string or not a number\n */\n insertRange(in_position, in_value) {\n if (_.isArray(in_value)) {\n in_value = in_value.join('');\n }\n this._insertRange(in_position, in_value);\n };\n\n /**\n * Creates and initializes the data array\n * @param {Number} in_length the initial length of the array\n */\n _dataArrayCreate(in_length) {\n this._dataArrayRef = '';\n };\n\n /**\n * Returns the length of the data array\n * @return {Number} The length\n */\n _dataArrayGetLength() {\n return this._dataArrayRef.length;\n };\n\n /**\n * Returns the data array's internal buffer\n * @return {Array} The buffer\n */\n _dataArrayGetBuffer() {\n return this._dataArrayRef;\n };\n\n /**\n * Returns an entry from the data array\n * @param {Number} in_i - Position in the array\n *\n * @return {*} The value at index in_i\n */\n _dataArrayGetValue(in_i) {\n in_i = in_i === undefined ? 0 : in_i;\n if (in_i >= this._size || in_i < 0) {\n throw new Error('Trying to access out of bounds!');\n }\n\n return this._dataArrayRef[in_i];\n };\n\n /**\n * Set the array to the given new array\n * @param {String} in_newString - The new contents of the array\n */\n _dataArrayDeserialize(in_newString) {\n this._dataArrayRef = in_newString;\n };\n\n /**\n * Inserts a range into the data array\n * @param {Number} in_position - Position at which the insert should be done\n * @param {String} in_range - The array to insert\n */\n _dataArrayInsertRange(in_position, in_range) {\n this._dataArrayRef = this._dataArrayRef.substr(0, in_position) + in_range + this._dataArrayRef.substr(in_position);\n };\n\n /**\n * Removes a range from the data array\n * @param {Number} in_position - Position at which to start the removal\n * @param {Number} in_length - The number of entries to remove\n */\n _dataArrayRemoveRange(in_position, in_length) {\n if (in_position + in_length < this._dataArrayRef.length + 1) {\n this._dataArrayRef = this._dataArrayRef.substr(0, in_position) +\n this._dataArrayRef.substr(in_position + in_length);\n } else {\n throw Error('DataArray removeRange in_offset + in_deleteCount is out of bounds.');\n }\n };\n\n /**\n * Overwrites a range in the data array\n * @param {Number} in_position - Position at which to start the removal\n * @param {String} in_values - The string with which the range is overwritten\n */\n _dataArraySetRange(in_position, in_values) {\n this._dataArrayRef = this._dataArrayRef.substr(0, in_position) + in_values +\n this._dataArrayRef.substr(in_position + in_values.length);\n };\n\n\n get value() {\n return this.getValue();\n }\n\n set value(val) {\n this.setValue.call(this, val);\n }\n\n /** @inheritdoc */\n _traverse(in_callback, in_pathFromTraversalStart) {\n return undefined;\n }\n\n /** @inheritdoc */\n _traverseStaticProperties(in_callback, in_pathFromTraversalStart) {\n return undefined;\n }\n}\n\nStringProperty.prototype._typeid = 'String';\nStringProperty.prototype._context = 'single';\nStringProperty.prototype._noDirtyInBase = true;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-experimental/property-properties",
3
- "version": "0.56.5",
3
+ "version": "0.57.0",
4
4
  "description": "definitions of properties",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": "https://github.com/microsoft/FluidFramework",
@@ -56,8 +56,8 @@
56
56
  "temp-directory": "nyc/.nyc_output"
57
57
  },
58
58
  "dependencies": {
59
- "@fluid-experimental/property-changeset": "^0.56.5",
60
- "@fluid-experimental/property-common": "^0.56.5",
59
+ "@fluid-experimental/property-changeset": "^0.57.0",
60
+ "@fluid-experimental/property-common": "^0.57.0",
61
61
  "ajv": "7.1.1",
62
62
  "async": "^3.2.0",
63
63
  "lodash": "^4.17.21",
@@ -66,7 +66,7 @@
66
66
  },
67
67
  "devDependencies": {
68
68
  "@fluidframework/build-common": "^0.23.0",
69
- "@fluidframework/mocha-test-setup": "^0.56.5",
69
+ "@fluidframework/mocha-test-setup": "^0.57.0",
70
70
  "chai": "^4.2.0",
71
71
  "concurrently": "^6.2.0",
72
72
  "cross-env": "^7.0.2",