mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
chore: udpate field notification
This commit is contained in:
parent
2fa6adeee6
commit
06af45a8ed
@ -254,6 +254,153 @@ class FieldOrder extends $pb.GeneratedMessage {
|
||||
void clearFieldId() => clearField(1);
|
||||
}
|
||||
|
||||
class GridFieldChangeset extends $pb.GeneratedMessage {
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'GridFieldChangeset', createEmptyInstance: create)
|
||||
..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'gridId')
|
||||
..pc<IndexField>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'insertedFields', $pb.PbFieldType.PM, subBuilder: IndexField.create)
|
||||
..pc<FieldOrder>(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'deletedFields', $pb.PbFieldType.PM, subBuilder: FieldOrder.create)
|
||||
..pc<Field>(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'updatedFields', $pb.PbFieldType.PM, subBuilder: Field.create)
|
||||
..hasRequiredFields = false
|
||||
;
|
||||
|
||||
GridFieldChangeset._() : super();
|
||||
factory GridFieldChangeset({
|
||||
$core.String? gridId,
|
||||
$core.Iterable<IndexField>? insertedFields,
|
||||
$core.Iterable<FieldOrder>? deletedFields,
|
||||
$core.Iterable<Field>? updatedFields,
|
||||
}) {
|
||||
final _result = create();
|
||||
if (gridId != null) {
|
||||
_result.gridId = gridId;
|
||||
}
|
||||
if (insertedFields != null) {
|
||||
_result.insertedFields.addAll(insertedFields);
|
||||
}
|
||||
if (deletedFields != null) {
|
||||
_result.deletedFields.addAll(deletedFields);
|
||||
}
|
||||
if (updatedFields != null) {
|
||||
_result.updatedFields.addAll(updatedFields);
|
||||
}
|
||||
return _result;
|
||||
}
|
||||
factory GridFieldChangeset.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
|
||||
factory GridFieldChangeset.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
|
||||
@$core.Deprecated(
|
||||
'Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
|
||||
'Will be removed in next major version')
|
||||
GridFieldChangeset clone() => GridFieldChangeset()..mergeFromMessage(this);
|
||||
@$core.Deprecated(
|
||||
'Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
|
||||
'Will be removed in next major version')
|
||||
GridFieldChangeset copyWith(void Function(GridFieldChangeset) updates) => super.copyWith((message) => updates(message as GridFieldChangeset)) as GridFieldChangeset; // ignore: deprecated_member_use
|
||||
$pb.BuilderInfo get info_ => _i;
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static GridFieldChangeset create() => GridFieldChangeset._();
|
||||
GridFieldChangeset createEmptyInstance() => create();
|
||||
static $pb.PbList<GridFieldChangeset> createRepeated() => $pb.PbList<GridFieldChangeset>();
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static GridFieldChangeset getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<GridFieldChangeset>(create);
|
||||
static GridFieldChangeset? _defaultInstance;
|
||||
|
||||
@$pb.TagNumber(1)
|
||||
$core.String get gridId => $_getSZ(0);
|
||||
@$pb.TagNumber(1)
|
||||
set gridId($core.String v) { $_setString(0, v); }
|
||||
@$pb.TagNumber(1)
|
||||
$core.bool hasGridId() => $_has(0);
|
||||
@$pb.TagNumber(1)
|
||||
void clearGridId() => clearField(1);
|
||||
|
||||
@$pb.TagNumber(2)
|
||||
$core.List<IndexField> get insertedFields => $_getList(1);
|
||||
|
||||
@$pb.TagNumber(3)
|
||||
$core.List<FieldOrder> get deletedFields => $_getList(2);
|
||||
|
||||
@$pb.TagNumber(4)
|
||||
$core.List<Field> get updatedFields => $_getList(3);
|
||||
}
|
||||
|
||||
enum IndexField_OneOfIndex {
|
||||
index_,
|
||||
notSet
|
||||
}
|
||||
|
||||
class IndexField extends $pb.GeneratedMessage {
|
||||
static const $core.Map<$core.int, IndexField_OneOfIndex> _IndexField_OneOfIndexByTag = {
|
||||
2 : IndexField_OneOfIndex.index_,
|
||||
0 : IndexField_OneOfIndex.notSet
|
||||
};
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'IndexField', createEmptyInstance: create)
|
||||
..oo(0, [2])
|
||||
..aOM<Field>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'field', subBuilder: Field.create)
|
||||
..a<$core.int>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'index', $pb.PbFieldType.O3)
|
||||
..hasRequiredFields = false
|
||||
;
|
||||
|
||||
IndexField._() : super();
|
||||
factory IndexField({
|
||||
Field? field_1,
|
||||
$core.int? index,
|
||||
}) {
|
||||
final _result = create();
|
||||
if (field_1 != null) {
|
||||
_result.field_1 = field_1;
|
||||
}
|
||||
if (index != null) {
|
||||
_result.index = index;
|
||||
}
|
||||
return _result;
|
||||
}
|
||||
factory IndexField.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
|
||||
factory IndexField.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
|
||||
@$core.Deprecated(
|
||||
'Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
|
||||
'Will be removed in next major version')
|
||||
IndexField clone() => IndexField()..mergeFromMessage(this);
|
||||
@$core.Deprecated(
|
||||
'Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
|
||||
'Will be removed in next major version')
|
||||
IndexField copyWith(void Function(IndexField) updates) => super.copyWith((message) => updates(message as IndexField)) as IndexField; // ignore: deprecated_member_use
|
||||
$pb.BuilderInfo get info_ => _i;
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static IndexField create() => IndexField._();
|
||||
IndexField createEmptyInstance() => create();
|
||||
static $pb.PbList<IndexField> createRepeated() => $pb.PbList<IndexField>();
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static IndexField getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<IndexField>(create);
|
||||
static IndexField? _defaultInstance;
|
||||
|
||||
IndexField_OneOfIndex whichOneOfIndex() => _IndexField_OneOfIndexByTag[$_whichOneof(0)]!;
|
||||
void clearOneOfIndex() => clearField($_whichOneof(0));
|
||||
|
||||
@$pb.TagNumber(1)
|
||||
Field get field_1 => $_getN(0);
|
||||
@$pb.TagNumber(1)
|
||||
set field_1(Field v) { setField(1, v); }
|
||||
@$pb.TagNumber(1)
|
||||
$core.bool hasField_1() => $_has(0);
|
||||
@$pb.TagNumber(1)
|
||||
void clearField_1() => clearField(1);
|
||||
@$pb.TagNumber(1)
|
||||
Field ensureField_1() => $_ensure(0);
|
||||
|
||||
@$pb.TagNumber(2)
|
||||
$core.int get index => $_getIZ(1);
|
||||
@$pb.TagNumber(2)
|
||||
set index($core.int v) { $_setSignedInt32(1, v); }
|
||||
@$pb.TagNumber(2)
|
||||
$core.bool hasIndex() => $_has(1);
|
||||
@$pb.TagNumber(2)
|
||||
void clearIndex() => clearField(2);
|
||||
}
|
||||
|
||||
enum GetEditFieldContextPayload_OneOfFieldId {
|
||||
fieldId,
|
||||
notSet
|
||||
@ -857,77 +1004,6 @@ class GridBlockOrder extends $pb.GeneratedMessage {
|
||||
$core.List<RowOrder> get rowOrders => $_getList(1);
|
||||
}
|
||||
|
||||
class GridRowsChangeset extends $pb.GeneratedMessage {
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'GridRowsChangeset', createEmptyInstance: create)
|
||||
..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'blockId')
|
||||
..pc<IndexRowOrder>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'insertedRows', $pb.PbFieldType.PM, subBuilder: IndexRowOrder.create)
|
||||
..pc<RowOrder>(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'deletedRows', $pb.PbFieldType.PM, subBuilder: RowOrder.create)
|
||||
..pc<RowOrder>(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'updatedRows', $pb.PbFieldType.PM, subBuilder: RowOrder.create)
|
||||
..hasRequiredFields = false
|
||||
;
|
||||
|
||||
GridRowsChangeset._() : super();
|
||||
factory GridRowsChangeset({
|
||||
$core.String? blockId,
|
||||
$core.Iterable<IndexRowOrder>? insertedRows,
|
||||
$core.Iterable<RowOrder>? deletedRows,
|
||||
$core.Iterable<RowOrder>? updatedRows,
|
||||
}) {
|
||||
final _result = create();
|
||||
if (blockId != null) {
|
||||
_result.blockId = blockId;
|
||||
}
|
||||
if (insertedRows != null) {
|
||||
_result.insertedRows.addAll(insertedRows);
|
||||
}
|
||||
if (deletedRows != null) {
|
||||
_result.deletedRows.addAll(deletedRows);
|
||||
}
|
||||
if (updatedRows != null) {
|
||||
_result.updatedRows.addAll(updatedRows);
|
||||
}
|
||||
return _result;
|
||||
}
|
||||
factory GridRowsChangeset.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
|
||||
factory GridRowsChangeset.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
|
||||
@$core.Deprecated(
|
||||
'Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
|
||||
'Will be removed in next major version')
|
||||
GridRowsChangeset clone() => GridRowsChangeset()..mergeFromMessage(this);
|
||||
@$core.Deprecated(
|
||||
'Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
|
||||
'Will be removed in next major version')
|
||||
GridRowsChangeset copyWith(void Function(GridRowsChangeset) updates) => super.copyWith((message) => updates(message as GridRowsChangeset)) as GridRowsChangeset; // ignore: deprecated_member_use
|
||||
$pb.BuilderInfo get info_ => _i;
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static GridRowsChangeset create() => GridRowsChangeset._();
|
||||
GridRowsChangeset createEmptyInstance() => create();
|
||||
static $pb.PbList<GridRowsChangeset> createRepeated() => $pb.PbList<GridRowsChangeset>();
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static GridRowsChangeset getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<GridRowsChangeset>(create);
|
||||
static GridRowsChangeset? _defaultInstance;
|
||||
|
||||
@$pb.TagNumber(1)
|
||||
$core.String get blockId => $_getSZ(0);
|
||||
@$pb.TagNumber(1)
|
||||
set blockId($core.String v) { $_setString(0, v); }
|
||||
@$pb.TagNumber(1)
|
||||
$core.bool hasBlockId() => $_has(0);
|
||||
@$pb.TagNumber(1)
|
||||
void clearBlockId() => clearField(1);
|
||||
|
||||
@$pb.TagNumber(2)
|
||||
$core.List<IndexRowOrder> get insertedRows => $_getList(1);
|
||||
|
||||
@$pb.TagNumber(3)
|
||||
$core.List<RowOrder> get deletedRows => $_getList(2);
|
||||
|
||||
@$pb.TagNumber(4)
|
||||
$core.List<RowOrder> get updatedRows => $_getList(3);
|
||||
}
|
||||
|
||||
enum IndexRowOrder_OneOfIndex {
|
||||
index_,
|
||||
notSet
|
||||
@ -1004,6 +1080,77 @@ class IndexRowOrder extends $pb.GeneratedMessage {
|
||||
void clearIndex() => clearField(2);
|
||||
}
|
||||
|
||||
class GridRowsChangeset extends $pb.GeneratedMessage {
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'GridRowsChangeset', createEmptyInstance: create)
|
||||
..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'blockId')
|
||||
..pc<IndexRowOrder>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'insertedRows', $pb.PbFieldType.PM, subBuilder: IndexRowOrder.create)
|
||||
..pc<RowOrder>(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'deletedRows', $pb.PbFieldType.PM, subBuilder: RowOrder.create)
|
||||
..pc<RowOrder>(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'updatedRows', $pb.PbFieldType.PM, subBuilder: RowOrder.create)
|
||||
..hasRequiredFields = false
|
||||
;
|
||||
|
||||
GridRowsChangeset._() : super();
|
||||
factory GridRowsChangeset({
|
||||
$core.String? blockId,
|
||||
$core.Iterable<IndexRowOrder>? insertedRows,
|
||||
$core.Iterable<RowOrder>? deletedRows,
|
||||
$core.Iterable<RowOrder>? updatedRows,
|
||||
}) {
|
||||
final _result = create();
|
||||
if (blockId != null) {
|
||||
_result.blockId = blockId;
|
||||
}
|
||||
if (insertedRows != null) {
|
||||
_result.insertedRows.addAll(insertedRows);
|
||||
}
|
||||
if (deletedRows != null) {
|
||||
_result.deletedRows.addAll(deletedRows);
|
||||
}
|
||||
if (updatedRows != null) {
|
||||
_result.updatedRows.addAll(updatedRows);
|
||||
}
|
||||
return _result;
|
||||
}
|
||||
factory GridRowsChangeset.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
|
||||
factory GridRowsChangeset.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
|
||||
@$core.Deprecated(
|
||||
'Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
|
||||
'Will be removed in next major version')
|
||||
GridRowsChangeset clone() => GridRowsChangeset()..mergeFromMessage(this);
|
||||
@$core.Deprecated(
|
||||
'Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
|
||||
'Will be removed in next major version')
|
||||
GridRowsChangeset copyWith(void Function(GridRowsChangeset) updates) => super.copyWith((message) => updates(message as GridRowsChangeset)) as GridRowsChangeset; // ignore: deprecated_member_use
|
||||
$pb.BuilderInfo get info_ => _i;
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static GridRowsChangeset create() => GridRowsChangeset._();
|
||||
GridRowsChangeset createEmptyInstance() => create();
|
||||
static $pb.PbList<GridRowsChangeset> createRepeated() => $pb.PbList<GridRowsChangeset>();
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static GridRowsChangeset getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<GridRowsChangeset>(create);
|
||||
static GridRowsChangeset? _defaultInstance;
|
||||
|
||||
@$pb.TagNumber(1)
|
||||
$core.String get blockId => $_getSZ(0);
|
||||
@$pb.TagNumber(1)
|
||||
set blockId($core.String v) { $_setString(0, v); }
|
||||
@$pb.TagNumber(1)
|
||||
$core.bool hasBlockId() => $_has(0);
|
||||
@$pb.TagNumber(1)
|
||||
void clearBlockId() => clearField(1);
|
||||
|
||||
@$pb.TagNumber(2)
|
||||
$core.List<IndexRowOrder> get insertedRows => $_getList(1);
|
||||
|
||||
@$pb.TagNumber(3)
|
||||
$core.List<RowOrder> get deletedRows => $_getList(2);
|
||||
|
||||
@$pb.TagNumber(4)
|
||||
$core.List<RowOrder> get updatedRows => $_getList(3);
|
||||
}
|
||||
|
||||
class GridBlock extends $pb.GeneratedMessage {
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'GridBlock', createEmptyInstance: create)
|
||||
..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'id')
|
||||
|
@ -72,6 +72,33 @@ const FieldOrder$json = const {
|
||||
|
||||
/// Descriptor for `FieldOrder`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List fieldOrderDescriptor = $convert.base64Decode('CgpGaWVsZE9yZGVyEhkKCGZpZWxkX2lkGAEgASgJUgdmaWVsZElk');
|
||||
@$core.Deprecated('Use gridFieldChangesetDescriptor instead')
|
||||
const GridFieldChangeset$json = const {
|
||||
'1': 'GridFieldChangeset',
|
||||
'2': const [
|
||||
const {'1': 'grid_id', '3': 1, '4': 1, '5': 9, '10': 'gridId'},
|
||||
const {'1': 'inserted_fields', '3': 2, '4': 3, '5': 11, '6': '.IndexField', '10': 'insertedFields'},
|
||||
const {'1': 'deleted_fields', '3': 3, '4': 3, '5': 11, '6': '.FieldOrder', '10': 'deletedFields'},
|
||||
const {'1': 'updated_fields', '3': 4, '4': 3, '5': 11, '6': '.Field', '10': 'updatedFields'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `GridFieldChangeset`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List gridFieldChangesetDescriptor = $convert.base64Decode('ChJHcmlkRmllbGRDaGFuZ2VzZXQSFwoHZ3JpZF9pZBgBIAEoCVIGZ3JpZElkEjQKD2luc2VydGVkX2ZpZWxkcxgCIAMoCzILLkluZGV4RmllbGRSDmluc2VydGVkRmllbGRzEjIKDmRlbGV0ZWRfZmllbGRzGAMgAygLMgsuRmllbGRPcmRlclINZGVsZXRlZEZpZWxkcxItCg51cGRhdGVkX2ZpZWxkcxgEIAMoCzIGLkZpZWxkUg11cGRhdGVkRmllbGRz');
|
||||
@$core.Deprecated('Use indexFieldDescriptor instead')
|
||||
const IndexField$json = const {
|
||||
'1': 'IndexField',
|
||||
'2': const [
|
||||
const {'1': 'field', '3': 1, '4': 1, '5': 11, '6': '.Field', '10': 'field'},
|
||||
const {'1': 'index', '3': 2, '4': 1, '5': 5, '9': 0, '10': 'index'},
|
||||
],
|
||||
'8': const [
|
||||
const {'1': 'one_of_index'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `IndexField`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List indexFieldDescriptor = $convert.base64Decode('CgpJbmRleEZpZWxkEhwKBWZpZWxkGAEgASgLMgYuRmllbGRSBWZpZWxkEhYKBWluZGV4GAIgASgFSABSBWluZGV4Qg4KDG9uZV9vZl9pbmRleA==');
|
||||
@$core.Deprecated('Use getEditFieldContextPayloadDescriptor instead')
|
||||
const GetEditFieldContextPayload$json = const {
|
||||
'1': 'GetEditFieldContextPayload',
|
||||
@ -197,19 +224,6 @@ const GridBlockOrder$json = const {
|
||||
|
||||
/// Descriptor for `GridBlockOrder`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List gridBlockOrderDescriptor = $convert.base64Decode('Cg5HcmlkQmxvY2tPcmRlchIZCghibG9ja19pZBgBIAEoCVIHYmxvY2tJZBIoCgpyb3dfb3JkZXJzGAIgAygLMgkuUm93T3JkZXJSCXJvd09yZGVycw==');
|
||||
@$core.Deprecated('Use gridRowsChangesetDescriptor instead')
|
||||
const GridRowsChangeset$json = const {
|
||||
'1': 'GridRowsChangeset',
|
||||
'2': const [
|
||||
const {'1': 'block_id', '3': 1, '4': 1, '5': 9, '10': 'blockId'},
|
||||
const {'1': 'inserted_rows', '3': 2, '4': 3, '5': 11, '6': '.IndexRowOrder', '10': 'insertedRows'},
|
||||
const {'1': 'deleted_rows', '3': 3, '4': 3, '5': 11, '6': '.RowOrder', '10': 'deletedRows'},
|
||||
const {'1': 'updated_rows', '3': 4, '4': 3, '5': 11, '6': '.RowOrder', '10': 'updatedRows'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `GridRowsChangeset`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List gridRowsChangesetDescriptor = $convert.base64Decode('ChFHcmlkUm93c0NoYW5nZXNldBIZCghibG9ja19pZBgBIAEoCVIHYmxvY2tJZBIzCg1pbnNlcnRlZF9yb3dzGAIgAygLMg4uSW5kZXhSb3dPcmRlclIMaW5zZXJ0ZWRSb3dzEiwKDGRlbGV0ZWRfcm93cxgDIAMoCzIJLlJvd09yZGVyUgtkZWxldGVkUm93cxIsCgx1cGRhdGVkX3Jvd3MYBCADKAsyCS5Sb3dPcmRlclILdXBkYXRlZFJvd3M=');
|
||||
@$core.Deprecated('Use indexRowOrderDescriptor instead')
|
||||
const IndexRowOrder$json = const {
|
||||
'1': 'IndexRowOrder',
|
||||
@ -224,6 +238,19 @@ const IndexRowOrder$json = const {
|
||||
|
||||
/// Descriptor for `IndexRowOrder`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List indexRowOrderDescriptor = $convert.base64Decode('Cg1JbmRleFJvd09yZGVyEiYKCXJvd19vcmRlchgBIAEoCzIJLlJvd09yZGVyUghyb3dPcmRlchIWCgVpbmRleBgCIAEoBUgAUgVpbmRleEIOCgxvbmVfb2ZfaW5kZXg=');
|
||||
@$core.Deprecated('Use gridRowsChangesetDescriptor instead')
|
||||
const GridRowsChangeset$json = const {
|
||||
'1': 'GridRowsChangeset',
|
||||
'2': const [
|
||||
const {'1': 'block_id', '3': 1, '4': 1, '5': 9, '10': 'blockId'},
|
||||
const {'1': 'inserted_rows', '3': 2, '4': 3, '5': 11, '6': '.IndexRowOrder', '10': 'insertedRows'},
|
||||
const {'1': 'deleted_rows', '3': 3, '4': 3, '5': 11, '6': '.RowOrder', '10': 'deletedRows'},
|
||||
const {'1': 'updated_rows', '3': 4, '4': 3, '5': 11, '6': '.RowOrder', '10': 'updatedRows'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `GridRowsChangeset`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List gridRowsChangesetDescriptor = $convert.base64Decode('ChFHcmlkUm93c0NoYW5nZXNldBIZCghibG9ja19pZBgBIAEoCVIHYmxvY2tJZBIzCg1pbnNlcnRlZF9yb3dzGAIgAygLMg4uSW5kZXhSb3dPcmRlclIMaW5zZXJ0ZWRSb3dzEiwKDGRlbGV0ZWRfcm93cxgDIAMoCzIJLlJvd09yZGVyUgtkZWxldGVkUm93cxIsCgx1cGRhdGVkX3Jvd3MYBCADKAsyCS5Sb3dPcmRlclILdXBkYXRlZFJvd3M=');
|
||||
@$core.Deprecated('Use gridBlockDescriptor instead')
|
||||
const GridBlock$json = const {
|
||||
'1': 'GridBlock',
|
||||
|
@ -76,7 +76,7 @@ impl GridBlockMetaEditorManager {
|
||||
index_row_order.index = row_index;
|
||||
|
||||
let _ = self
|
||||
.notify_did_update_grid_rows(GridRowsChangeset::insert(block_id, vec![index_row_order]))
|
||||
.notify_did_update_rows(GridRowsChangeset::insert(block_id, vec![index_row_order]))
|
||||
.await?;
|
||||
Ok(row_count)
|
||||
}
|
||||
@ -98,7 +98,7 @@ impl GridBlockMetaEditorManager {
|
||||
changesets.push(GridBlockMetaChangeset::from_row_count(&block_id, row_count));
|
||||
|
||||
let _ = self
|
||||
.notify_did_update_grid_rows(GridRowsChangeset::insert(&block_id, inserted_row_orders))
|
||||
.notify_did_update_rows(GridRowsChangeset::insert(&block_id, inserted_row_orders))
|
||||
.await?;
|
||||
}
|
||||
|
||||
@ -117,7 +117,7 @@ impl GridBlockMetaEditorManager {
|
||||
None => {}
|
||||
Some(row_order) => {
|
||||
let block_order_changeset = GridRowsChangeset::update(&editor.block_id, vec![row_order]);
|
||||
let _ = self.notify_did_update_grid_rows(block_order_changeset).await?;
|
||||
let _ = self.notify_did_update_rows(block_order_changeset).await?;
|
||||
}
|
||||
}
|
||||
|
||||
@ -131,7 +131,7 @@ impl GridBlockMetaEditorManager {
|
||||
let row_orders = editor.get_row_orders(Some(vec![Cow::Borrowed(&row_id)])).await?;
|
||||
let _ = editor.delete_rows(vec![Cow::Borrowed(&row_id)]).await?;
|
||||
let _ = self
|
||||
.notify_did_update_grid_rows(GridRowsChangeset::delete(&block_id, row_orders))
|
||||
.notify_did_update_rows(GridRowsChangeset::delete(&block_id, row_orders))
|
||||
.await?;
|
||||
|
||||
Ok(())
|
||||
@ -213,7 +213,7 @@ impl GridBlockMetaEditorManager {
|
||||
Ok(block_cell_metas)
|
||||
}
|
||||
|
||||
async fn notify_did_update_grid_rows(&self, changeset: GridRowsChangeset) -> FlowyResult<()> {
|
||||
async fn notify_did_update_rows(&self, changeset: GridRowsChangeset) -> FlowyResult<()> {
|
||||
send_dart_notification(&self.grid_id, GridNotification::DidUpdateGridBlock)
|
||||
.payload(changeset)
|
||||
.send();
|
||||
|
@ -151,7 +151,15 @@ impl ClientGridEditor {
|
||||
}
|
||||
|
||||
pub async fn duplicate_field(&self, field_id: &str) -> FlowyResult<()> {
|
||||
let _ = self.modify(|grid| Ok(grid.duplicate_field(field_id)?)).await?;
|
||||
let mut duplicated_field_meta = None;
|
||||
let _ = self
|
||||
.modify(|grid| {
|
||||
let (changeset, field_meta) = grid.duplicate_field(field_id)?;
|
||||
duplicated_field_meta = field_meta;
|
||||
Ok(changeset)
|
||||
})
|
||||
.await?;
|
||||
|
||||
let _ = self.notify_did_update_grid().await?;
|
||||
Ok(())
|
||||
}
|
||||
@ -386,10 +394,12 @@ impl ClientGridEditor {
|
||||
}
|
||||
|
||||
pub async fn move_field(&self, from: i32, to: i32, field_id: &str) -> FlowyResult<()> {
|
||||
// GridFieldChangeset
|
||||
todo!()
|
||||
}
|
||||
|
||||
pub async fn move_row(&self, from: i32, to: i32, row_id: &str) -> FlowyResult<()> {
|
||||
// GridRowsChangeset
|
||||
todo!()
|
||||
}
|
||||
|
||||
@ -436,6 +446,8 @@ impl ClientGridEditor {
|
||||
}
|
||||
|
||||
async fn notify_did_update_grid(&self) -> FlowyResult<()> {
|
||||
// GridFieldChangeset
|
||||
|
||||
let field_metas = self.get_field_metas::<FieldOrder>(None).await?;
|
||||
let repeated_field: RepeatedField = field_metas.into_iter().map(Field::from).collect::<Vec<_>>().into();
|
||||
send_dart_notification(&self.grid_id, GridNotification::DidUpdateGrid)
|
||||
@ -444,6 +456,13 @@ impl ClientGridEditor {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
async fn notify_did_update_grid2(&self, changeset: GridFieldChangeset) -> FlowyResult<()> {
|
||||
send_dart_notification(&self.grid_id, GridNotification::DidUpdateGrid)
|
||||
.payload(changeset)
|
||||
.send();
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "trace", skip_all, err)]
|
||||
async fn notify_did_update_field(&self, field_id: &str) -> FlowyResult<()> {
|
||||
let mut field_metas = self.get_field_metas(Some(vec![field_id])).await?;
|
||||
|
@ -84,6 +84,59 @@ impl std::convert::From<String> for FieldOrder {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Default, ProtoBuf)]
|
||||
pub struct GridFieldChangeset {
|
||||
#[pb(index = 1)]
|
||||
pub grid_id: String,
|
||||
|
||||
#[pb(index = 2)]
|
||||
pub inserted_fields: Vec<IndexField>,
|
||||
|
||||
#[pb(index = 3)]
|
||||
pub deleted_fields: Vec<FieldOrder>,
|
||||
|
||||
#[pb(index = 4)]
|
||||
pub updated_fields: Vec<Field>,
|
||||
}
|
||||
|
||||
impl GridFieldChangeset {
|
||||
pub fn insert(grid_id: &str, inserted_fields: Vec<IndexField>) -> Self {
|
||||
Self {
|
||||
grid_id: grid_id.to_owned(),
|
||||
inserted_fields,
|
||||
deleted_fields: vec![],
|
||||
updated_fields: vec![],
|
||||
}
|
||||
}
|
||||
|
||||
pub fn delete(grid_id: &str, deleted_fields: Vec<FieldOrder>) -> Self {
|
||||
Self {
|
||||
grid_id: grid_id.to_string(),
|
||||
inserted_fields: vec![],
|
||||
deleted_fields,
|
||||
updated_fields: vec![],
|
||||
}
|
||||
}
|
||||
|
||||
pub fn update(grid_id: &str, updated_fields: Vec<Field>) -> Self {
|
||||
Self {
|
||||
grid_id: grid_id.to_string(),
|
||||
inserted_fields: vec![],
|
||||
deleted_fields: vec![],
|
||||
updated_fields,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Default, ProtoBuf)]
|
||||
pub struct IndexField {
|
||||
#[pb(index = 1)]
|
||||
pub field: Field,
|
||||
|
||||
#[pb(index = 2, one_of)]
|
||||
pub index: Option<i32>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Default, ProtoBuf)]
|
||||
pub struct GetEditFieldContextPayload {
|
||||
#[pb(index = 1)]
|
||||
@ -277,6 +330,15 @@ impl GridBlockOrder {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Default, ProtoBuf)]
|
||||
pub struct IndexRowOrder {
|
||||
#[pb(index = 1)]
|
||||
pub row_order: RowOrder,
|
||||
|
||||
#[pb(index = 2, one_of)]
|
||||
pub index: Option<i32>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Default, ProtoBuf)]
|
||||
pub struct GridRowsChangeset {
|
||||
#[pb(index = 1)]
|
||||
@ -292,15 +354,6 @@ pub struct GridRowsChangeset {
|
||||
pub updated_rows: Vec<RowOrder>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Default, ProtoBuf)]
|
||||
pub struct IndexRowOrder {
|
||||
#[pb(index = 1)]
|
||||
pub row_order: RowOrder,
|
||||
|
||||
#[pb(index = 2, one_of)]
|
||||
pub index: Option<i32>,
|
||||
}
|
||||
|
||||
impl std::convert::From<RowOrder> for IndexRowOrder {
|
||||
fn from(row_order: RowOrder) -> Self {
|
||||
Self { row_order, index: None }
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -17,6 +17,16 @@ message Field {
|
||||
message FieldOrder {
|
||||
string field_id = 1;
|
||||
}
|
||||
message GridFieldChangeset {
|
||||
string grid_id = 1;
|
||||
repeated IndexField inserted_fields = 2;
|
||||
repeated FieldOrder deleted_fields = 3;
|
||||
repeated Field updated_fields = 4;
|
||||
}
|
||||
message IndexField {
|
||||
Field field = 1;
|
||||
oneof one_of_index { int32 index = 2; };
|
||||
}
|
||||
message GetEditFieldContextPayload {
|
||||
string grid_id = 1;
|
||||
oneof one_of_field_id { string field_id = 2; };
|
||||
@ -58,16 +68,16 @@ message GridBlockOrder {
|
||||
string block_id = 1;
|
||||
repeated RowOrder row_orders = 2;
|
||||
}
|
||||
message IndexRowOrder {
|
||||
RowOrder row_order = 1;
|
||||
oneof one_of_index { int32 index = 2; };
|
||||
}
|
||||
message GridRowsChangeset {
|
||||
string block_id = 1;
|
||||
repeated IndexRowOrder inserted_rows = 2;
|
||||
repeated RowOrder deleted_rows = 3;
|
||||
repeated RowOrder updated_rows = 4;
|
||||
}
|
||||
message IndexRowOrder {
|
||||
RowOrder row_order = 1;
|
||||
oneof one_of_index { int32 index = 2; };
|
||||
}
|
||||
message GridBlock {
|
||||
string id = 1;
|
||||
repeated RowOrder row_orders = 2;
|
||||
|
@ -82,19 +82,23 @@ impl GridMetaPad {
|
||||
)
|
||||
}
|
||||
|
||||
pub fn duplicate_field(&mut self, field_id: &str) -> CollaborateResult<Option<GridChangeset>> {
|
||||
self.modify_grid(
|
||||
|grid_meta| match grid_meta.fields.iter().position(|field| field.id == field_id) {
|
||||
None => Ok(None),
|
||||
Some(index) => {
|
||||
let mut duplicate_field_meta = grid_meta.fields[index].clone();
|
||||
duplicate_field_meta.id = gen_field_id();
|
||||
duplicate_field_meta.name = format!("{} (copy)", duplicate_field_meta.name);
|
||||
grid_meta.fields.insert(index + 1, duplicate_field_meta);
|
||||
Ok(Some(()))
|
||||
}
|
||||
},
|
||||
)
|
||||
pub fn duplicate_field(&mut self, field_id: &str) -> CollaborateResult<(Option<GridChangeset>, Option<FieldMeta>)> {
|
||||
let mut field_meta = None;
|
||||
let changeset =
|
||||
self.modify_grid(
|
||||
|grid_meta| match grid_meta.fields.iter().position(|field| field.id == field_id) {
|
||||
None => Ok(None),
|
||||
Some(index) => {
|
||||
let mut duplicate_field_meta = grid_meta.fields[index].clone();
|
||||
duplicate_field_meta.id = gen_field_id();
|
||||
duplicate_field_meta.name = format!("{} (copy)", duplicate_field_meta.name);
|
||||
field_meta = Some(duplicate_field_meta.clone());
|
||||
grid_meta.fields.insert(index + 1, duplicate_field_meta);
|
||||
Ok(Some(()))
|
||||
}
|
||||
},
|
||||
)?;
|
||||
Ok((changeset, field_meta))
|
||||
}
|
||||
|
||||
pub fn switch_to_field<B>(
|
||||
|
Loading…
Reference in New Issue
Block a user