alloy 2.0.2 → 3.0.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.
- package/.eslintignore +0 -1
- package/.eslintrc.js +2 -1
- package/.github/dependabot.yml +4 -0
- package/.github/workflows/build.yml +12 -9
- package/.github/workflows/cla.yaml +1 -1
- package/.github/workflows/publish.yml +44 -5
- package/Alloy/builtins/moment/lang/af.js +52 -42
- package/Alloy/builtins/moment/lang/ar-dz.js +151 -42
- package/Alloy/builtins/moment/lang/ar-kw.js +42 -34
- package/Alloy/builtins/moment/lang/ar-ly.js +142 -81
- package/Alloy/builtins/moment/lang/ar-ma.js +43 -34
- package/Alloy/builtins/moment/lang/ar-ps.js +123 -0
- package/Alloy/builtins/moment/lang/ar-sa.js +77 -64
- package/Alloy/builtins/moment/lang/ar-tn.js +17 -9
- package/Alloy/builtins/moment/lang/ar.js +161 -95
- package/Alloy/builtins/moment/lang/az.js +54 -45
- package/Alloy/builtins/moment/lang/be.js +73 -51
- package/Alloy/builtins/moment/lang/bg.js +50 -41
- package/Alloy/builtins/moment/lang/bm.js +43 -38
- package/Alloy/builtins/moment/lang/bn-bd.js +140 -0
- package/Alloy/builtins/moment/lang/bn.js +78 -66
- package/Alloy/builtins/moment/lang/bo.js +83 -66
- package/Alloy/builtins/moment/lang/br.js +119 -47
- package/Alloy/builtins/moment/lang/bs.js +64 -43
- package/Alloy/builtins/moment/lang/ca.js +80 -56
- package/Alloy/builtins/moment/lang/cs.js +89 -68
- package/Alloy/builtins/moment/lang/cv.js +47 -35
- package/Alloy/builtins/moment/lang/cy.js +44 -14
- package/Alloy/builtins/moment/lang/da.js +44 -39
- package/Alloy/builtins/moment/lang/de-at.js +57 -42
- package/Alloy/builtins/moment/lang/de-ch.js +54 -42
- package/Alloy/builtins/moment/lang/de.js +56 -42
- package/Alloy/builtins/moment/lang/dv.js +65 -62
- package/Alloy/builtins/moment/lang/el.js +67 -49
- package/Alloy/builtins/moment/lang/en-au.js +56 -43
- package/Alloy/builtins/moment/lang/en-ca.js +53 -40
- package/Alloy/builtins/moment/lang/en-gb.js +56 -43
- package/Alloy/builtins/moment/lang/en-ie.js +56 -43
- package/Alloy/builtins/moment/lang/en-il.js +53 -39
- package/Alloy/builtins/moment/lang/en-in.js +79 -0
- package/Alloy/builtins/moment/lang/en-nz.js +56 -43
- package/Alloy/builtins/moment/lang/en-sg.js +79 -0
- package/Alloy/builtins/moment/lang/eo.js +49 -40
- package/Alloy/builtins/moment/lang/es-do.js +81 -53
- package/Alloy/builtins/moment/lang/es-mx.js +121 -0
- package/Alloy/builtins/moment/lang/es-us.js +83 -53
- package/Alloy/builtins/moment/lang/es.js +88 -58
- package/Alloy/builtins/moment/lang/et.js +60 -50
- package/Alloy/builtins/moment/lang/eu.js +56 -45
- package/Alloy/builtins/moment/lang/fa.js +88 -69
- package/Alloy/builtins/moment/lang/fi.js +75 -48
- package/Alloy/builtins/moment/lang/fil.js +69 -0
- package/Alloy/builtins/moment/lang/fo.js +48 -39
- package/Alloy/builtins/moment/lang/fr-ca.js +46 -38
- package/Alloy/builtins/moment/lang/fr-ch.js +49 -41
- package/Alloy/builtins/moment/lang/fr.js +78 -41
- package/Alloy/builtins/moment/lang/fy.js +51 -39
- package/Alloy/builtins/moment/lang/ga.js +48 -18
- package/Alloy/builtins/moment/lang/gd.js +82 -51
- package/Alloy/builtins/moment/lang/gl.js +56 -46
- package/Alloy/builtins/moment/lang/gom-deva.js +137 -0
- package/Alloy/builtins/moment/lang/gom-latn.js +71 -58
- package/Alloy/builtins/moment/lang/gu.js +30 -20
- package/Alloy/builtins/moment/lang/he.js +52 -43
- package/Alloy/builtins/moment/lang/hi.js +120 -64
- package/Alloy/builtins/moment/lang/hr.js +57 -43
- package/Alloy/builtins/moment/lang/hu.js +64 -44
- package/Alloy/builtins/moment/lang/hy-am.js +47 -36
- package/Alloy/builtins/moment/lang/id.js +46 -40
- package/Alloy/builtins/moment/lang/is.js +63 -43
- package/Alloy/builtins/moment/lang/it-ch.js +42 -35
- package/Alloy/builtins/moment/lang/it.js +91 -42
- package/Alloy/builtins/moment/lang/ja.js +113 -45
- package/Alloy/builtins/moment/lang/jv.js +46 -40
- package/Alloy/builtins/moment/lang/ka.js +66 -51
- package/Alloy/builtins/moment/lang/kk.js +47 -40
- package/Alloy/builtins/moment/lang/km.js +37 -32
- package/Alloy/builtins/moment/lang/kn.js +74 -64
- package/Alloy/builtins/moment/lang/ko.js +50 -44
- package/Alloy/builtins/moment/lang/ku-kmr.js +125 -0
- package/Alloy/builtins/moment/lang/ku.js +94 -83
- package/Alloy/builtins/moment/lang/ky.js +49 -40
- package/Alloy/builtins/moment/lang/lb.js +43 -30
- package/Alloy/builtins/moment/lang/lo.js +46 -38
- package/Alloy/builtins/moment/lang/lt.js +82 -63
- package/Alloy/builtins/moment/lang/lv.js +60 -51
- package/Alloy/builtins/moment/lang/me.js +53 -36
- package/Alloy/builtins/moment/lang/mi.js +17 -9
- package/Alloy/builtins/moment/lang/mk.js +47 -39
- package/Alloy/builtins/moment/lang/ml.js +54 -41
- package/Alloy/builtins/moment/lang/mn.js +48 -40
- package/Alloy/builtins/moment/lang/mr.js +143 -88
- package/Alloy/builtins/moment/lang/ms-my.js +45 -39
- package/Alloy/builtins/moment/lang/ms.js +44 -39
- package/Alloy/builtins/moment/lang/mt.js +47 -39
- package/Alloy/builtins/moment/lang/my.js +40 -30
- package/Alloy/builtins/moment/lang/nb.js +46 -36
- package/Alloy/builtins/moment/lang/ne.js +75 -65
- package/Alloy/builtins/moment/lang/nl-be.js +73 -46
- package/Alloy/builtins/moment/lang/nl.js +75 -46
- package/Alloy/builtins/moment/lang/nn.js +45 -34
- package/Alloy/builtins/moment/lang/oc-lnc.js +96 -0
- package/Alloy/builtins/moment/lang/pa-in.js +73 -63
- package/Alloy/builtins/moment/lang/pl.js +69 -43
- package/Alloy/builtins/moment/lang/pt-br.js +43 -34
- package/Alloy/builtins/moment/lang/pt.js +48 -38
- package/Alloy/builtins/moment/lang/ro.js +52 -39
- package/Alloy/builtins/moment/lang/ru.js +104 -61
- package/Alloy/builtins/moment/lang/sd.js +57 -62
- package/Alloy/builtins/moment/lang/se.js +42 -33
- package/Alloy/builtins/moment/lang/si.js +50 -40
- package/Alloy/builtins/moment/lang/sk.js +54 -53
- package/Alloy/builtins/moment/lang/sl.js +51 -41
- package/Alloy/builtins/moment/lang/sq.js +50 -41
- package/Alloy/builtins/moment/lang/sr-cyrl.js +71 -43
- package/Alloy/builtins/moment/lang/sr.js +74 -44
- package/Alloy/builtins/moment/lang/ss.js +50 -42
- package/Alloy/builtins/moment/lang/sv.js +52 -41
- package/Alloy/builtins/moment/lang/sw.js +47 -39
- package/Alloy/builtins/moment/lang/ta.js +78 -64
- package/Alloy/builtins/moment/lang/te.js +54 -43
- package/Alloy/builtins/moment/lang/tet.js +51 -38
- package/Alloy/builtins/moment/lang/tg.js +51 -38
- package/Alloy/builtins/moment/lang/th.js +47 -37
- package/Alloy/builtins/moment/lang/tk.js +102 -0
- package/Alloy/builtins/moment/lang/tl-ph.js +41 -34
- package/Alloy/builtins/moment/lang/tlh.js +69 -55
- package/Alloy/builtins/moment/lang/tr.js +83 -59
- package/Alloy/builtins/moment/lang/tzl.js +67 -57
- package/Alloy/builtins/moment/lang/tzm-latn.js +41 -33
- package/Alloy/builtins/moment/lang/tzm.js +40 -32
- package/Alloy/builtins/moment/lang/ug-cn.js +13 -9
- package/Alloy/builtins/moment/lang/uk.js +82 -57
- package/Alloy/builtins/moment/lang/ur.js +58 -62
- package/Alloy/builtins/moment/lang/uz-latn.js +46 -38
- package/Alloy/builtins/moment/lang/uz.js +43 -38
- package/Alloy/builtins/moment/lang/vi.js +56 -43
- package/Alloy/builtins/moment/lang/x-pseudo.js +61 -44
- package/Alloy/builtins/moment/lang/yo.js +45 -40
- package/Alloy/builtins/moment/lang/zh-cn.js +68 -46
- package/Alloy/builtins/moment/lang/zh-hk.js +61 -51
- package/Alloy/builtins/moment/lang/zh-mo.js +111 -0
- package/Alloy/builtins/moment/lang/zh-tw.js +57 -49
- package/Alloy/builtins/moment.js +2587 -1501
- package/Alloy/commands/compile/ast/controller.js +6 -2
- package/Alloy/commands/compile/compilerUtils.js +6 -8
- package/Alloy/commands/compile/parsers/Alloy.Abstract.FixedSpace.js +2 -11
- package/Alloy/commands/compile/parsers/Alloy.Abstract.FlexSpace.js +2 -11
- package/Alloy/commands/compile/parsers/Alloy.Abstract.Option.js +2 -2
- package/Alloy/commands/compile/parsers/Alloy.Abstract._ItemContainer.js +9 -2
- package/Alloy/commands/compile/parsers/Ti.UI.Android.CollapseToolbar.ContentView.js +13 -0
- package/Alloy/commands/compile/parsers/Ti.UI.Android.CollapseToolbar._ProxyProperty.js +13 -0
- package/Alloy/commands/compile/parsers/Ti.UI.Android.CollapseToolbar.js +35 -0
- package/Alloy/commands/compile/parsers/Ti.UI.Android.DrawerLayout._ProxyProperty.js +0 -1
- package/Alloy/commands/compile/parsers/Ti.UI.AttributedString.js +0 -5
- package/Alloy/commands/compile/parsers/Ti.UI.Button.js +2 -11
- package/Alloy/commands/compile/parsers/Ti.UI.NavigationWindow.js +0 -15
- package/Alloy/commands/compile/parsers/Ti.UI.OptionBar.js +0 -5
- package/Alloy/commands/compile/parsers/Ti.UI.PickerColumn.js +1 -1
- package/Alloy/commands/compile/parsers/Ti.UI.TabbedBar.js +0 -9
- package/Alloy/commands/compile/parsers/Ti.UI.Toolbar.js +0 -6
- package/Alloy/commands/generate/targets/widget.js +1 -1
- package/Alloy/commands/info/index.js +2 -2
- package/Alloy/common/constants.js +5 -3
- package/Alloy/lib/alloy/backbone/1.6.0/backbone.js +2155 -0
- package/Alloy/lib/alloy/underscore.js +1722 -1372
- package/Alloy/template/README +3 -9
- package/Alloy/template/app.tss +5 -12
- package/Alloy/template/controller.js +1 -1
- package/Alloy/template/gitignore.txt +3 -0
- package/Alloy/template/lib/alloy.js +0 -17
- package/Alloy/template/style.tss +0 -3
- package/Alloy/template/view.xml +4 -3
- package/Alloy/template/widget/style.tss +1 -2
- package/Alloy/tiapp.js +1 -11
- package/Alloy/utils.js +1 -1
- package/CHANGELOG.md +16 -0
- package/README.md +16 -0
- package/package.json +23 -46
- package/samples/lib/testUtils.js +1 -1
- package/test/lib/testUtils.js +1 -1
- package/test/projects/HarnessTemplate/tiapp.xml +1 -15
- package/test/specs/compile.js +3 -2
- package/test/specs/compilefile.js +3 -3
- package/test/specs/new.js +1 -1
- package/test/specs/optimizer.js +10 -13
- package/Alloy/commands/compile/parsers/Ti.UI.iPhone.NavigationGroup.js +0 -58
- package/dangerfile.js +0 -20
- package/samples/apps/advanced/complex_styling/themes/mobileweb/styles/app.tss +0 -11
- package/samples/apps/advanced/complex_styling/themes/mobileweb/styles/requiredlabel.tss +0 -4
- package/samples/apps/advanced/complex_styling/views/mobileweb/label.xml +0 -3
- package/samples/apps/advanced/device_query/_generated/mobileweb/alloy/controllers/index.js +0 -60
- package/samples/apps/advanced/dynamic_styling/views/mobileweb/features/autoStyle.xml +0 -54
- package/samples/apps/advanced/form_factor/_generated/mobileweb/alloy/controllers/index.js +0 -121
- package/samples/apps/advanced/inheritance/_generated/mobileweb/alloy/controllers/animatedDialog.js +0 -44
- package/samples/apps/advanced/inheritance/_generated/mobileweb/alloy/controllers/baseDialog.js +0 -88
- package/samples/apps/advanced/inheritance/_generated/mobileweb/alloy/controllers/index.js +0 -59
- package/samples/apps/advanced/master_detail/_generated/mobileweb/alloy/controllers/detail.js +0 -102
- package/samples/apps/advanced/master_detail/_generated/mobileweb/alloy/controllers/index.js +0 -35
- package/samples/apps/advanced/master_detail/_generated/mobileweb/alloy/controllers/master.js +0 -53
- package/samples/apps/advanced/master_detail/_generated/mobileweb/alloy/controllers/row.js +0 -67
- package/samples/apps/advanced/native_modules/_generated/mobileweb/alloy/controllers/index.js +0 -37
- package/samples/apps/advanced/platform_folders/_generated/mobileweb/alloy/controllers/index.js +0 -60
- package/samples/apps/advanced/proxy_property_requires/_generated/mobileweb/alloy/controllers/index.js +0 -207
- package/samples/apps/advanced/proxy_property_requires/_generated/mobileweb/alloy/controllers/proxy.js +0 -51
- package/samples/apps/advanced/proxy_property_requires/_generated/mobileweb/alloy/controllers/window.js +0 -49
- package/samples/apps/advanced/proxy_property_requires/_generated/mobileweb/alloy/widgets/com.foo.widget/controllers/row.js +0 -46
- package/samples/apps/advanced/proxy_property_requires/_generated/mobileweb/alloy/widgets/com.foo.widget/controllers/row_bind.js +0 -46
- package/samples/apps/advanced/proxy_property_requires/_generated/mobileweb/alloy/widgets/com.foo.widget/controllers/section.js +0 -59
- package/samples/apps/advanced/proxy_property_requires/_generated/mobileweb/alloy/widgets/com.foo.widget/styles/row.js +0 -14
- package/samples/apps/advanced/proxy_property_requires/_generated/mobileweb/alloy/widgets/com.foo.widget/styles/row_bind.js +0 -14
- package/samples/apps/advanced/proxy_property_requires/_generated/mobileweb/alloy/widgets/com.foo.widget/styles/section.js +0 -14
- package/samples/apps/advanced/themes/_generated/mobileweb/alloy/controllers/dialog.js +0 -112
- package/samples/apps/advanced/themes/_generated/mobileweb/alloy/controllers/index.js +0 -118
- package/samples/apps/basics/builtins/_generated/mobileweb/alloy/controllers/index.js +0 -102
- package/samples/apps/basics/config_json/_generated/mobileweb/alloy/controllers/index.js +0 -49
- package/samples/apps/basics/controller_events/_generated/mobileweb/alloy/controllers/CustomView.js +0 -60
- package/samples/apps/basics/controller_events/_generated/mobileweb/alloy/controllers/index.js +0 -57
- package/samples/apps/basics/global_style/_generated/mobileweb/alloy/controllers/index.js +0 -40
- package/samples/apps/basics/global_style/_generated/mobileweb/alloy/controllers/item.js +0 -45
- package/samples/apps/basics/markup_events/_generated/mobileweb/alloy/controllers/index.js +0 -49
- package/samples/apps/basics/markup_require/_generated/mobileweb/alloy/controllers/bottom.js +0 -42
- package/samples/apps/basics/markup_require/_generated/mobileweb/alloy/controllers/index.js +0 -49
- package/samples/apps/basics/markup_require/_generated/mobileweb/alloy/controllers/middle.js +0 -45
- package/samples/apps/basics/markup_require/_generated/mobileweb/alloy/controllers/theRest.js +0 -41
- package/samples/apps/basics/simple/_generated/mobileweb/alloy/controllers/index.js +0 -49
- package/samples/apps/models/journal/views/mobileweb/index.xml +0 -19
- package/samples/apps/widgets/complex/widgets/com.appcelerator.loading/assets/mobileweb/images/00.png +0 -0
- package/samples/apps/widgets/complex/widgets/com.appcelerator.loading/assets/mobileweb/images/01.png +0 -0
- package/samples/apps/widgets/complex/widgets/com.appcelerator.loading/assets/mobileweb/images/02.png +0 -0
- package/samples/apps/widgets/complex/widgets/com.appcelerator.loading/assets/mobileweb/images/03.png +0 -0
- package/samples/apps/widgets/complex/widgets/com.appcelerator.loading/assets/mobileweb/images/04.png +0 -0
- package/samples/apps/widgets/complex/widgets/com.appcelerator.loading/assets/mobileweb/images/05.png +0 -0
- package/samples/apps/widgets/complex/widgets/com.appcelerator.loading/assets/mobileweb/images/06.png +0 -0
- package/samples/apps/widgets/complex/widgets/com.appcelerator.loading/assets/mobileweb/images/07.png +0 -0
- package/samples/apps/widgets/complex/widgets/com.appcelerator.loading/assets/mobileweb/images/08.png +0 -0
- package/samples/apps/widgets/complex/widgets/com.appcelerator.loading/assets/mobileweb/images/09.png +0 -0
- package/samples/apps/widgets/complex/widgets/com.appcelerator.loading/assets/mobileweb/images/10.png +0 -0
- package/samples/apps/widgets/complex/widgets/com.appcelerator.loading/assets/mobileweb/images/11.png +0 -0
- package/samples/apps/widgets/complex/widgets/com.appcelerator.loading/assets/mobileweb/images/spinner.png +0 -0
|
@@ -6,16 +6,20 @@ var U = require('../../../utils'),
|
|
|
6
6
|
|
|
7
7
|
var isBaseControllerExportExpression = types.buildMatchMemberExpression('exports.baseController');
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
let GENCODE_OPTIONS = {
|
|
10
10
|
retainLines: true
|
|
11
11
|
};
|
|
12
12
|
|
|
13
|
-
exports.processController = function(code, file) {
|
|
13
|
+
exports.processController = function(code, file, isProduction = false) {
|
|
14
14
|
var baseController = '',
|
|
15
15
|
moduleCodes = '',
|
|
16
16
|
newCode = '',
|
|
17
17
|
exportSpecifiers = [];
|
|
18
18
|
|
|
19
|
+
if (isProduction) {
|
|
20
|
+
GENCODE_OPTIONS.retainLines = false;
|
|
21
|
+
}
|
|
22
|
+
|
|
19
23
|
try {
|
|
20
24
|
var ast = babylon.parse(code, { sourceFilename: file, sourceType: 'unambiguous' });
|
|
21
25
|
|
|
@@ -4,7 +4,7 @@ var U = require('../../utils'),
|
|
|
4
4
|
os = require('os'),
|
|
5
5
|
fs = require('fs-extra'),
|
|
6
6
|
walkSync = require('walk-sync'),
|
|
7
|
-
jsonlint = require('jsonlint'),
|
|
7
|
+
jsonlint = require('@prantlf/jsonlint'),
|
|
8
8
|
logger = require('../../logger'),
|
|
9
9
|
astController = require('./ast/controller'),
|
|
10
10
|
_ = require('lodash'),
|
|
@@ -225,7 +225,7 @@ exports.getParserArgs = function(node, state, opts) {
|
|
|
225
225
|
} else {
|
|
226
226
|
return;
|
|
227
227
|
}
|
|
228
|
-
}
|
|
228
|
+
}
|
|
229
229
|
|
|
230
230
|
if (/(^|\+)\s*(?:(?:Ti|Titanium|Alloy.Globals|Alloy.CFG|\$.args)\.|L\(.+\)\s*$|WPATH\()/.test(theValue)) {
|
|
231
231
|
var match = theValue.match(/^\s*L\([^'"]+\)\s*$/);
|
|
@@ -772,9 +772,6 @@ function updateImplicitNamspaces(platform) {
|
|
|
772
772
|
break;
|
|
773
773
|
case 'ios':
|
|
774
774
|
break;
|
|
775
|
-
case 'mobileweb':
|
|
776
|
-
CONST.IMPLICIT_NAMESPACES.NavigationGroup = 'Ti.UI.MobileWeb';
|
|
777
|
-
break;
|
|
778
775
|
}
|
|
779
776
|
}
|
|
780
777
|
|
|
@@ -955,8 +952,9 @@ exports.loadController = function(file) {
|
|
|
955
952
|
U.die('Error reading controller file "' + file + '".', e);
|
|
956
953
|
}
|
|
957
954
|
|
|
955
|
+
var isProduction = compilerConfig.alloyConfig?.deploytype === 'production';
|
|
958
956
|
// get the base controller for this controller, also process import/export statements
|
|
959
|
-
var controller = astController.processController(contents, file);
|
|
957
|
+
var controller = astController.processController(contents, file, isProduction);
|
|
960
958
|
code.controller = controller.code;
|
|
961
959
|
code.parentControllerName = controller.base;
|
|
962
960
|
code.es6mods = controller.es6mods;
|
|
@@ -990,7 +988,7 @@ exports.validateNodeName = function(node, names) {
|
|
|
990
988
|
exports.generateCollectionBindingTemplate = function(args) {
|
|
991
989
|
var code = '';
|
|
992
990
|
var COLLECTION_BINDING_EVENTS = CONST.COLLECTION_BINDING_EVENTS_092;
|
|
993
|
-
|
|
991
|
+
|
|
994
992
|
// Check if not 0.9.2 and if it's a supported version as we'll default to 0.9.2 if the version is not supported
|
|
995
993
|
if (compilerConfig.backbone !== '0.9.2' && CONST.SUPPORTED_BACKBONE_VERSIONS.includes(compilerConfig.backbone)) {
|
|
996
994
|
COLLECTION_BINDING_EVENTS = CONST.COLLECTION_BINDING_EVENTS;
|
|
@@ -1021,7 +1019,7 @@ exports.generateCollectionBindingTemplate = function(args) {
|
|
|
1021
1019
|
code += ' if (e && e.fromAdapter) { return; }';
|
|
1022
1020
|
code += ' var opts = ' + handlerFunc + '.opts || {};';
|
|
1023
1021
|
code += ' var models = ' + whereCode + ';';
|
|
1024
|
-
code += ' var len = models.length;';
|
|
1022
|
+
code += ' var len = models ? models.length : 0;';
|
|
1025
1023
|
code += '<%= pre %>';
|
|
1026
1024
|
code += ' for (var i = 0; i < len; i++) {';
|
|
1027
1025
|
code += ' var <%= localModel %> = models[i];';
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
var U = require('../../../utils'),
|
|
2
2
|
CU = require('../compilerUtils'),
|
|
3
|
-
tiapp = require('../../../tiapp')
|
|
4
|
-
iOSProxy;
|
|
5
|
-
|
|
6
|
-
var MIN_VERSION = '5.4.0';
|
|
3
|
+
tiapp = require('../../../tiapp');
|
|
7
4
|
|
|
8
5
|
exports.parse = function(node, state) {
|
|
9
6
|
return require('./base').parse(node, state, parse);
|
|
@@ -13,18 +10,12 @@ function parse(node, state, args) {
|
|
|
13
10
|
// width is a valid property for a FIXED_SPACE button, add in if specified
|
|
14
11
|
var width = (args.createArgs.width) ? ", width:'" + args.createArgs.width + "'" : '';
|
|
15
12
|
|
|
16
|
-
if (tiapp.version.gte(tiapp.getSdkVersion(), MIN_VERSION)) {
|
|
17
|
-
iOSProxy = 'iOS';
|
|
18
|
-
} else {
|
|
19
|
-
iOSProxy = 'iPhone';
|
|
20
|
-
}
|
|
21
|
-
|
|
22
13
|
return {
|
|
23
14
|
parent: {
|
|
24
15
|
node: node,
|
|
25
16
|
symbol: args.symbol
|
|
26
17
|
},
|
|
27
18
|
styles: state.styles,
|
|
28
|
-
code: args.symbol + ' = Ti.UI.createButton({systemButton: Ti.UI.
|
|
19
|
+
code: args.symbol + ' = Ti.UI.createButton({systemButton: Ti.UI.iOS.SystemButton.FIXED_SPACE' + width + '});'
|
|
29
20
|
};
|
|
30
21
|
}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
var U = require('../../../utils'),
|
|
2
2
|
CU = require('../compilerUtils'),
|
|
3
|
-
tiapp = require('../../../tiapp')
|
|
4
|
-
iOSProxy;
|
|
5
|
-
|
|
6
|
-
var MIN_VERSION = '5.4.0';
|
|
3
|
+
tiapp = require('../../../tiapp');
|
|
7
4
|
|
|
8
5
|
exports.parse = function(node, state) {
|
|
9
6
|
return require('./base').parse(node, state, parse);
|
|
@@ -11,18 +8,12 @@ exports.parse = function(node, state) {
|
|
|
11
8
|
|
|
12
9
|
function parse(node, state, args) {
|
|
13
10
|
|
|
14
|
-
if (tiapp.version.gte(tiapp.getSdkVersion(), MIN_VERSION)) {
|
|
15
|
-
iOSProxy = 'iOS';
|
|
16
|
-
} else {
|
|
17
|
-
iOSProxy = 'iPhone';
|
|
18
|
-
}
|
|
19
|
-
|
|
20
11
|
return {
|
|
21
12
|
parent: {
|
|
22
13
|
node: node,
|
|
23
14
|
symbol: args.symbol
|
|
24
15
|
},
|
|
25
16
|
styles: state.styles,
|
|
26
|
-
code: args.symbol + ' = Ti.UI.createButton({systemButton: Ti.UI.
|
|
17
|
+
code: args.symbol + ' = Ti.UI.createButton({systemButton: Ti.UI.iOS.SystemButton.FLEXIBLE_SPACE});'
|
|
27
18
|
};
|
|
28
19
|
}
|
|
@@ -25,9 +25,9 @@ function parse(node, state, args) {
|
|
|
25
25
|
|
|
26
26
|
if (attrName) {
|
|
27
27
|
if (args.createArgs[attrName]) {
|
|
28
|
-
code =
|
|
28
|
+
code = `var ${attrVarName} = ${codePush} - 1`;
|
|
29
29
|
} else {
|
|
30
|
-
code =
|
|
30
|
+
code = `var ${attrVarName} = undefined; ${codePush}`;
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
|
|
@@ -21,16 +21,23 @@ exports.parse = function(node, state) {
|
|
|
21
21
|
};
|
|
22
22
|
|
|
23
23
|
function parse(node, state, args) {
|
|
24
|
-
var
|
|
24
|
+
var children = U.XML.getElementsFromNodes(node.childNodes),
|
|
25
|
+
def = fixDefinition(state.itemContainerDefinition),
|
|
25
26
|
config = CU.getCompilerConfig(),
|
|
26
27
|
isAndroid = config && config.alloyConfig && config.alloyConfig.platform === 'android',
|
|
27
28
|
androidView = null,
|
|
28
29
|
extras = [],
|
|
29
30
|
code = '';
|
|
30
31
|
|
|
31
|
-
|
|
32
|
+
// iterate through all children
|
|
33
|
+
_.each(children, function(child) {
|
|
32
34
|
var childArgs = CU.getParserArgs(child, state);
|
|
33
35
|
|
|
36
|
+
// validate the child element
|
|
37
|
+
if (!CU.isNodeForCurrentPlatform(child)) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
|
|
34
41
|
// do translations
|
|
35
42
|
_.each(def.translations, function(t) {
|
|
36
43
|
if (childArgs.fullname === t.from) {
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const _ = require('lodash');
|
|
2
|
+
|
|
3
|
+
exports.parse = function(node, state) {
|
|
4
|
+
_.extend(state, {
|
|
5
|
+
proxyPropertyDefinition: {
|
|
6
|
+
parents: [
|
|
7
|
+
'Ti.UI.Android.CollapseToolbar',
|
|
8
|
+
'Ti.UI.iPad.Popover'
|
|
9
|
+
]
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
return require('./Ti.UI.Android.CollapseToolbar._ProxyProperty').parse(node, state);
|
|
13
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const _ = require('lodash');
|
|
2
|
+
|
|
3
|
+
exports.parse = function(node, state) {
|
|
4
|
+
_.extend(state, {
|
|
5
|
+
proxyPropertyDefinition: {
|
|
6
|
+
parents: [
|
|
7
|
+
'Ti.UI.Android.CollapseToolbar',
|
|
8
|
+
'Ti.UI.iPad.Popover'
|
|
9
|
+
]
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
return require('./Alloy.Abstract._ProxyProperty').parse(node, state);
|
|
13
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
const _ = require('lodash'),
|
|
2
|
+
U = require('../../../utils'),
|
|
3
|
+
tiapp = require('../../../tiapp'),
|
|
4
|
+
MIN_VERSION = '12.1.0';
|
|
5
|
+
|
|
6
|
+
exports.parse = function(node, state) {
|
|
7
|
+
return require('./base').parse(node, state, parse);
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
function parse(node, state, args) {
|
|
11
|
+
const tiappSdkVersion = tiapp.getSdkVersion();
|
|
12
|
+
if (tiapp.version.lt(tiappSdkVersion, MIN_VERSION)) {
|
|
13
|
+
U.die(`Ti.UI.Android.CollapseToolbar requires Titanium SDK ${MIN_VERSION}+`);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
var children = U.XML.getElementsFromNodes(node.childNodes),
|
|
17
|
+
code = '',
|
|
18
|
+
extras = [],
|
|
19
|
+
proxyProperties = {};
|
|
20
|
+
|
|
21
|
+
// add all proxy properties at creation time
|
|
22
|
+
_.each(proxyProperties, function(v, k) {
|
|
23
|
+
extras.push([k, v]);
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
// if we got any extras, add them to the state
|
|
27
|
+
if (extras.length) {
|
|
28
|
+
state.extraStyle = styler.createVariableStyle(extras);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
viewState = require('./default').parse(node, state);
|
|
32
|
+
viewState.code = code + viewState.code;
|
|
33
|
+
|
|
34
|
+
return viewState;
|
|
35
|
+
}
|
|
@@ -4,16 +4,11 @@ var _ = require('lodash'),
|
|
|
4
4
|
CU = require('../compilerUtils'),
|
|
5
5
|
tiapp = require('../../../tiapp');
|
|
6
6
|
|
|
7
|
-
var MIN_VERSION = '3.6.0';
|
|
8
|
-
|
|
9
7
|
exports.parse = function(node, state) {
|
|
10
8
|
return require('./base').parse(node, state, parse);
|
|
11
9
|
};
|
|
12
10
|
|
|
13
11
|
function parse(node, state, args) {
|
|
14
|
-
if (tiapp.version.lt(tiapp.getSdkVersion(), MIN_VERSION)) {
|
|
15
|
-
U.die('Ti.UI.AttributedString (line ' + node.lineNumber + ') requires Titanium 3.6.0+');
|
|
16
|
-
}
|
|
17
12
|
|
|
18
13
|
// Get label text from node text, if present
|
|
19
14
|
var nodeText = U.XML.getNodeText(node);
|
|
@@ -2,10 +2,7 @@ var _ = require('lodash'),
|
|
|
2
2
|
styler = require('../styler'),
|
|
3
3
|
CU = require('../compilerUtils'),
|
|
4
4
|
U = require('../../../utils'),
|
|
5
|
-
tiapp = require('../../../tiapp')
|
|
6
|
-
iOSProxy;
|
|
7
|
-
|
|
8
|
-
var MIN_VERSION = '5.4.0';
|
|
5
|
+
tiapp = require('../../../tiapp');
|
|
9
6
|
|
|
10
7
|
var systemButtons = [
|
|
11
8
|
'ACTION', 'ACTIVITY', 'ADD', 'BOOKMARKS', 'CAMERA', 'CANCEL', 'COMPOSE', 'CONTACT_ADD',
|
|
@@ -25,15 +22,9 @@ function parse(node, state, args) {
|
|
|
25
22
|
state.extraStyle = styler.createVariableStyle('title', U.possibleMultilineString(U.trim(nodeText.replace(/'/g, "\\'"))));
|
|
26
23
|
}
|
|
27
24
|
|
|
28
|
-
if (tiapp.version.gte(tiapp.getSdkVersion(), MIN_VERSION)) {
|
|
29
|
-
iOSProxy = 'iOS';
|
|
30
|
-
} else {
|
|
31
|
-
iOSProxy = 'iPhone';
|
|
32
|
-
}
|
|
33
|
-
|
|
34
25
|
var systemButton = node.getAttribute('systemButton');
|
|
35
26
|
if (_.includes(systemButtons, systemButton)) {
|
|
36
|
-
node.setAttribute('systemButton', 'Ti.UI.
|
|
27
|
+
node.setAttribute('systemButton', 'Ti.UI.iOS.SystemButton.' + systemButton);
|
|
37
28
|
}
|
|
38
29
|
|
|
39
30
|
// Generate runtime code using default
|
|
@@ -4,24 +4,13 @@ var _ = require('lodash'),
|
|
|
4
4
|
CU = require('../compilerUtils'),
|
|
5
5
|
tiapp = require('../../../tiapp');
|
|
6
6
|
|
|
7
|
-
const MIN_VERSION_FOR_IOS = '3.1.3';
|
|
8
|
-
const MIN_VERSION = '8.0.0';
|
|
9
|
-
const MIN_ANDROID_TABGROUP_CHILD = '8.3.0';
|
|
10
|
-
|
|
11
7
|
exports.parse = function(node, state) {
|
|
12
8
|
return require('./base').parse(node, state, parse);
|
|
13
9
|
};
|
|
14
10
|
|
|
15
11
|
function parse(node, state, args) {
|
|
16
|
-
const tiappSdkVersion = tiapp.getSdkVersion();
|
|
17
12
|
const platform = CU.getCompilerConfig().alloyConfig.platform;
|
|
18
|
-
if (tiapp.version.lt(tiappSdkVersion, MIN_VERSION_FOR_IOS)) {
|
|
19
|
-
U.die(`Ti.UI.iOS.NavigationWindow (line ${node.lineNumber}) requires Titanium ${MIN_VERSION_FOR_IOS}+`);
|
|
20
|
-
}
|
|
21
13
|
|
|
22
|
-
if (tiapp.version.lt(tiappSdkVersion, MIN_VERSION)) {
|
|
23
|
-
node.setAttribute('ns', 'Ti.UI.iOS');
|
|
24
|
-
}
|
|
25
14
|
|
|
26
15
|
var children = U.XML.getElementsFromNodes(node.childNodes),
|
|
27
16
|
err = ['NavigationWindow must have only one child element, which must be a Window or TabGroup'],
|
|
@@ -37,10 +26,6 @@ function parse(node, state, args) {
|
|
|
37
26
|
theNode = CU.validateNodeName(child, [ 'Ti.UI.Window', 'Ti.UI.TabGroup' ]),
|
|
38
27
|
windowSymbol;
|
|
39
28
|
|
|
40
|
-
if (platform === 'android' && theNode === 'Ti.UI.TabGroup' && tiapp.version.lt(tiappSdkVersion, MIN_ANDROID_TABGROUP_CHILD)) {
|
|
41
|
-
U.die(`TabGroup can only be a child of a NavigationWindow on Android from SDK ${MIN_ANDROID_TABGROUP_CHILD} onwards. Current SDK is ${tiappSdkVersion}`);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
29
|
// generate the code for the child first
|
|
45
30
|
if (theNode) {
|
|
46
31
|
code += CU.generateNodeExtended(child, state, {
|
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
const _ = require('lodash');
|
|
2
2
|
const tiapp = require('../../../tiapp');
|
|
3
3
|
const U = require('../../../utils');
|
|
4
|
-
const MIN_VERSION = '10.0.0';
|
|
5
4
|
|
|
6
5
|
exports.parse = function(node, state) {
|
|
7
|
-
const tiappSdkVersion = tiapp.getSdkVersion();
|
|
8
|
-
if (tiapp.version.lt(tiappSdkVersion, MIN_VERSION)) {
|
|
9
|
-
U.die(`Ti.UI.OptionBar requires Titanium SDK ${MIN_VERSION}+`);
|
|
10
|
-
}
|
|
11
6
|
return require('./Ti.UI.ButtonBar').parse(node, state);
|
|
12
7
|
};
|
|
@@ -72,7 +72,7 @@ function parse(node, state, args) {
|
|
|
72
72
|
}
|
|
73
73
|
code += _.template(CU.generateCollectionBindingTemplate(args))({
|
|
74
74
|
localModel: localModel,
|
|
75
|
-
pre: 'var rows=[];\n_.each(' + args.symbol + '.
|
|
75
|
+
pre: 'var rows=[];\n_.each(' + args.symbol + '.rows, function(r) { ' + args.symbol + '.removeRow(r);});\n',
|
|
76
76
|
items: rowCode,
|
|
77
77
|
post: '_.each(rows, function(row) { ' + args.symbol + '.addRow(row); });'
|
|
78
78
|
});
|
|
@@ -1,16 +1,7 @@
|
|
|
1
1
|
const tiapp = require('../../../tiapp');
|
|
2
2
|
const CU = require('../compilerUtils');
|
|
3
3
|
const U = require('../../../utils');
|
|
4
|
-
const MIN_VERSION = '8.0.0';
|
|
5
4
|
|
|
6
5
|
exports.parse = function(node, state) {
|
|
7
|
-
const tiappSdkVersion = tiapp.getSdkVersion();
|
|
8
|
-
if (tiapp.version.lt(tiappSdkVersion, MIN_VERSION)) {
|
|
9
|
-
const platform = CU.getCompilerConfig().alloyConfig.platform;
|
|
10
|
-
if (platform !== 'ios') {
|
|
11
|
-
U.die(`Ti.UI.TabbedBar for ${platform} requires Titanium ${MIN_VERSION}+`);
|
|
12
|
-
}
|
|
13
|
-
node.setAttribute('ns', 'Ti.UI.iOS');
|
|
14
|
-
}
|
|
15
6
|
return require('./Ti.UI.ButtonBar').parse(node, state);
|
|
16
7
|
};
|
|
@@ -6,12 +6,6 @@ var _ = require('lodash'),
|
|
|
6
6
|
|
|
7
7
|
exports.parse = function(node, state) {
|
|
8
8
|
var platform = CU.getCompilerConfig().alloyConfig.platform;
|
|
9
|
-
if (tiapp.version.lt(tiapp.getSdkVersion(), '6.2.0')) {
|
|
10
|
-
if (platform !== 'ios') {
|
|
11
|
-
U.die('Ti.UI.Toolbar requires Titanium 6.2.0+');
|
|
12
|
-
}
|
|
13
|
-
node.setAttribute('ns', 'Ti.UI.iOS');
|
|
14
|
-
}
|
|
15
9
|
|
|
16
10
|
var eventObject = 'e',
|
|
17
11
|
code = '',
|
|
@@ -13,11 +13,11 @@ var info = {
|
|
|
13
13
|
var desc = {
|
|
14
14
|
properties: {
|
|
15
15
|
Description: 'Local persistence adapter that uses Ti.App.Properties storage',
|
|
16
|
-
platforms: ['android', 'ios'
|
|
16
|
+
platforms: ['android', 'ios']
|
|
17
17
|
},
|
|
18
18
|
sql: {
|
|
19
19
|
Description: 'Local persistence adapter that uses SQLite storage',
|
|
20
|
-
platforms: ['android', 'ios'
|
|
20
|
+
platforms: ['android', 'ios']
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
23
|
console.log(JSON.stringify(desc, null, 4));
|
|
@@ -47,7 +47,7 @@ exports.SKIP_EVENT_HANDLING = ['Ti.UI.ListItem', 'Alloy.Abstract.ItemTemplate'];
|
|
|
47
47
|
exports.ADAPTERS = ['localStorage', 'properties', 'sql'];
|
|
48
48
|
exports.CONTROLLER_NODES = ['Alloy.Require', 'Alloy.Widget'];
|
|
49
49
|
exports.DEFAULT_BACKBONE_VERSION = '0.9.2';
|
|
50
|
-
exports.SUPPORTED_BACKBONE_VERSIONS = ['0.9.2', '1.1.2', '1.3.3', '1.4.0'];
|
|
50
|
+
exports.SUPPORTED_BACKBONE_VERSIONS = ['0.9.2', '1.1.2', '1.3.3', '1.4.0', '1.6.0'];
|
|
51
51
|
|
|
52
52
|
// property names
|
|
53
53
|
exports.CLASS_PROPERTY = 'classes';
|
|
@@ -235,8 +235,10 @@ exports.IMPLICIT_NAMESPACES = {
|
|
|
235
235
|
TitleControl: 'Ti.UI.Window',
|
|
236
236
|
WindowToolbar: 'Ti.UI.Window',
|
|
237
237
|
|
|
238
|
-
|
|
239
|
-
|
|
238
|
+
ContentView: isTitanium && Ti.Platform.osname === 'android' ?
|
|
239
|
+
'Ti.UI.Android.CollapseToolbar' : 'Ti.UI.iPad.Popover',
|
|
240
|
+
|
|
241
|
+
CollapseToolbar: 'Ti.UI.Android',
|
|
240
242
|
|
|
241
243
|
DrawerLayout: 'Ti.UI.Android',
|
|
242
244
|
LeftView: 'Ti.UI.Android.DrawerLayout',
|