alloy 2.1.0 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +2 -1
- package/.github/workflows/build.yml +8 -9
- package/.github/workflows/cla.yaml +1 -1
- package/.github/workflows/publish.yml +47 -8
- package/Alloy/builtins/moment/lang/ar-dz.js +8 -8
- package/Alloy/builtins/moment/lang/ar-ly.js +8 -8
- package/Alloy/builtins/moment/lang/ar-ps.js +123 -0
- package/Alloy/builtins/moment/lang/ar.js +8 -8
- package/Alloy/builtins/moment/lang/be.js +2 -2
- package/Alloy/builtins/moment/lang/bs.js +14 -4
- package/Alloy/builtins/moment/lang/ca.js +6 -6
- package/Alloy/builtins/moment/lang/cs.js +5 -4
- package/Alloy/builtins/moment/lang/cv.js +2 -2
- package/Alloy/builtins/moment/lang/en-au.js +6 -6
- package/Alloy/builtins/moment/lang/en-ca.js +6 -6
- package/Alloy/builtins/moment/lang/en-gb.js +6 -6
- package/Alloy/builtins/moment/lang/en-ie.js +6 -6
- package/Alloy/builtins/moment/lang/en-il.js +6 -6
- package/Alloy/builtins/moment/lang/en-in.js +6 -6
- package/Alloy/builtins/moment/lang/en-nz.js +6 -6
- package/Alloy/builtins/moment/lang/en-sg.js +6 -6
- package/Alloy/builtins/moment/lang/it.js +4 -4
- package/Alloy/builtins/moment/lang/ku-kmr.js +125 -0
- package/Alloy/builtins/moment/lang/lt.js +2 -2
- package/Alloy/builtins/moment/lang/me.js +2 -2
- package/Alloy/builtins/moment/lang/nb.js +4 -4
- package/Alloy/builtins/moment/lang/nl-be.js +1 -1
- package/Alloy/builtins/moment/lang/nl.js +1 -1
- package/Alloy/builtins/moment/lang/oc-lnc.js +6 -6
- package/Alloy/builtins/moment/lang/ru.js +2 -2
- package/Alloy/builtins/moment/lang/sv.js +6 -6
- package/Alloy/builtins/moment/lang/tet.js +6 -6
- package/Alloy/builtins/moment/lang/tlh.js +8 -8
- package/Alloy/builtins/moment/lang/tzl.js +2 -2
- package/Alloy/builtins/moment/lang/uk.js +4 -4
- package/Alloy/builtins/moment/lang/x-pseudo.js +6 -6
- package/Alloy/builtins/moment.js +368 -365
- package/Alloy/builtins/string.js +1 -4
- package/Alloy/commands/compile/ast/controller.js +58 -29
- package/Alloy/commands/compile/compilerUtils.js +3 -2
- 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.ActivityIndicator.js +9 -0
- 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.Column.js +9 -0
- package/Alloy/commands/compile/parsers/Ti.UI.MaskedImage.js +9 -0
- package/Alloy/commands/compile/parsers/Ti.UI.NavigationWindow.js +0 -15
- package/Alloy/commands/compile/parsers/Ti.UI.Notification.js +9 -0
- package/Alloy/commands/compile/parsers/Ti.UI.OptionBar.js +0 -5
- package/Alloy/commands/compile/parsers/Ti.UI.ProgressBar.js +9 -0
- package/Alloy/commands/compile/parsers/Ti.UI.RefreshControl.js +9 -0
- package/Alloy/commands/compile/parsers/Ti.UI.Row.js +9 -0
- package/Alloy/commands/compile/parsers/Ti.UI.SearchBar.js +9 -0
- package/Alloy/commands/compile/parsers/Ti.UI.Shortcut.js +9 -0
- package/Alloy/commands/compile/parsers/Ti.UI.ShortcutItem.js +9 -0
- 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/new/index.js +1 -1
- package/Alloy/common/constants.js +3 -12
- package/Alloy/lib/alloy/backbone/1.6.0/backbone.js +2155 -0
- package/Alloy/lib/alloy/sync/localStorage.js +0 -8
- package/Alloy/lib/alloy/sync/sql.js +2 -2
- package/Alloy/plugin/plugin.py +1 -123
- package/Alloy/template/lib/alloy.js +0 -7
- package/Alloy/tiapp.js +1 -11
- package/README.md +16 -0
- package/package.json +6 -25
- package/platforms/windows/index.js +0 -4
- package/samples/apps/advanced/complex_styling/config.json +1 -4
- package/samples/apps/advanced/custom_tss_queries/styles/index.tss +0 -6
- package/samples/apps/advanced/device_query/specs/index.js +1 -12
- package/samples/apps/advanced/device_query/styles/index.tss +0 -12
- package/samples/apps/advanced/form_factor/views/index.xml +1 -7
- package/samples/apps/advanced/inheritance/controllers/index.js +4 -8
- package/samples/apps/advanced/inheritance/specs/baseDialog.js +2 -2
- package/samples/apps/advanced/master_detail/specs/row.js +3 -3
- package/samples/apps/advanced/proxy_property_requires/widgets/com.foo.widget/views/section.xml +3 -3
- package/samples/apps/advanced/proxy_property_requires/widgets/com.foo.widget/widget.json +2 -2
- package/samples/apps/advanced/require_children/widgets/alloy.container/widget.json +2 -2
- package/samples/apps/advanced/themes/specs/dialog.js +1 -18
- package/samples/apps/advanced/themes/specs/index.js +1 -45
- package/samples/apps/advanced/theming_widgets/widgets/starrating/widget.json +2 -2
- package/samples/apps/basics/builtins/specs/index.js +2 -2
- package/samples/apps/basics/config_json/config.json +1 -4
- package/samples/apps/basics/global_style/specs/item.js +2 -2
- package/samples/apps/basics/simple/specs/index.js +2 -2
- package/samples/apps/models/binding_tableview/controllers/tab_1.js +2 -2
- package/samples/apps/models/binding_tableview/controllers/tab_2.js +2 -2
- package/samples/apps/models/binding_tableview/controllers/tab_3.js +2 -2
- package/samples/apps/models/binding_tableview/controllers/tab_4.js +2 -2
- package/samples/apps/ui/buttonbar/views/index.xml +1 -1
- package/samples/apps/ui/switch/views/index.xml +2 -2
- package/samples/apps/widgets/basic/widgets/com.foo.widget/widget.json +2 -2
- package/samples/apps/widgets/complex/widgets/com.appcelerator.loading/widget.json +1 -1
- package/samples/apps/widgets/complex/widgets/com.testing.searchForBooks/widget.json +1 -1
- package/samples/apps/widgets/models/widgets/alloy.datatable/widget.json +1 -1
- package/samples/apps/widgets/wpath/widgets/com.test.hellobutton/widget.json +1 -1
- package/test/projects/HarnessTemplate/tiapp.xml +1 -0
- package/test/specs/new.js +0 -2
- package/test/specs/optimizer.js +0 -2
- package/Alloy/commands/compile/parsers/Ti.UI.iPhone.NavigationGroup.js +0 -58
package/Alloy/builtins/string.js
CHANGED
|
@@ -64,10 +64,7 @@ exports.lcfirst = function (text) {
|
|
|
64
64
|
* @param {String} amount Amount to format.
|
|
65
65
|
* @return {String} Amount formatted as a currency value.
|
|
66
66
|
*/
|
|
67
|
-
exports.formatCurrency =
|
|
68
|
-
var num = isNaN(amount) || amount === '' || amount === null ? 0.00 : amount;
|
|
69
|
-
return '$' + parseFloat(num).toFixed(2);
|
|
70
|
-
};
|
|
67
|
+
exports.formatCurrency = String.formatCurrency;
|
|
71
68
|
|
|
72
69
|
|
|
73
70
|
/**
|
|
@@ -6,15 +6,28 @@ 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
|
-
newCode = ''
|
|
17
|
-
|
|
16
|
+
newCode = '';
|
|
17
|
+
|
|
18
|
+
if (isProduction) {
|
|
19
|
+
GENCODE_OPTIONS.retainLines = false;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function buildExportAssignment(exportedName, localName) {
|
|
23
|
+
return types.expressionStatement(
|
|
24
|
+
types.assignmentExpression(
|
|
25
|
+
'=',
|
|
26
|
+
types.memberExpression(types.identifier('exports'), types.identifier(exportedName)),
|
|
27
|
+
types.identifier(localName)
|
|
28
|
+
)
|
|
29
|
+
);
|
|
30
|
+
}
|
|
18
31
|
|
|
19
32
|
try {
|
|
20
33
|
var ast = babylon.parse(code, { sourceFilename: file, sourceType: 'unambiguous' });
|
|
@@ -51,38 +64,54 @@ exports.processController = function(code, file) {
|
|
|
51
64
|
|
|
52
65
|
ExportNamedDeclaration: function(path) {
|
|
53
66
|
var node = path.node;
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
67
|
+
|
|
68
|
+
// Re-exports from another module (e.g. `export { foo } from './bar'`) are true
|
|
69
|
+
// module-level constructs — hoist them out of the controller body.
|
|
70
|
+
if (node.source) {
|
|
71
|
+
moduleCodes += generate(node, GENCODE_OPTIONS).code;
|
|
72
|
+
path.remove();
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// `export function show() {}`, `export const show = ...`, `export class X {}`
|
|
77
|
+
if (node.declaration) {
|
|
78
|
+
var decl = node.declaration;
|
|
79
|
+
var replacements = [decl];
|
|
80
|
+
if (decl.type === 'FunctionDeclaration' || decl.type === 'ClassDeclaration') {
|
|
81
|
+
if (decl.id && decl.id.name) {
|
|
82
|
+
replacements.push(buildExportAssignment(decl.id.name, decl.id.name));
|
|
59
83
|
}
|
|
60
|
-
})
|
|
84
|
+
} else if (decl.type === 'VariableDeclaration') {
|
|
85
|
+
decl.declarations.forEach(function (d) {
|
|
86
|
+
if (d.id && d.id.name) {
|
|
87
|
+
replacements.push(buildExportAssignment(d.id.name, d.id.name));
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
path.replaceWithMultiple(replacements);
|
|
92
|
+
return;
|
|
61
93
|
}
|
|
94
|
+
|
|
95
|
+
// `export { show }` or `export { show as displayShow }` — locally declared
|
|
96
|
+
// bindings get attached to the controller's local `exports` object.
|
|
97
|
+
if (node.specifiers && node.specifiers.length !== 0) {
|
|
98
|
+
var assignments = node.specifiers
|
|
99
|
+
.filter(function (specifier) { return specifier.local && specifier.local.name; })
|
|
100
|
+
.map(function (specifier) {
|
|
101
|
+
var localName = specifier.local.name;
|
|
102
|
+
var exportedName = (specifier.exported && specifier.exported.name) || localName;
|
|
103
|
+
return buildExportAssignment(exportedName, localName);
|
|
104
|
+
});
|
|
105
|
+
path.replaceWithMultiple(assignments);
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// Fallback: leave as-is at module level.
|
|
62
110
|
moduleCodes += generate(node, GENCODE_OPTIONS).code;
|
|
63
111
|
path.remove();
|
|
64
112
|
}
|
|
65
113
|
}, path.scope);
|
|
66
114
|
|
|
67
|
-
if (exportSpecifiers.length > 0) {
|
|
68
|
-
traverse(ast, {
|
|
69
|
-
enter: function(path) {
|
|
70
|
-
var node = path.node,
|
|
71
|
-
name;
|
|
72
|
-
if (node.type === 'VariableDeclaration') {
|
|
73
|
-
name = node.declarations[0].id.name;
|
|
74
|
-
} else if (node.type === 'FunctionDeclaration' || node.type === 'ClassDeclaration') {
|
|
75
|
-
name = node.id.name;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
if (exportSpecifiers.indexOf(name) !== -1) {
|
|
79
|
-
moduleCodes += generate(node, GENCODE_OPTIONS).code;
|
|
80
|
-
path.remove();
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
|
|
86
115
|
newCode = generate(ast, GENCODE_OPTIONS).code;
|
|
87
116
|
} catch (e) {
|
|
88
117
|
U.dieWithCodeFrame('Error generating AST for "' + file + '". Unexpected token at line ' + e.loc.line + ' column ' + e.loc.column, e.loc, code);
|
|
@@ -952,8 +952,9 @@ exports.loadController = function(file) {
|
|
|
952
952
|
U.die('Error reading controller file "' + file + '".', e);
|
|
953
953
|
}
|
|
954
954
|
|
|
955
|
+
var isProduction = compilerConfig.alloyConfig?.deploytype === 'production';
|
|
955
956
|
// get the base controller for this controller, also process import/export statements
|
|
956
|
-
var controller = astController.processController(contents, file);
|
|
957
|
+
var controller = astController.processController(contents, file, isProduction);
|
|
957
958
|
code.controller = controller.code;
|
|
958
959
|
code.parentControllerName = controller.base;
|
|
959
960
|
code.es6mods = controller.es6mods;
|
|
@@ -1018,7 +1019,7 @@ exports.generateCollectionBindingTemplate = function(args) {
|
|
|
1018
1019
|
code += ' if (e && e.fromAdapter) { return; }';
|
|
1019
1020
|
code += ' var opts = ' + handlerFunc + '.opts || {};';
|
|
1020
1021
|
code += ' var models = ' + whereCode + ';';
|
|
1021
|
-
code += ' var len = models.length;';
|
|
1022
|
+
code += ' var len = models ? models.length : 0;';
|
|
1022
1023
|
code += '<%= pre %>';
|
|
1023
1024
|
code += ' for (var i = 0; i < len; i++) {';
|
|
1024
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) {
|
|
@@ -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
|
};
|
|
@@ -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 = '',
|
|
@@ -260,7 +260,7 @@ function getPaths(project, templateName, testapp) {
|
|
|
260
260
|
// alloy paths
|
|
261
261
|
alloy: alloy,
|
|
262
262
|
template: path.join(alloy, 'template'),
|
|
263
|
-
readme: fs.existsSync(readMeFile) ? readMeFile : path.join(template, 'README'),
|
|
263
|
+
readme: readMeFile != undefined && fs.existsSync(readMeFile) ? readMeFile : path.join(template, 'README'),
|
|
264
264
|
appTemplate: (!testapp) ? customAppDir || path.join(projectTemplates, templateName, 'app') : path.join(sampleAppsDir, testapp),
|
|
265
265
|
projectTemplate: (!testapp) ? customTemplateDir || path.join(projectTemplates, templateName) : path.join(sampleAppsDir, testapp),
|
|
266
266
|
|
|
@@ -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';
|
|
@@ -152,9 +152,7 @@ var NS_ALLOY = 'Alloy',
|
|
|
152
152
|
NS_TI_MEDIA = 'Ti.Media',
|
|
153
153
|
NS_TI_UI_IOS = 'Ti.UI.iOS',
|
|
154
154
|
NS_TI_UI_IPAD = 'Ti.UI.iPad',
|
|
155
|
-
NS_TI_UI_IPHONE = 'Ti.UI.iPhone'
|
|
156
|
-
NS_TI_UI_MOBILEWEB = 'Ti.UI.MobileWeb',
|
|
157
|
-
NS_TI_UI_WINDOWS = 'Ti.UI.Windows';
|
|
155
|
+
NS_TI_UI_IPHONE = 'Ti.UI.iPhone';
|
|
158
156
|
|
|
159
157
|
exports.IMPLICIT_NAMESPACES = {
|
|
160
158
|
// Alloy
|
|
@@ -217,16 +215,9 @@ exports.IMPLICIT_NAMESPACES = {
|
|
|
217
215
|
Popover: NS_TI_UI_IPAD,
|
|
218
216
|
|
|
219
217
|
// Ti.UI.iPhone
|
|
220
|
-
NavigationGroup:
|
|
221
|
-
NS_TI_UI_MOBILEWEB : NS_TI_UI_IPHONE,
|
|
218
|
+
NavigationGroup: NS_TI_UI_IPHONE,
|
|
222
219
|
StatusBar: NS_TI_UI_IPHONE,
|
|
223
220
|
|
|
224
|
-
// Ti.UI.Windows
|
|
225
|
-
CommandBar: NS_TI_UI_WINDOWS,
|
|
226
|
-
AppBarButton: NS_TI_UI_WINDOWS,
|
|
227
|
-
AppBarToggleButton: NS_TI_UI_WINDOWS,
|
|
228
|
-
AppBarSeparator: NS_TI_UI_WINDOWS,
|
|
229
|
-
|
|
230
221
|
// Ti.UI.Window
|
|
231
222
|
LeftNavButton: 'Ti.UI.Window',
|
|
232
223
|
RightNavButton: 'Ti.UI.Window',
|