@airtable/blocks 0.0.0-experimental-d5ee5e823-20250501 → 0.0.0-experimental-f1c9010b3-20250609

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md ADDED
@@ -0,0 +1,561 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). This project
6
+ started to follow semantic versioning as of version 1.0.0.
7
+
8
+ Not every commit needs to result in a change to this file (e.g. docs and chore commits). Every
9
+ commit that affects the code in a way that consumers might care about should include edits to the
10
+ 'Unreleased' section though. Breaking changes should be prefixed with `**BREAKING:**`.
11
+
12
+ ## [Unreleased](https://github.com/airtable/blocks/compare/@airtable/blocks@1.19.0...HEAD)
13
+
14
+ No changes.
15
+
16
+ ## [1.19.0](https://github.com/airtable/blocks/compare/@airtable/blocks@1.18.2...@airtable/blocks@1.19.0) - 2025-06-06
17
+
18
+ - Add `useColorScheme` React hook, making a user's light/dark mode preference available in
19
+ JavaScript. Airtable will also set
20
+ [`color-scheme`](https://developer.mozilla.org/en-US/docs/Web/CSS/color-scheme) on extension
21
+ iframes, so
22
+ [`prefers-color-scheme`](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme)
23
+ media queries will match the user's Airtable preferences before browser-wide settings.
24
+
25
+ ## [1.18.2](https://github.com/airtable/blocks/compare/@airtable/blocks@1.18.1...@airtable/blocks@1.18.2) - 2024-09-25
26
+
27
+ - Upgrade Typescript version to 5.4.5
28
+ - Perform routine version upgrade to various packages, including `react` and `eslint`
29
+
30
+ ## [1.18.1](https://github.com/airtable/blocks/compare/@airtable/blocks@1.18.0...@airtable/blocks@1.18.1) - 2023-11-29
31
+
32
+ - Support React 17 as a peer dependency.
33
+
34
+ ## [1.18.0](https://github.com/airtable/blocks/compare/@airtable/blocks@1.17.0...@airtable/blocks@1.18.0) - 2023-09-15
35
+
36
+ - Add `FieldType.AI_TEXT`.
37
+
38
+ ## [1.17.0](https://github.com/airtable/blocks/compare/@airtable/blocks@1.16.0...@airtable/blocks@1.17.0) - 2023-04-14
39
+
40
+ No changes.
41
+
42
+ ## [1.16.0](https://github.com/airtable/blocks/compare/@airtable/blocks@1.15.0...@airtable/blocks@1.16.0) - 2023-03-08
43
+
44
+ - Update `FieldType.DATE_TIME` documentation to add additional time zones and clarify the write
45
+ behavior.
46
+ - Visually refresh all icons
47
+
48
+ ## [1.15.0](https://github.com/airtable/blocks/compare/@airtable/blocks@1.14.0...@airtable/blocks@1.15.0) - 2022-09-23
49
+
50
+ - Add `applyRowTemplate` icon
51
+ - Update `FieldType.DATE_TIME` documentation to pre-announce write behavior for field level time
52
+ zones
53
+ - Modify `createRecordsAsync`, `updateRecordsAsync`, `convertStringToCellValue` so that date
54
+ string inputs to date time fields are interpreted correctly for utc or client time zone, fixing
55
+ previously incorrect behaviors. In this new version, ambiguous strings like
56
+ "2020-09-05T07:00:00" and "2020-09-08" will be interpreted according to the `timeZone` of the
57
+ field, and nonambiguous string inputs with zone offset like "2020-09-05T07:00:00.000Z" and
58
+ "2020-09-08T00:00:00-07:00" will be interpreted correctly as the underlying timestamp.
59
+
60
+ ## [1.14.0](https://github.com/airtable/blocks/compare/@airtable/blocks@1.13.0...@airtable/blocks@1.14.0) - 2022-07-26
61
+
62
+ - Add `personalCloseup` icon
63
+ - Add `xCheckbox` icon
64
+
65
+ ## [1.13.0](https://github.com/airtable/blocks/compare/@airtable/blocks@1.12.0...@airtable/blocks@1.13.0) - 2022-06-28
66
+
67
+ - Add ability to read (and watch) if a view is locked
68
+ - Update `FieldType.MULTIPLE_COLLABORATOR` documentation to include user group collaborator
69
+ information
70
+
71
+ ## [1.12.0](https://github.com/airtable/blocks/compare/@airtable/blocks@1.11.1...@airtable/blocks@1.12.0) - 2022-06-22
72
+
73
+ - Update fallback value in `Base.getMaxRecordsPerTable`
74
+ - Add `overlay` icon
75
+ - Update `cursor.setActiveTable` and `cursor.setActiveView` documentation to describe fullscreen
76
+ exit behavior correctly
77
+ - Fix an issue where rapidly subscribing and unsubscribing to a single field could cause a
78
+ queryResult to be to incorrectly marked as loaded.
79
+ - Update API reference documentation to reflect 'extensions' in place of 'apps'
80
+ - Update examples in documentation to reflect 'extensions' in place of 'apps'
81
+
82
+ ## [1.11.1](https://github.com/airtable/blocks/compare/@airtable/blocks@1.11.0...@airtable/blocks@1.11.1) - 2022-04-13
83
+
84
+ - Update internal utilities for error reporting
85
+
86
+ ## [1.11.0](https://github.com/airtable/blocks/compare/@airtable/blocks@1.10.2...@airtable/blocks@1.11.0) - 2022-03-10
87
+
88
+ - Add workspace id to base object.
89
+ - Add `Field.updateNameAsync`
90
+ - Fixes a crash when a linked record is deleted
91
+ - Fixes a crash when a record containing a linked record is deleted and restored
92
+
93
+ ## [1.10.2](https://github.com/airtable/blocks/compare/@airtable/blocks@1.10.1...@airtable/blocks@1.10.2) - 2022-01-25
94
+
95
+ - Rare invariant failure addressed
96
+
97
+ ## [1.10.1](https://github.com/airtable/blocks/compare/@airtable/blocks@1.10.0...@airtable/blocks@1.10.1) - 2021-12-22
98
+
99
+ - Update examples for table, view and field URLs.
100
+ - Use `keyof any` instead of `PropertyKey` in type definition to avoid incompatibility with the
101
+ "[keyofStringsOnly](https://www.typescriptlang.org/tsconfig#keyofStringsOnly)" tsconfig option
102
+
103
+ ## [1.10.0](https://github.com/airtable/blocks/compare/@airtable/blocks@1.9.0...@airtable/blocks@1.10.0) - 2021-11-03
104
+
105
+ - Fix typo in cursor.ts documentation - thanks @m2creates!
106
+ - Add new `calendarDay` icon (and micro variant)
107
+ - Update documentation to include attachment url guidance
108
+ - Update field metadata writes documentation to mention that `null` will be coerced to `''`
109
+ - Fix a bug when unloading data from a `linkedRecordQueryResult` after a table deletion
110
+ - Update `children` prop of `Link` component to be optional
111
+
112
+ ## [1.9.0](https://github.com/airtable/blocks/compare/@airtable/blocks@1.8.0...@airtable/blocks@1.9.0) - 2021-09-15
113
+
114
+ - Update documentation for `FieldType.CHECKBOX` cell read & write types to be more accurate.
115
+ - Fetching field types & configs is now cached, making it more performant.
116
+ - Field descriptions can now be edited and specified when creating a new field:
117
+ - Added `field.updateDescriptionAsync`.
118
+ - Added optional `description` argument to `table.createFieldAsync`.
119
+ - Added optional `description` property to `field` objects accepted by
120
+ `base.createTableAsync`.
121
+
122
+ ## [1.8.0](https://github.com/airtable/blocks/compare/@airtable/blocks@1.7.2...@airtable/blocks@1.8.0) - 2021-07-12
123
+
124
+ - Add `opts` argument to `Field.updateOptionsAsync` with `enableSelectFieldChoiceDeletion` opt.
125
+ - Add `prefersSingleRecordLink` to `field.options` for `MULTIPLE_RECORD_LINKS` type fields.
126
+ - Add new timeline icon (and micro variant).
127
+
128
+ ## [1.7.2](https://github.com/airtable/blocks/compare/@airtable/blocks@1.7.1...@airtable/blocks@1.7.2) - 2021-05-26
129
+
130
+ - Add `FieldType.EXTERNAL_SYNC_SOURCE`.
131
+
132
+ ## [1.7.1](https://github.com/airtable/blocks/compare/@airtable/blocks@1.7.0...@airtable/blocks@1.7.1) - 2021-05-21
133
+
134
+ No changes.
135
+
136
+ ## [1.7.0](https://github.com/airtable/blocks/compare/@airtable/blocks@1.6.0...@airtable/blocks@1.7.0) - 2021-05-13
137
+
138
+ - Add `onBlur` and `onFocus` support to `Input` and `InputSynced` UI components.
139
+
140
+ ## [1.6.0](https://github.com/airtable/blocks/compare/@airtable/blocks@1.5.1...@airtable/blocks@1.6.0) - 2021-05-12
141
+
142
+ - Add `color` property to `base` to access the background color of the base, as well as the
143
+ `color` watch key
144
+ - Update documentation text for `GlobalConfig` with increased 150kb limit.
145
+ - Add `getMaxRecordsPerTable` to `base`
146
+
147
+ ## [1.5.1](https://github.com/airtable/blocks/compare/@airtable/blocks@1.5.0...@airtable/blocks@1.5.1) - 2021-03-04
148
+
149
+ No changes.
150
+
151
+ ## [1.5.0](https://github.com/airtable/blocks/compare/@airtable/blocks@1.4.1...@airtable/blocks@1.5.0) - 2021-02-25
152
+
153
+ - Add type exports for `Cursor` & `Session` to `@airtable/blocks/models`.
154
+ - Add type exports for `GlobalConfig`, `Watchable`, & `Viewport` to `@airtable/blocks/types`.
155
+ - Add `boltList`, `boltListMicro`, `contacts`, `contactsMicro`, `megaphone`, `megaphoneMicro`,
156
+ `shareWithBolt` and `shareWithBoltMicro` icons.
157
+ - Increase spacing between `label` and `description` nodes in `FormField`.
158
+ - Support creating (but not updating) `MULTIPLE_RECORD_LINKS` fields using
159
+ `table.createFieldAsync`.
160
+ - Add `isCancelButtonDisabled` and `isConfirmButtonDisabled` props to `ConfirmationDialog`.
161
+ - Add `config` property to `Field`, which is a new `FieldConfig` discriminated union type that
162
+ provides easier access to field options.
163
+ - Improve type definitions for `getHexForColor` and `getRgbForColor`.
164
+
165
+ ## [1.4.1](https://github.com/airtable/blocks/compare/@airtable/blocks@1.4.0...@airtable/blocks@1.4.1) - 2021-01-21
166
+
167
+ No changes.
168
+
169
+ ## [1.4.0](https://github.com/airtable/blocks/compare/@airtable/blocks@1.3.0...@airtable/blocks@1.4.0) - 2021-01-19
170
+
171
+ - **DEPRECATED:** importing the Base's Cursor instance from the main entrypoint, e.g.
172
+ `import {cursor} from '@airtable/blocks';`. Use the `useCursor` React Hook instead.
173
+ - **DEPRECATED:** importing the Base's Session instance from the main entrypoint, e.g.
174
+ `import {session} from '@airtable/blocks';`. Use the `useSession` React Hook instead.
175
+
176
+ ## [1.3.0](https://github.com/airtable/blocks/compare/@airtable/blocks@1.2.5...@airtable/blocks@1.3.0) - 2021-01-07
177
+
178
+ - Fix crash when deleting views.
179
+ - Add BaseProvider to allow rendering Components outside of the App's React tree
180
+
181
+ ## [1.2.5](https://github.com/airtable/blocks/compare/@airtable/blocks@1.2.4...@airtable/blocks@1.2.5) - 2020-12-10
182
+
183
+ No changes.
184
+
185
+ ## [1.2.4](https://github.com/airtable/blocks/compare/@airtable/blocks@1.2.3...@airtable/blocks@1.2.4) - 2020-12-10
186
+
187
+ No changes.
188
+
189
+ ## [1.2.3](https://github.com/airtable/blocks/compare/@airtable/blocks@1.2.2...@airtable/blocks@1.2.3) - 2020-12-09
190
+
191
+ - Stopped exporting an internal class that was causing typescript checking to fail on version
192
+ 1.2.2
193
+
194
+ ## [1.2.2](https://github.com/airtable/blocks/compare/@airtable/blocks@1.2.1...@airtable/blocks@1.2.2) - 2020-12-08
195
+
196
+ - Fixed a bug in useRecordActionData that caused it to crash on version 1.2.1
197
+
198
+ ## [1.2.1](https://github.com/airtable/blocks/compare/@airtable/blocks@1.2.0...@airtable/blocks@1.2.1) - 2020-11-23
199
+
200
+ - Fixed a bug that prevented TableOrViewQueryResult from notifying watchers about the
201
+ creation/deletion of sorted fields.
202
+ - Fixed a bug where deleting and undeleting a table that was already loaded caused the App to
203
+ crash.
204
+ - **DEPRECATED:** importing the UI namespace from the main entrypoint, e.g.
205
+ `import {UI} from '@airtable/blocks';`. Use `import * as UI from '@airtable/blocks/ui/ui';`
206
+ instead.
207
+ - **DEPRECATED:** importing the models namespace from the main entrypoint, e.g.
208
+ `import {models} from '@airtable/blocks';`. Use
209
+ `import * as models from '@airtable/blocks/models/models';` instead.
210
+
211
+ ## [1.2.0](https://github.com/airtable/blocks/compare/@airtable/blocks@1.1.0...@airtable/blocks@1.2.0) - 2020-10-23
212
+
213
+ - Added `automations` and fixed the SVG path for `personalAuto` in `Icon`.
214
+ - Fixed a bug that caused an App to crash when creating a new table before the App has loaded.
215
+ - Fixed a bug in watching/unwatching keys of LinkedRecordQueryResult models. Watching/unwatching
216
+ `isDataLoaded` no longer affects the model's "loaded" state.
217
+ - Fixed a bug introduced in v1.0.0 in `RecordCard` when rendering a record that has a lookup field
218
+ of an attachment field.
219
+
220
+ ## [1.1.0](https://github.com/airtable/blocks/compare/@airtable/blocks@1.0.1...@airtable/blocks@1.1.0) - 2020-09-29
221
+
222
+ - **DEPRECATED:** "blocks" as an icon name. Use `<Icon name="apps" .../>` instead.
223
+ - Fixed bugs introduced in v1.0.0 that broke using lookup cell values with
224
+ `Record.getCellValueAsString`, `aggregator.aggregate` and `aggregator.aggregateToString`
225
+
226
+ ## [1.0.1](https://github.com/airtable/blocks/compare/@airtable/blocks@1.0.0...@airtable/blocks@1.0.1) - 2020-09-24
227
+
228
+ - Fixed bug where `Select`, `SelectButtons`, and `Synced` variants behaved incorrectly when there
229
+ were multiple items with the same value.
230
+ - Fix a bug using lookup cell values with `<CellRenderer />` introduced in v1.0.0
231
+
232
+ ## [1.0.0](https://github.com/airtable/blocks/compare/@airtable/blocks@0.0.55...@airtable/blocks@1.0.0) - 2020-09-14
233
+
234
+ - **BREAKING:** The cell value format for lookup fields (`FieldType.MULTIPLE_LOOKUP_VALUES`) is
235
+ now `Array<{linkedRecordId: RecordId, value: CellValue}>`
236
+ - **BREAKING:** Remove `Record.primaryCellValue` and `Record.primaryCellValueAsString`, as well as
237
+ the `primaryCellValue` watchable key on Record. These APIs were deprecated in v0.0.45
238
+ - **BREAKING:** Remove legacy record creation format. All calls to `Table.createRecordAsync` /
239
+ `Table.createRecordsAsync` must define record field mappings under a `fields` key. These APIs
240
+ were deprecated in v0.0.41.
241
+
242
+ ## [0.0.55](https://github.com/airtable/blocks/compare/@airtable/blocks@0.0.54...@airtable/blocks@0.0.55) - 2020-09-02
243
+
244
+ No changes.
245
+
246
+ ## [0.0.54](https://github.com/airtable/blocks/compare/@airtable/blocks@0.0.53...@airtable/blocks@0.0.54) - 2020-08-12
247
+
248
+ - Remove `unstable_` prefix from `Field.updateOptionsAsync`, `Table.createFieldAsync`, and
249
+ `Base.createTableAsync`. See
250
+ [Changing base schema](https://airtable.com/developers/blocks/guides/changing-base-schema) for
251
+ full details.
252
+
253
+ ## [0.0.53](https://github.com/airtable/blocks/compare/@airtable/blocks@0.0.52...@airtable/blocks@0.0.53) - 2020-06-24
254
+
255
+ - Fix a typo in the docs for `globalConfig.setAsync`.
256
+ - Added an explicit `box-sizing: border-box;` to the inner div of ChoiceToken, to prevent
257
+ accidentally inheriting different box-sizing values.
258
+
259
+ ## [0.0.52](https://github.com/airtable/blocks/compare/@airtable/blocks@0.0.51...@airtable/blocks@0.0.52) - 2020-06-08
260
+
261
+ - Add `FieldType.CREATED_BY`, `FieldType.LAST_MODIFIED_BY`, and `FieldType.BUTTON`.
262
+ - Add record action APIs! Use one in your block to handle "open block" requests from a button
263
+ field.
264
+ - `useRecordActionData`
265
+ - `registerRecordActionDataCallback`
266
+
267
+ ## [0.0.51](https://github.com/airtable/blocks/compare/@airtable/blocks@0.0.50...@airtable/blocks@0.0.51) - 2020-05-28
268
+
269
+ - Fix a bug introduced in 0.0.48 that caused typechecking errors for blocks using TypeScript.
270
+
271
+ ## [0.0.50](https://github.com/airtable/blocks/compare/@airtable/blocks@0.0.49...@airtable/blocks@0.0.50) - 2020-05-28
272
+
273
+ No changes.
274
+
275
+ ## [0.0.49](https://github.com/airtable/blocks/compare/@airtable/blocks@0.0.48...@airtable/blocks@0.0.49) - 2020-05-21
276
+
277
+ - Adds optional `renderInvalidCellValue` prop to `RecordCard` and `CellRenderer` to render a
278
+ component if validation fails.
279
+
280
+ ## [0.0.48](https://github.com/airtable/blocks/compare/@airtable/blocks@0.0.47...@airtable/blocks@0.0.48) - 2020-04-30
281
+
282
+ No changes.
283
+
284
+ ## [0.0.47](https://github.com/airtable/blocks/compare/@airtable/blocks@0.0.46...@airtable/blocks@0.0.47) - 2020-04-23
285
+
286
+ - UI components that don't depend on base data can now be used outside of the blocks environment.
287
+
288
+ ## [0.0.46](https://github.com/airtable/blocks/compare/@airtable/blocks@0.0.45...@airtable/blocks@0.0.46) - 2020-04-16
289
+
290
+ - `FieldType.RICH_TEXT` has been added, which encompasses long text fields with the new rich text
291
+ formatting option enabled. (See Airtable's announcement regarding
292
+ [rich text formatting in long text fields](https://blog.airtable.com/4-workflows-for-rich-text-formatting/))
293
+ - `Switch` and `SwitchSynced` now truncate the label.
294
+ - Fix a bug where `RecordCard` performs the default expand record behavior, even if an `onClick`
295
+ override is supplied. It now properly handles overrides as described in the documentation. This
296
+ fix also applies to `onRecordClick` in `RecordCardList`.
297
+ - Beta: New field and table writes API! You can now create tables and fields and update field
298
+ options.
299
+ - `base.unstable_createTableAsync`
300
+ - `table.unstable_createFieldAsync`
301
+ - `field.unstable_updateOptionsAsync`
302
+ - These APIs are unstable and may have breaking changes in the future.
303
+ - Not all field types are supported at this time. Refer to `FieldType` documentation for
304
+ details.
305
+
306
+ ## [0.0.45](https://github.com/airtable/blocks/compare/@airtable/blocks@0.0.44...@airtable/blocks@0.0.45) - 2020-03-31
307
+
308
+ - **DEPRECATED:** `record.primaryCellValue` and `record.primaryCellValueAsString`.
309
+ - The `primaryCellValue` watch key on `record` is also deprecated - use the `name` watch key
310
+ instead.
311
+ - Add the following APIs to match the new scripting block:
312
+ - **Convenience model getters.** These are useful when you're working on a block for a
313
+ specific base, but best-practice for more generic blocks is to prefer the existing
314
+ `ById`/`ByName` methods.
315
+ - `base.getCollaboratorIfExists`
316
+ - `base.getCollaborator`
317
+ - `base.getTableIfExists`
318
+ - `base.getTable`
319
+ - `table.getFieldIdExists`
320
+ - `table.getField`
321
+ - `table.getViewIfExists`
322
+ - `table.getView`
323
+ - **Async `select` queries.** For creating UIs from a query, the best practice is still to use
324
+ `useRecords` etc. Directly querying data is useful for one-off data processing though.
325
+ - `table.selectRecordsAsync`
326
+ - `view.selectRecordsAsync`
327
+ - `view.selectMetadataAsync`
328
+ - `record.selectLinkedRecordsFromCellAsync`
329
+ - **`record.name`** replaces `record.primaryCellValueAsString`.
330
+ - Fix some incorrectly redacted internal typescript types
331
+
332
+ ## [0.0.44](https://github.com/airtable/blocks/compare/@airtable/blocks@0.0.43...@airtable/blocks@0.0.44) - 2020-03-27
333
+
334
+ - `TextButton` now supports including an icon without a label.
335
+ - Properly export the `useSynced` hook.
336
+ - Errors now output model names instead of IDs when available.
337
+ - Fix a positioning bug with `SelectButtons` where unwanted empty space could appear when the
338
+ component is used in a scrollable list.
339
+
340
+ ## [0.0.43](https://github.com/airtable/blocks/compare/@airtable/blocks@0.0.42...@airtable/blocks@0.0.43) - 2020-02-28
341
+
342
+ - Export the `useSynced` hook for syncing a component to `GlobalConfig`.
343
+
344
+ ## [0.0.42](https://github.com/airtable/blocks/compare/@airtable/blocks@0.0.41...@airtable/blocks@0.0.42) - 2020-02-10
345
+
346
+ - **BREAKING**: Field type and view type enums are now exported from '@airtable/blocks/models' as
347
+ `FieldType` and `ViewType` (previously `fieldTypes` and `viewTypes`). Relatedly, these types are
348
+ no longer exported from '@airtable/blocks/types', as they can now be referenced from the model
349
+ exports.
350
+ - Updates to record convenience hooks
351
+ - `useRecords` now accepts a `Table` or `View` and optional `RecordQueryResultOpts`. Passing a
352
+ `RecordQueryResult` is still supported.
353
+ - `useRecordIds` now accepts a `Table` or `View` and optional `RecordIdQueryResultOpts`.
354
+ Passing a `RecordQueryResult` is still supported.
355
+ - `useRecordById` now accepts a `Table` or `View` and optional `SingleRecordQueryResultOpts`.
356
+ Passing a `RecordQueryResult` is still supported.
357
+ - Added `cursor.selectedFieldIds` which returns the field IDs that are selected in grid view
358
+
359
+ ## [0.0.41](https://github.com/airtable/blocks/compare/@airtable/blocks@0.0.40...@airtable/blocks@0.0.41) - 2020-01-27
360
+
361
+ - **BREAKING**: `useWatchable` will now throw an error if the second argument `keys` is
362
+ `undefined`. Previously, this would no-op.
363
+ - Added support for `setActiveTable` and `setActiveView` to the `cursor` API. These can be used to
364
+ manipulate the current table and/or view on the main Airtable page from inside a block.
365
+ - Table.createRecordsAsync now accepts an array of objects containing a `fields` object of field
366
+ \-> cell value mappings, rather an accepting field -> cell value mappings directly. This brings
367
+ its API in line with `updateRecordsAsync` and other Airtable APIs. The old behavior is still
368
+ supported but has been deprecated and will be removed in a future version.
369
+ - Fixed issue where blocks would crash in MS Edge due to a browser bug with `super` method calls.
370
+ - Changed default Tooltip `placementOffsetX` and `placementOffsetY` to `8` pixels. `undefined`.
371
+ Previously, this would no-op.
372
+ - Added default blue `barColor` to `ProgressBar`.
373
+
374
+ ## [0.0.40](https://github.com/airtable/blocks/compare/@airtable/blocks@0.0.39...@airtable/blocks@0.0.40) - 2020-01-09
375
+
376
+ - Added permission checks that don't require specifying a table to `session`:
377
+ - `session.checkPermissionsForUpdateRecords()`
378
+ - `session.hasPermissionToUpdateRecords()`
379
+ - `session.checkPermissionsForCreateRecords()`
380
+ - `session.hasPermissionToCreateRecords()`
381
+ - `session.checkPermissionsForDeleteRecords()`
382
+ - `session.hasPermissionToDeleteRecords()`
383
+
384
+ ## [0.0.39](https://github.com/airtable/blocks/compare/@airtable/blocks@0.0.38...@airtable/blocks@0.0.39) - 2019-12-12
385
+
386
+ - Changed the font sizes for the `size` variants of `Select` and `Button`.
387
+ - `useWatchable` now supports single string watch keys being passed in (as well as the existing
388
+ array support)
389
+ - Fixed bug where `shouldAllowPickingNone` didn't work in `FieldPicker` and `FieldPickerSynced`.
390
+ - Updated `fullscreen` and `fullscreenMicro` icons.
391
+ - Updated UI.Button component to better support icon buttons containing no text. An error is now
392
+ logged to the console if you attempt to use a UI.Button component with no text/children and no
393
+ aria-label.
394
+
395
+ ## [0.0.36](https://github.com/airtable/blocks/compare/@airtable/blocks@0.0.35...@airtable/blocks@0.0.36) - 2019-11-18
396
+
397
+ - Added `table.description` and `field.description`, and `description` watch key on `table` and
398
+ `field`.
399
+
400
+ ## [0.0.35](https://github.com/airtable/blocks/compare/@airtable/blocks@0.0.34...@airtable/blocks@0.0.35) - 2019-11-11
401
+
402
+ - UI library
403
+ - New API for styling UI components. Each component now exposes a certain set of CSS
404
+ properties as React props. Styling via the `className` and `style` props is still supported
405
+ but is no longer recommended. For more information, see the documentation for
406
+ [style props](https://github.com/Airtable/blocks/blob/master/packages/sdk/docs/api/modules/_airtable_blocks_ui_system__all_style_props.md#allstylesprops).
407
+ - New components:
408
+ - `Text` and `Heading` for typography.
409
+ - `Label` and `FormField` for labeling controls or form fields.
410
+ - `TextButton` for buttons that can be rendered inline with text.
411
+ - **BREAKING**: `Toggle` has been renamed to `Switch`.
412
+ - **BREAKING**: `Button` and `Switch` no longer accept the `theme` prop. Instead, you can
413
+ specify the colors for these components with the `variant` prop.
414
+ - `Link` also supports the `variant` prop, which determines the text color of the link.
415
+ - `Button`, `Input`, `Link`, `SelectButtons`, `Select`, `Switch`, and the model picker
416
+ components can now be resized via the `size` prop (one of `small`, `default`, or `large`).
417
+ - `Button`, `Icon`, `Input`, `Link`, `SelectButtons`, `Select`, `Switch`, and the model picker
418
+ components are now functional components that use the
419
+ [`React.forwardRef`](https://reactjs.org/docs/forwarding-refs.html) API.
420
+ - `SelectButtons` is now keyboard/screenreader accessible.
421
+ - Typescript
422
+ - **BREAKING** The SDK has been migrated from Flow to TypeScript. We no longer provide flow
423
+ type definitions with the release of the SDK. TypeScript definitions are provided instead.
424
+
425
+ ## [0.0.34](https://github.com/airtable/blocks/compare/@airtable/blocks@0.0.33...@airtable/blocks@0.0.34) - 2019-10-04
426
+
427
+ - Fix a regression where `UI.ConfirmationDialog` would crash the block.
428
+ - Allow passing an array of models to `useWatchable` to watch several models at once.
429
+ - **BREAKING**: `fieldTypes.LOOKUP` is now `fieldTypes.MULTIPLE_LOOKUP_VALUES`. The underlying
430
+ string has also changed from `lookup` to `multipleLookupValues`.
431
+ - Fix a regression where cover images in `UI.RecordCard` would render as `[Object object]`.
432
+
433
+ ## [0.0.33](https://github.com/airtable/blocks/compare/@airtable/blocks@0.0.32...@airtable/blocks@0.0.33) - 2019-09-26
434
+
435
+ - New settings button helpers: `useSettingsButton`, `settingsButton.show()` and
436
+ `settingsButton.hide()`.
437
+ - **BREAKING**: `settingsButton.isVisible` is no longer settable. Use `settingsButton.show()` and
438
+ `settingsButton.hide()` instead.
439
+
440
+ ## [0.0.32](https://github.com/airtable/blocks/compare/@airtable/blocks@0.0.31...@airtable/blocks@0.0.32) - 2019-09-20
441
+
442
+ - **BREAKING:** Removed `localStorage` and `sessionStorage` wrappers.
443
+ - Fix a bug where the `value` prop wouldn't get correctly passed through to `Input`
444
+
445
+ ## [0.0.31](https://github.com/airtable/blocks/compare/@airtable/blocks@0.0.30...@airtable/blocks@0.0.31) - 2019-09-18
446
+
447
+ - New record writes API! You can now create, update, and delete records directly from your block.
448
+ Check out the new
449
+ [writes guide](https://github.com/Airtable/blocks/blob/master/packages/sdk/docs/guide_writes.md)
450
+ for more information.
451
+ - **BREAKING**: several `globalConfig` APIs have changed to be consistent with the new record
452
+ writes & permissions APIs:
453
+ - `globalConfig.set()` has been removed - use the new `globalConfig.setAsync()` method
454
+ instead.
455
+ - `globalConfig.canSet()` has been renamed to `globalConfig.hasPermissionToSet()`.
456
+ - `globalConfig.setPaths()` has been removed - use the new `globalConfig.setPathsAsync()`
457
+ method instead.
458
+ - `globalConfig.canSetPaths()` has been renamed to `globalConfig.hasPermissionToSetPaths()`.
459
+ - **BREAKING:** Remove `models.generateGuid()`. Use an ID generator like
460
+ [`uuid`](https://www.npmjs.com/package/uuid) instead.
461
+ - **BREAKING:** Deprecated `UI.AutocompletePopover`.
462
+ - Upgrade flow to 0.106.3
463
+ - Fix a flow error with `react-window`.
464
+ - `view.selectRecords()` now colors records according to that view by default.
465
+ - Allow passing an array of models to `useLoadable` to load several things at once.
466
+
467
+ ## [0.0.30](https://github.com/airtable/blocks/compare/@airtable/blocks@0.0.29...@airtable/blocks@0.0.30) - 2019-08-26
468
+
469
+ No changes.
470
+
471
+ ## [0.0.29](https://github.com/airtable/blocks/compare/@airtable/blocks@0.0.28...@airtable/blocks@0.0.29) - 2019-08-22
472
+
473
+ No changes.
474
+
475
+ ## [0.0.28](https://github.com/airtable/blocks/compare/@airtable/blocks@0.0.27...@airtable/blocks@0.0.28) - 2019-08-21
476
+
477
+ No changes.
478
+
479
+ ## [0.0.27](https://github.com/airtable/blocks/compare/@airtable/blocks@0.0.26...@airtable/blocks@0.0.27) - 2019-08-21
480
+
481
+ No changes.
482
+
483
+ ## [0.0.26](https://github.com/airtable/blocks/compare/@airtable/blocks@0.0.25...@airtable/blocks@0.0.26) - 2019-08-19
484
+
485
+ - UI.RecordCardList: fixed a bug where records weren't expanded by default when clicked.
486
+
487
+ ## [0.0.25](https://github.com/airtable/blocks/compare/@airtable/blocks@0.0.24...@airtable/blocks@0.0.25) - 2019-08-19
488
+
489
+ - Add Print Records block docs example block
490
+
491
+ ## [0.0.24](https://github.com/airtable/blocks/compare/@airtable/blocks@0.0.23...@airtable/blocks@0.0.24) - 2019-08-14
492
+
493
+ No changes.
494
+
495
+ ## [0.0.23](https://github.com/airtable/blocks/compare/@airtable/blocks@0.0.22...@airtable/blocks@0.0.23) - 2019-08-09
496
+
497
+ ### Fixed
498
+
499
+ - The `disabled` attribute on `<Select>` components (including model pickers and synced model
500
+ pickers) now correctly disables the element
501
+
502
+ ## [0.0.22](https://github.com/airtable/blocks/compare/@airtable/blocks@0.0.21...@airtable/blocks@0.0.22) - 2019-07-18
503
+
504
+ No changes.
505
+
506
+ ## [0.0.21](https://github.com/airtable/blocks/compare/@airtable/blocks@0.0.20...@airtable/blocks@0.0.21) - 2019-07-18
507
+
508
+ No changes.
509
+
510
+ ## [0.0.20](https://github.com/airtable/blocks/compare/@airtable/blocks@0.0.19...@airtable/blocks@0.0.20) - 2019-07-15
511
+
512
+ ### Fixed
513
+
514
+ - A bug with UI.Toggle that made it difficult to style
515
+
516
+ ## [0.0.19](https://github.com/airtable/blocks/compare/@airtable/blocks@0.0.18...@airtable/blocks@0.0.19) - 2019-07-11
517
+
518
+ No changes.
519
+
520
+ ## [0.0.18](https://github.com/airtable/blocks/compare/@airtable/blocks@0.0.17...@airtable/blocks@0.0.18) - 2019-07-10
521
+
522
+ - Update documentation links & eslint-plugin-blocks
523
+
524
+ ## [0.0.17](https://github.com/airtable/blocks/compare/@airtable/blocks@0.0.16...@airtable/blocks@0.0.17) - 2019-07-09
525
+
526
+ No changes.
527
+
528
+ ## [0.0.16](https://github.com/airtable/blocks/compare/@airtable/blocks@0.0.15...@airtable/blocks@0.0.16) - 2019-07-05
529
+
530
+ - **BREAKING:** Removed view.visibleFields and view.allFields - use view.selectMetadata instead
531
+ - Added view.selectMetadata() for querying a view's field order and list of visible fields
532
+
533
+ ## [0.0.15](https://github.com/airtable/blocks/compare/v0.0.14...@airtable/blocks@0.0.15) - 2019-07-03
534
+
535
+ No changes.
536
+
537
+ ## [0.0.14](https://github.com/airtable/blocks/compare/v0.0.13...v0.0.14) - 2019-07-02
538
+
539
+ - **BREAKING:** Removed `currentUser` from `Base` since it is now accessible through `Session`.
540
+ - **BREAKING:** Renamed QueryResult to RecordQueryResult
541
+ - Added base.watch('schema') to get notified when base schema changes.
542
+ - Added Session to expose data about the current user's session.
543
+ - Added globalConfig.watch('\*') to get notified of any global config key change.
544
+ - Added useGlobalConfig() to subscribe to global config changes from a react component.
545
+
546
+ ## [0.0.13](https://github.com/airtable/blocks/releases/tag/v0.0.13) - 2019-06-21
547
+
548
+ ### Removed
549
+
550
+ - **BREAKING:** Removed `createDataContainer`. Use `useWatchable` or other hooks instead.
551
+ - **BREAKING:** FieldIcon no longer accepts arbitrary props - only those in it's propTypes can be
552
+ used.
553
+
554
+ ### Added
555
+
556
+ - This changelog!
557
+
558
+ ### Fixed
559
+
560
+ - FieldPicker placeholder typo
561
+ - SVGElement flow error
@@ -109,6 +109,8 @@ function initializeBlock(getEntryElement) {
109
109
  sdk.__setBatchedUpdatesFn(_reactDom.default.unstable_batchedUpdates);
110
110
  }
111
111
  var container = document.createElement('div');
112
+ container.style.height = '100%';
113
+ container.style.width = '100%';
112
114
  body.appendChild(container);
113
115
 
114
116
  // Try to use createRoot API (React 18+)
@@ -29,6 +29,8 @@ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length)
29
29
  */
30
30
 
31
31
  /** @internal */
32
+ // Old eslint rule doesn't understand type guards
33
+ // eslint-disable-next-line airtable/is-returns-boolean
32
34
  function isSelectOptionValue(value) {
33
35
  return value === null || value === undefined || typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean';
34
36
  }
@@ -8,6 +8,8 @@ require("core-js/modules/es.number.constructor.js");
8
8
  var _core = require("@styled-system/core");
9
9
  var _error_utils = require("../../../../shared/error_utils");
10
10
  /** @internal */
11
+ // Old eslint rule doesn't understand type guards
12
+ // eslint-disable-next-line airtable/is-returns-boolean
11
13
  function isNumber(n) {
12
14
  return typeof n === 'number' && !isNaN(n);
13
15
  }
@@ -36,6 +36,7 @@ var _exportNames = {
36
36
  initializeBlock: true,
37
37
  withHooks: true,
38
38
  useLoadable: true,
39
+ useColorScheme: true,
39
40
  useRecordIds: true,
40
41
  useRecords: true,
41
42
  useRecordById: true,
@@ -221,6 +222,12 @@ Object.defineProperty(exports, "useBase", {
221
222
  return _use_base.default;
222
223
  }
223
224
  });
225
+ Object.defineProperty(exports, "useColorScheme", {
226
+ enumerable: true,
227
+ get: function get() {
228
+ return _use_color_scheme.useColorScheme;
229
+ }
230
+ });
224
231
  Object.defineProperty(exports, "useCursor", {
225
232
  enumerable: true,
226
233
  get: function get() {
@@ -340,6 +347,7 @@ var _viewport_constraint = _interopRequireDefault(require("./viewport_constraint
340
347
  var _initialize_block = require("./initialize_block");
341
348
  var _with_hooks = _interopRequireDefault(require("../../shared/ui/with_hooks"));
342
349
  var _use_loadable = _interopRequireDefault(require("./use_loadable"));
350
+ var _use_color_scheme = require("../../shared/ui/use_color_scheme");
343
351
  var _use_records = require("./use_records");
344
352
  var _use_base = _interopRequireDefault(require("./use_base"));
345
353
  var _use_cursor = _interopRequireDefault(require("./use_cursor"));
@@ -43,5 +43,50 @@ var Table = exports.Table = /*#__PURE__*/function (_TableCore) {
43
43
  function _constructField(fieldId) {
44
44
  return new _field.Field(this.parentBase.__sdk, this, fieldId);
45
45
  }
46
+
47
+ /**
48
+ * Checks whether records in this table can be expanded.
49
+ *
50
+ * Returns `{hasPermission: true}` if records can be expanded,
51
+ * `{hasPermission: false, reasonDisplayString: string}` otherwise.
52
+ *
53
+ * @example
54
+ * ```js
55
+ * const expandRecordsCheckResult = table.checkPermissionToExpandRecords();
56
+ * if (!expandRecordsCheckResult.hasPermission) {
57
+ * alert(expandRecordsCheckResult.reasonDisplayString);
58
+ * }
59
+ * ```
60
+ */
61
+ }, {
62
+ key: "checkPermissionToExpandRecords",
63
+ value: function checkPermissionToExpandRecords() {
64
+ var canExpand = this._baseData.tablesById[this.id].isRecordExpansionEnabled;
65
+ return canExpand ? {
66
+ hasPermission: true
67
+ } : {
68
+ hasPermission: false,
69
+ reasonDisplayString: 'Record expansion is not enabled for this table'
70
+ };
71
+ }
72
+
73
+ /**
74
+ * An alias for `checkPermissionsForExpandRecords().hasPermission`.
75
+ *
76
+ * Whether records in this table can be expanded.
77
+ *
78
+ * @example
79
+ * ```js
80
+ * const isRecordExpansionEnabled = table.hasPermissionToExpandRecords();
81
+ * if (isRecordExpansionEnabled) {
82
+ * expandRecord(record);
83
+ * }
84
+ * ```
85
+ */
86
+ }, {
87
+ key: "hasPermissionToExpandRecords",
88
+ value: function hasPermissionToExpandRecords() {
89
+ return this.checkPermissionToExpandRecords().hasPermission;
90
+ }
46
91
  }]);
47
92
  }(_table_core.TableCore);
@@ -78,6 +78,8 @@ function initializeBlock(entryPoints) {
78
78
  throw (0, _error_utils.spawnError)("The first argument to initializeBlock didn't return a valid React element");
79
79
  }
80
80
  var container = document.createElement('div');
81
+ container.style.height = '100%';
82
+ container.style.width = '100%';
81
83
  body.appendChild(container);
82
84
 
83
85
  // Try to use createRoot API (React 18+)
@@ -52,6 +52,12 @@ Object.defineProperty(exports, "useBase", {
52
52
  return _use_base.useBase;
53
53
  }
54
54
  });
55
+ Object.defineProperty(exports, "useColorScheme", {
56
+ enumerable: true,
57
+ get: function get() {
58
+ return _use_color_scheme.useColorScheme;
59
+ }
60
+ });
55
61
  Object.defineProperty(exports, "useCustomProperties", {
56
62
  enumerable: true,
57
63
  get: function get() {
@@ -104,6 +110,7 @@ require("..");
104
110
  var _expand_record = require("./expand_record");
105
111
  var _initialize_block = require("./initialize_block");
106
112
  var _use_base = require("./use_base");
113
+ var _use_color_scheme = require("../../shared/ui/use_color_scheme");
107
114
  var _use_custom_properties = require("./use_custom_properties");
108
115
  var _use_records = require("./use_records");
109
116
  var _use_run_info = require("./use_run_info");
@@ -112,4 +112,4 @@ var BlockSdkCore = exports.BlockSdkCore = /*#__PURE__*/function () {
112
112
  * @hidden
113
113
  */
114
114
  // @ts-ignore
115
- (0, _defineProperty2.default)(BlockSdkCore, "VERSION", "1.18.2");
115
+ (0, _defineProperty2.default)(BlockSdkCore, "VERSION", "1.19.0");
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.useColorScheme = useColorScheme;
8
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
9
+ var _react = require("react");
10
+ /** @module @airtable/blocks/ui: useColorScheme */ /** */
11
+
12
+ /**
13
+ * A hook for checking whether Airtable is in light mode or dark mode.
14
+ *
15
+ * @returns An object with a `colorScheme` property, which can be `'light'` or `'dark'`.
16
+ *
17
+ * @example
18
+ * ```js
19
+ * import {useColorScheme} from '@airtable/blocks/[placeholder-path]/ui';
20
+ *
21
+ * function MyApp() {
22
+ * const {colorScheme} = useColorScheme();
23
+ * return (
24
+ * <div style={colorScheme === 'dark' ?
25
+ * {color: 'white', backgroundColor: 'black'} :
26
+ * {color: 'black', backgroundColor: 'white'}
27
+ * }>
28
+ * Tada!
29
+ * </div>
30
+ * );
31
+ * }
32
+ * ```
33
+ * @docsPath UI/hooks/useColorScheme
34
+ * @hook
35
+ */
36
+ // Returns an object so we can add more properties if we need to, eg a setter to change the
37
+ // color scheme from within extensions, whether the preference is directly set or inherited from
38
+ // the browser, etc.
39
+ function useColorScheme() {
40
+ var _useState = (0, _react.useState)(window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'),
41
+ _useState2 = (0, _slicedToArray2.default)(_useState, 2),
42
+ colorScheme = _useState2[0],
43
+ setColorScheme = _useState2[1];
44
+ (0, _react.useEffect)(() => {
45
+ var darkModeQuery = window.matchMedia('(prefers-color-scheme: dark)');
46
+ // Fires when e.matches changes. If there are more color schemes than light and dark,
47
+ // we'll need multiple listeners (and corresponding media queries)
48
+ var darkModeListener = e => {
49
+ setColorScheme(e.matches ? 'dark' : 'light');
50
+ };
51
+ darkModeQuery.addEventListener('change', darkModeListener);
52
+ return () => {
53
+ // Clear listeners when the component unmounts
54
+ darkModeQuery.removeEventListener('change', darkModeListener);
55
+ };
56
+ }, []);
57
+ return {
58
+ colorScheme
59
+ };
60
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"initialize_block.d.ts","sourceRoot":"","sources":["../../../../../src/base/ui/initialize_block.tsx"],"names":[],"mappings":"AAAA,mDAAmD,CAAC,MAAM;AAC1D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,GAAG,MAAM,QAAQ,CAAC;AAGzB,OAAO,KAAK,MAAM,iBAAiB,CAAC;AACpC,OAAO,IAAI,MAAM,gBAAgB,CAAC;AAKlC,MAAM;AACN,KAAK,6BAA6B,GAAG,MAAM,KAAK,CAAC,SAAS,CAAC;AAC3D,cAAc;AACd,KAAK,wBAAwB,GAAG,CAAC,EAAC,KAAK,EAAE,IAAI,EAAC,EAAE;IAAC,KAAK,EAAE,KAAK,CAAC;IAAC,IAAI,EAAE,IAAI,CAAA;CAAC,KAAK,KAAK,CAAC,SAAS,CAAC;AAC/F,cAAc;AACd,UAAU,WAAW;IACjB,SAAS,CAAC,EAAE,6BAA6B,CAAC;IAC1C,IAAI,CAAC,EAAE,wBAAwB,CAAC;CACnC;AAED,cAAc;AACd,KAAK,sBAAsB,GAAG,6BAA6B,GAAG,WAAW,CAAC;AAE1E;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,eAAe,CAAC,eAAe,EAAE,sBAAsB,QA8EtE;AAMD,wBAAgB,8BAA8B,CAAC,IAAI,EAAE,GAAG,QAEvD;AAGD,wBAAgB,yBAAyB,SAExC"}
1
+ {"version":3,"file":"initialize_block.d.ts","sourceRoot":"","sources":["../../../../../src/base/ui/initialize_block.tsx"],"names":[],"mappings":"AAAA,mDAAmD,CAAC,MAAM;AAC1D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,GAAG,MAAM,QAAQ,CAAC;AAGzB,OAAO,KAAK,MAAM,iBAAiB,CAAC;AACpC,OAAO,IAAI,MAAM,gBAAgB,CAAC;AAKlC,MAAM;AACN,KAAK,6BAA6B,GAAG,MAAM,KAAK,CAAC,SAAS,CAAC;AAC3D,cAAc;AACd,KAAK,wBAAwB,GAAG,CAAC,EAAC,KAAK,EAAE,IAAI,EAAC,EAAE;IAAC,KAAK,EAAE,KAAK,CAAC;IAAC,IAAI,EAAE,IAAI,CAAA;CAAC,KAAK,KAAK,CAAC,SAAS,CAAC;AAC/F,cAAc;AACd,UAAU,WAAW;IACjB,SAAS,CAAC,EAAE,6BAA6B,CAAC;IAC1C,IAAI,CAAC,EAAE,wBAAwB,CAAC;CACnC;AAED,cAAc;AACd,KAAK,sBAAsB,GAAG,6BAA6B,GAAG,WAAW,CAAC;AAE1E;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,eAAe,CAAC,eAAe,EAAE,sBAAsB,QAgFtE;AAMD,wBAAgB,8BAA8B,CAAC,IAAI,EAAE,GAAG,QAEvD;AAGD,wBAAgB,yBAAyB,SAExC"}
@@ -1 +1 @@
1
- {"version":3,"file":"select_and_select_buttons_helpers.d.ts","sourceRoot":"","sources":["../../../../../src/base/ui/select_and_select_buttons_helpers.ts"],"names":[],"mappings":"AAAA,0CAA0C,CAAC,MAAM;AACjD,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC;AAa7E;;GAEG;AACH,MAAM,WAAW,YAAY;IACzB,uCAAuC;IACvC,KAAK,EAAE,iBAAiB,CAAC;IACzB,uCAAuC;IACvC,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;CAC7B;AAGD,eAAO,MAAM,yBAAyB,EAIhC,SAAS,CAAC,SAAS,CAAC,WAAW,CAAC,iBAAiB,CAAC,CAAC,CAAC;AAE1D,eAAO,MAAM,eAAe,YAAa,KAAK,CAAC,YAAY,CAAC;;;;;;CAgB3D,CAAC"}
1
+ {"version":3,"file":"select_and_select_buttons_helpers.d.ts","sourceRoot":"","sources":["../../../../../src/base/ui/select_and_select_buttons_helpers.ts"],"names":[],"mappings":"AAAA,0CAA0C,CAAC,MAAM;AACjD,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC;AAe7E;;GAEG;AACH,MAAM,WAAW,YAAY;IACzB,uCAAuC;IACvC,KAAK,EAAE,iBAAiB,CAAC;IACzB,uCAAuC;IACvC,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;CAC7B;AAGD,eAAO,MAAM,yBAAyB,EAIhC,SAAS,CAAC,SAAS,CAAC,WAAW,CAAC,iBAAiB,CAAC,CAAC,CAAC;AAE1D,eAAO,MAAM,eAAe,YAAa,KAAK,CAAC,YAAY,CAAC;;;;;;CAgB3D,CAAC"}
@@ -29,6 +29,7 @@ export { default as ViewportConstraint } from './viewport_constraint';
29
29
  export { initializeBlock } from './initialize_block';
30
30
  export { default as withHooks } from '../../shared/ui/with_hooks';
31
31
  export { default as useLoadable } from './use_loadable';
32
+ export { useColorScheme } from '../../shared/ui/use_color_scheme';
32
33
  export { useRecordIds, useRecords, useRecordById, useRecordQueryResult } from './use_records';
33
34
  export { default as useBase } from './use_base';
34
35
  export { default as useCursor } from './use_cursor';
@@ -1 +1 @@
1
- {"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../../../../../src/base/ui/ui.ts"],"names":[],"mappings":"AAAA,cAAc;AACd,OAAO,WAAW,MAAM,gBAAgB,CAAC;AAMzC,OAAO,IAAI,CAAC;AAEZ,OAAO,EAAC,OAAO,IAAI,YAAY,EAAC,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAC,OAAO,IAAI,MAAM,EAAC,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAC,OAAO,IAAI,UAAU,EAAC,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAC,OAAO,IAAI,MAAM,EAAC,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAC,OAAO,IAAI,WAAW,EAAC,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAC,OAAO,IAAI,iBAAiB,EAAC,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAC,OAAO,IAAI,WAAW,EAAC,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAC,OAAO,IAAI,iBAAiB,EAAC,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAC,OAAO,IAAI,UAAU,EAAC,MAAM,eAAe,CAAC;AACpD,OAAO,EAAC,OAAO,IAAI,gBAAgB,EAAC,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAAC,OAAO,IAAI,WAAW,EAAC,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAC,OAAO,IAAI,YAAY,EAAC,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAC,OAAO,IAAI,YAAY,EAAC,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAC,OAAO,IAAI,gBAAgB,EAAC,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAAC,OAAO,IAAI,uBAAuB,EAAC,MAAM,8BAA8B,CAAC;AAChF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AC,OAAO,IAAI,OAAO,EAAC,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAC,OAAO,IAAI,SAAS,EAAC,MAAM,cAAc,CAAC;AAClD,OAAO,EAAC,OAAO,IAAI,UAAU,EAAC,MAAM,eAAe,CAAC;AACpD,OAAO,EAAC,OAAO,IAAI,iBAAiB,EAAC,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAC,OAAO,IAAI,SAAS,EAAC,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAC,OAAO,IAAI,YAAY,EAAC,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAC,OAAO,IAAI,WAAW,EAAC,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAC,OAAO,IAAI,eAAe,EAAC,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAC,OAAO,IAAI,eAAe,EAAC,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAC,OAAO,IAAI,mBAAmB,EAAC,MAAM,0BAA0B,CAAC;AACxE,OAAO,EAAC,gCAAgC,EAAC,MAAM,0BAA0B,CAAC;AAE1E,cAAc,0BAA0B,CAAC;AAEzC,eAAO,MAAM,WAAW,aAAoB,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import { TableCore } from '../../shared/models/table_core';
2
2
  import { InterfaceSdkMode } from '../../sdk_mode';
3
+ import { PermissionCheckResult } from '../../shared/types/mutations_core';
3
4
  /**
4
5
  * Model class representing a table. Every {@link Base} has one or more tables.
5
6
  *
@@ -18,5 +19,34 @@ import { InterfaceSdkMode } from '../../sdk_mode';
18
19
  * @docsPath models/Table
19
20
  */
20
21
  export declare class Table extends TableCore<InterfaceSdkMode> {
22
+ /**
23
+ * Checks whether records in this table can be expanded.
24
+ *
25
+ * Returns `{hasPermission: true}` if records can be expanded,
26
+ * `{hasPermission: false, reasonDisplayString: string}` otherwise.
27
+ *
28
+ * @example
29
+ * ```js
30
+ * const expandRecordsCheckResult = table.checkPermissionToExpandRecords();
31
+ * if (!expandRecordsCheckResult.hasPermission) {
32
+ * alert(expandRecordsCheckResult.reasonDisplayString);
33
+ * }
34
+ * ```
35
+ */
36
+ checkPermissionToExpandRecords(): PermissionCheckResult;
37
+ /**
38
+ * An alias for `checkPermissionsForExpandRecords().hasPermission`.
39
+ *
40
+ * Whether records in this table can be expanded.
41
+ *
42
+ * @example
43
+ * ```js
44
+ * const isRecordExpansionEnabled = table.hasPermissionToExpandRecords();
45
+ * if (isRecordExpansionEnabled) {
46
+ * expandRecord(record);
47
+ * }
48
+ * ```
49
+ */
50
+ hasPermissionToExpandRecords(): boolean;
21
51
  }
22
52
  //# sourceMappingURL=table.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../../../src/interface/models/table.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,gCAAgC,CAAC;AACzD,OAAO,EAAC,gBAAgB,EAAC,MAAM,gBAAgB,CAAC;AAIhD;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,KAAM,SAAQ,SAAS,CAAC,gBAAgB,CAAC;CAKrD"}
1
+ {"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../../../src/interface/models/table.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,gCAAgC,CAAC;AACzD,OAAO,EAAC,gBAAgB,EAAC,MAAM,gBAAgB,CAAC;AAEhD,OAAO,EAAC,qBAAqB,EAAC,MAAM,mCAAmC,CAAC;AAGxE;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,KAAM,SAAQ,SAAS,CAAC,gBAAgB,CAAC;IAMlD;;;;;;;;;;;;;OAaG;IACH,8BAA8B,IAAI,qBAAqB;IAUvD;;;;;;;;;;;;OAYG;IACH,4BAA4B,IAAI,OAAO;CAG1C"}
@@ -6,5 +6,6 @@ import { RecordData } from './record';
6
6
  export interface TableData extends TableDataCore {
7
7
  recordsById: ObjectMap<RecordId, RecordData>;
8
8
  recordOrder: Array<RecordId>;
9
+ isRecordExpansionEnabled: boolean;
9
10
  }
10
11
  //# sourceMappingURL=table.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../../../src/interface/types/table.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAC,QAAQ,EAAC,MAAM,8BAA8B,CAAC;AACtD,OAAO,EAAC,SAAS,EAAC,MAAM,4BAA4B,CAAC;AACrD,OAAO,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AAEpC,cAAc;AACd,MAAM,WAAW,SAAU,SAAQ,aAAa;IAC5C,WAAW,EAAE,SAAS,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;IAC7C,WAAW,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;CAChC"}
1
+ {"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../../../src/interface/types/table.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAC,QAAQ,EAAC,MAAM,8BAA8B,CAAC;AACtD,OAAO,EAAC,SAAS,EAAC,MAAM,4BAA4B,CAAC;AACrD,OAAO,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AAEpC,cAAc;AACd,MAAM,WAAW,SAAU,SAAQ,aAAa;IAC5C,WAAW,EAAE,SAAS,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;IAC7C,WAAW,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;IAC7B,wBAAwB,EAAE,OAAO,CAAC;CACrC"}
@@ -1 +1 @@
1
- {"version":3,"file":"initialize_block.d.ts","sourceRoot":"","sources":["../../../../../src/interface/ui/initialize_block.tsx"],"names":[],"mappings":"AAAA,mDAAmD,CAAC,MAAM;AAC1D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAC,iBAAiB,EAAC,MAAM,QAAQ,CAAC;AAOzC,MAAM;AACN,KAAK,oBAAoB,GAAG,MAAM,KAAK,CAAC,SAAS,CAAC;AAClD,cAAc;AACd,UAAU,WAAW;IACjB,SAAS,CAAC,EAAE,oBAAoB,CAAC;CACpC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,eAAe,CAAC,WAAW,EAAE,WAAW,QAkDvD;AAMD,wBAAgB,8BAA8B,CAAC,IAAI,EAAE,iBAAiB,QAErE;AAGD,wBAAgB,yBAAyB,SAExC"}
1
+ {"version":3,"file":"initialize_block.d.ts","sourceRoot":"","sources":["../../../../../src/interface/ui/initialize_block.tsx"],"names":[],"mappings":"AAAA,mDAAmD,CAAC,MAAM;AAC1D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAC,iBAAiB,EAAC,MAAM,QAAQ,CAAC;AAOzC,MAAM;AACN,KAAK,oBAAoB,GAAG,MAAM,KAAK,CAAC,SAAS,CAAC;AAClD,cAAc;AACd,UAAU,WAAW;IACjB,SAAS,CAAC,EAAE,oBAAoB,CAAC;CACpC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,eAAe,CAAC,WAAW,EAAE,WAAW,QAoDvD;AAMD,wBAAgB,8BAA8B,CAAC,IAAI,EAAE,iBAAiB,QAErE;AAGD,wBAAgB,yBAAyB,SAExC"}
@@ -2,6 +2,7 @@ import '..';
2
2
  export { expandRecord } from './expand_record';
3
3
  export { initializeBlock } from './initialize_block';
4
4
  export { useBase } from './use_base';
5
+ export { useColorScheme } from '../../shared/ui/use_color_scheme';
5
6
  export { useCustomProperties } from './use_custom_properties';
6
7
  export { useRecords } from './use_records';
7
8
  export { useRunInfo } from './use_run_info';
@@ -1 +1 @@
1
- {"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../../../../../src/interface/ui/ui.ts"],"names":[],"mappings":"AAEA,OAAO,IAAI,CAAC;AAEZ,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;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O,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AACzC,OAAO,EAAC,OAAO,IAAI,eAAe,EAAC,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAC,OAAO,IAAI,SAAS,EAAC,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAC,OAAO,IAAI,YAAY,EAAC,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAC,OAAO,IAAI,SAAS,EAAC,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAC,OAAO,IAAI,MAAM,EAAC,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAC,OAAO,IAAI,UAAU,EAAC,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EACH,iBAAiB,EACjB,mBAAmB,EACnB,sBAAsB,GACzB,MAAM,8BAA8B,CAAC"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * A hook for checking whether Airtable is in light mode or dark mode.
3
+ *
4
+ * @returns An object with a `colorScheme` property, which can be `'light'` or `'dark'`.
5
+ *
6
+ * @example
7
+ * ```js
8
+ * import {useColorScheme} from '@airtable/blocks/[placeholder-path]/ui';
9
+ *
10
+ * function MyApp() {
11
+ * const {colorScheme} = useColorScheme();
12
+ * return (
13
+ * <div style={colorScheme === 'dark' ?
14
+ * {color: 'white', backgroundColor: 'black'} :
15
+ * {color: 'black', backgroundColor: 'white'}
16
+ * }>
17
+ * Tada!
18
+ * </div>
19
+ * );
20
+ * }
21
+ * ```
22
+ * @docsPath UI/hooks/useColorScheme
23
+ * @hook
24
+ */
25
+ export declare function useColorScheme(): {
26
+ colorScheme: 'light' | 'dark';
27
+ };
28
+ //# sourceMappingURL=use_color_scheme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use_color_scheme.d.ts","sourceRoot":"","sources":["../../../../../src/shared/ui/use_color_scheme.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAIH,wBAAgB,cAAc,IAAI;IAAC,WAAW,EAAE,OAAO,GAAG,MAAM,CAAA;CAAC,CAqBhE"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=use_color_scheme.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use_color_scheme.test.d.ts","sourceRoot":"","sources":["../../../../test/ui/use_color_scheme.test.tsx"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@airtable/blocks",
3
- "version": "0.0.0-experimental-d5ee5e823-20250501",
3
+ "version": "0.0.0-experimental-f1c9010b3-20250609",
4
4
  "description": "Airtable Blocks SDK",
5
5
  "repository": {
6
6
  "type": "git",